Skip to content

Commit 4565d95

Browse files
committed
Updating docs
1 parent eaf7810 commit 4565d95

File tree

2 files changed

+38
-21
lines changed

2 files changed

+38
-21
lines changed

_datafiles/guides/building/scripting/FUNCTIONS_ITEMS.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ActorObjects are the basic object that represents Users and NPCs
1616
- [ItemObject.SetTempData(key string, value any)](#itemobjectsettempdatakey-string-value-any)
1717
- [ItemObject.GetTempData(key string) any](#itemobjectgettempdatakey-string-any)
1818
- [ItemObject.Rename(newName string \[, displayNameOrStyle string\])](#itemobjectrenamenewname-string--displaynameorstyle-string)
19+
- [ItemObject.ShorthandId() string](#itemobjectshorthandid-string)
1920
- [ItemObject.Redescribe(newDescription string)](#itemobjectredescribenewdescription-string)
2021

2122
## [CreateItem(itemId int) ItemObject ](/internal/scripting/item_func.go)
@@ -74,10 +75,10 @@ Sets temporary data of any sort on the item. This data is not saved/loaded when
7475
| Argument | Explanation |
7576
| --- | --- |
7677
| key | The name to store the data under. Also used to retrieve the data later. |
77-
| vaue | The data to store. |
78+
| value | The data to store. |
7879

7980
## [ItemObject.GetTempData(key string) any](/internal/scripting/item_func.go)
80-
Sets temporary data of any sort on the item. This data is not saved/loaded when despawning.
81+
Gets temporary data of any sort on the item. This data is not saved/loaded when despawning.
8182

8283
| Argument | Explanation |
8384
| --- | --- |
@@ -92,6 +93,9 @@ Renames the item, also optionally provide a fancy name or colorpattern
9293
| newName | The plaintext name. |
9394
| displayNameOrStyle | A fancy name in ansi tags, color short tags, or a pattern like :flame |
9495

96+
## [ItemObject.ShorthandId() string](/internal/scripting/item_func.go)
97+
Returns the shorthand identifier for the item.
98+
9599
## [ItemObject.Redescribe(newDescription string)](/internal/scripting/item_func.go)
96100
Change the description for an item
97101

_datafiles/guides/building/scripting/FUNCTIONS_ROOMS.md

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
# Room Specific Functions
22

33
- [Room Specific Functions](#room-specific-functions)
4+
- [CreateEmptyRoomInstances(quantity int) \[\]int](#createemptyroominstancesquantity-int-int)
45
- [CreateInstancesFromRoomIds(RoomIds \[int, int...\]) Object ](#createinstancesfromroomidsroomids-int-int-object-)
56
- [CreateInstancesFromZone(zoneName string) Object ](#createinstancesfromzonezonename-string-object-)
67
- [GetRoom(roomId int) RoomObject ](#getroomroomid-int-roomobject-)
78
- [RoomObject.RoomId() int](#roomobjectroomid-int)
89
- [RoomObject.SendText(msg string\[, excludeUserIds int\])](#roomobjectsendtextmsg-string-excludeuserids-int)
10+
- [RoomObject.SendTextToExits(msg string, isQuiet bool\[, excludeUserIds int\])](#roomobjectsendtexttoexitsmsg-string-isquiet-bool-excludeuserids-int)
911
- [RoomObject.SetTempData(key string, value any)](#roomobjectsettempdatakey-string-value-any)
1012
- [RoomObject.GetTempData(key string) any](#roomobjectgettempdatakey-string-any)
1113
- [RoomObject.SetPermData(key string, value any)](#roomobjectsetpermdatakey-string-value-any)
1214
- [RoomObject.GetPermData(key string) any](#roomobjectgetpermdatakey-string-any)
1315
- [RoomObject.GetItems() \[\]ItemObject](#roomobjectgetitems-itemobject)
1416
- [RoomObject.DestroyItem(itm ScriptItem) ](#roomobjectdestroyitemitm-scriptitem-)
1517
- [RoomObject.SpawnItem(itemId int, inStash bool) \[\]ItemObject](#roomobjectspawnitemitemid-int-instash-bool-itemobject)
16-
- [RoomObject.GetMob(mobId int) Actor](#roomobjectgetmobmobid-int-actor)
18+
- [RoomObject.GetMob(mobId int \[, createIfMissing bool\]) Actor](#roomobjectgetmobmobid-int--createifmissing-bool-actor)
1719
- [RoomObject.GetMobs(\[mobId int\]) \[\]Actor](#roomobjectgetmobsmobid-int-actor)
1820
- [RoomObject.GetPlayers() \[\]Actor](#roomobjectgetplayers-actor)
1921
- [RoomObject.GetAllActors() \[\]Actor](#roomobjectgetallactors-actor)
@@ -23,17 +25,24 @@
2325
- [RoomObject.HasQuest(questId string \[,partyUserId int\]) \[\]int](#roomobjecthasquestquestid-string-partyuserid-int-int)
2426
- [RoomObject.MissingQuest(questId string \[,partyUserId int\]) \[\]int](#roomobjectmissingquestquestid-string-partyuserid-int-int)
2527
- [RoomObject.SpawnMob(mobId int) Actor](#roomobjectspawnmobmobid-int-actor)
26-
- [RoomObject.AddTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int, expiresTimeString string](#roomobjectaddtemporaryexitexitnamesimple-string-exitnamefancy-string-exitroomid-int-expirestimestring-string)
27-
- [RoomObject.RemoveTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int](#roomobjectremovetemporaryexitexitnamesimple-string-exitnamefancy-string-exitroomid-int)
28+
- [RoomObject.AddTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int, expiresTimeString string) bool](#roomobjectaddtemporaryexitexitnamesimple-string-exitnamefancy-string-exitroomid-int-expirestimestring-string-bool)
29+
- [RoomObject.RemoveTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int) bool](#roomobjectremovetemporaryexitexitnamesimple-string-exitnamefancy-string-exitroomid-int-bool)
2830
- [RoomObject.HasMutator(mutName string) bool](#roomobjecthasmutatormutname-string-bool)
2931
- [RoomObject.AddMutator(mutName string)](#roomobjectaddmutatormutname-string)
3032
- [RoomObject.RemoveMutator(mutName string)](#roomobjectremovemutatormutname-string)
3133
- [RoomObject.IsEphemeral() bool](#roomobjectisephemeral-bool)
3234
- [RoomObject.RoomIdSource() int](#roomobjectroomidsource-int)
33-
- [RoomObject.RepeatSpawnItem(itemId int, roundInterval int \[, containerName\]](#roomobjectrepeatspawnitemitemid-int-roundinterval-int--containername)
35+
- [RoomObject.RepeatSpawnItem(itemId int, roundInterval int \[, containerName\]) bool](#roomobjectrepeatspawnitemitemid-int-roundinterval-int--containername-bool)
3436
- [RoomObject.SetLocked(exitName string, lockIt bool)](#roomobjectsetlockedexitname-string-lockit-bool)
3537
- [RoomObject.IsLocked(exitName string) bool](#roomobjectislockedexitname-string-bool)
3638

39+
## [CreateEmptyRoomInstances(quantity int) []int](/internal/scripting/room_func.go)
40+
Creates a specified number of empty ephemeral room instances.
41+
42+
| Argument | Explanation |
43+
| --- | --- |
44+
| quantity | Number of empty rooms to create |
45+
3746
## [CreateInstancesFromRoomIds(RoomIds [int, int...]) Object ](/internal/scripting/room_func.go)
3847
Returns an Object with key/value pairs of `ProvidedRoomId`=>`NewRoomId`
3948
Creates ephemeral instances of the RoomId's provided.
@@ -66,6 +75,15 @@ Sends a message to everyone in the room.
6675
| msg | the message to send |
6776
| excludeUserIds | One or more comma separated userIds to exclude from receiving the message. |
6877

78+
## [RoomObject.SendTextToExits(msg string, isQuiet bool[, excludeUserIds int])](/internal/scripting/room_func.go)
79+
Sends a message to all rooms with an exit leading to this room.
80+
81+
| Argument | Explanation |
82+
| --- | --- |
83+
| msg | the message to send |
84+
| isQuiet | If true, only those with superior "hearing" will see it. |
85+
| excludeUserIds | One or more comma separated userIds to exclude from receiving the message. |
86+
6987
## [RoomObject.SetTempData(key string, value any)](/internal/scripting/room_func.go)
7088
Sets temporary data for the room (Lasts until the room is unloaded from memory).
7189

@@ -112,7 +130,7 @@ _Note: See [/scripting/docs/FUNCTIONS_ITEMS.md](FUNCTIONS_ITEMS.md) for details
112130
## [RoomObject.DestroyItem(itm ScriptItem) ](/internal/scripting/room_func.go)
113131
Destroy an item from the ground.
114132

115-
## [RoomObject.SpawnItem(itemId int, inStash bool) []ItemObject](/internal/scripting/room_func.go)
133+
## [RoomObject.SpawnItem(itemId int, inStash bool)](/internal/scripting/room_func.go)
116134
Spawns an item in the room.
117135

118136
| Argument | Explanation |
@@ -121,12 +139,13 @@ Spawns an item in the room.
121139
| inStash | If true, spawns stashed instead of visible. |
122140

123141

124-
## [RoomObject.GetMob(mobId int) Actor](/internal/scripting/room_func.go)
142+
## [RoomObject.GetMob(mobId int [, createIfMissing bool]) Actor](/internal/scripting/room_func.go)
125143
Returns the first mob that matches the provided MobId type (Note: NOT MOB INSTANCE ID!)
126144

127145
| Argument | Explanation |
128146
| --- | --- |
129147
| mobId | MobId to match. |
148+
| createIfMissing (optional) | If true, will spawn the mob if not found. |
130149

131150
## [RoomObject.GetMobs([mobId int]) []Actor](/internal/scripting/room_func.go)
132151
Returns an array of mob `Actor`s in the room.
@@ -186,7 +205,7 @@ _Note: This could be useful for situations where you want to allow a whole party
186205
| partyUserId (optional) | Only check the specified user and their party |
187206

188207
## [RoomObject.MissingQuest(questId string [,partyUserId int]) []int](/internal/scripting/room_func.go)
189-
Returns an array of userId's in the romo who DON'T have the questId. If partyyUserId is supplied, only checks the user and their party specified.
208+
Returns an array of userId's in the room who DON'T have the questId. If partyUserId is supplied, only checks the user and their party specified.
190209

191210
_Note: This could be useful for situations where you want to disallow a whole party access to an area even if only one of them is missing the quest._
192211

@@ -202,7 +221,7 @@ Creates a new instance of MobId,and returns the `Actor` of the mob.
202221
| --- | --- |
203222
| mobId | The ID if the mob type to spawn. NOT THE INSTANCE ID. |
204223

205-
## [RoomObject.AddTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int, expiresTimeString string](/internal/scripting/room_func.go)
224+
## [RoomObject.AddTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int, expiresTimeString string) bool](/internal/scripting/room_func.go)
206225
Adds a temporary exit to the room for the specified amount of time.
207226

208227
| Argument | Explanation |
@@ -212,7 +231,7 @@ Adds a temporary exit to the room for the specified amount of time.
212231
| exitRoomId | The roomId the exit should lead to. |
213232
| expiresTimeString | Time string (1 day, 1 real day, 4 hours, etc) before it vanishes. |
214233

215-
## [RoomObject.RemoveTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int](/internal/scripting/room_func.go)
234+
## [RoomObject.RemoveTemporaryExit(exitNameSimple string, exitNameFancy string, exitRoomId int) bool](/internal/scripting/room_func.go)
216235
Removes a temporary exit
217236

218237
_Note: all 3 parameters much match an existing temporary exit for it to be removed._
@@ -243,7 +262,7 @@ _Note: If the mutator already exists this is ignored._
243262
## [RoomObject.RemoveMutator(mutName string)](/internal/scripting/room_func.go)
244263
Removes a mutator from a room.
245264

246-
_Note: This only expires it. It may be a mutator that respawns, in which case this doens't really completely remove it._
265+
_Note: This only expires it. It may be a mutator that respawns, in which case this doesn't really completely remove it._
247266

248267
| Argument | Explanation |
249268
| --- | --- |
@@ -252,20 +271,14 @@ _Note: This only expires it. It may be a mutator that respawns, in which case th
252271
## [RoomObject.IsEphemeral() bool](/internal/scripting/room_func.go)
253272
Returns true if the room is an Ephemeral Copy of a room.
254273

255-
_Note: This only expires it. It may be a mutator that respawns, in which case this doens't really completely remove it._
256-
257-
| Argument | Explanation |
258-
| --- | --- |
259-
| mutName | the MutatorId of the mutator. |
260-
261274
## [RoomObject.RoomIdSource() int](/internal/scripting/room_func.go)
262275
Returns the source RoomId if this room is an ephemeral copy, otherwise just the normal RoomId
263276

264277

265-
## [RoomObject.RepeatSpawnItem(itemId int, roundInterval int [, containerName]](/internal/scripting/room_func.go)
266-
Removes a temporary exit
278+
## [RoomObject.RepeatSpawnItem(itemId int, roundInterval int [, containerName]) bool](/internal/scripting/room_func.go)
279+
Sets up automatic item respawning in the room.
267280

268-
_Note: all 3 parameters much match an existing temporary exit for it to be removed._
281+
_Note: The item will respawn after the specified interval when removed from the room._
269282

270283
| Argument | Explanation |
271284
| --- | --- |

0 commit comments

Comments
 (0)