You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -67,6 +67,44 @@ Called when a console command is being executed by the player. Used to implement
67
67
68
68
Called when the game transitions from the main menu to loading a save. Can be both an existing or new save. Can be used to load static resources like textures, entities and brushes that are needed in-game.
69
69
70
+
## bool Hook_MapInitializeDimensions()
71
+
72
+
Called after @ref Map::Width and @ref Map::Height have been initialized from `Data/map.ini`.
73
+
Should only be overridden when the map dimensions are configured dynamically in-game.
74
+
75
+
## bool Hook_MapCreateLayout()
76
+
77
+
Called before the map's layout is initialized in @ref Map::Temporary.
78
+
Can be overridden to replace the vanilla generation.
79
+
Regular rooms are initialized to 1, while checkpoints are initialized to 255.
80
+
81
+
## bool Hook_MapForceRooms()
82
+
83
+
Called before the minimum number of rooms per type as specified in `Data/map.ini` is attempted to be forced onto the map grid.
84
+
When hooking into this, care must be taken to maintain the correct values within @ref Map::Temporary and @ref Map::RoomAmounts.
85
+
86
+
## bool Hook_MapSetRooms()
87
+
88
+
Called before the hardcoded rooms, as well as the rooms with a `set room` property from `Data/rooms.ini` are being added to @ref Map::Room.
89
+
@ref Map::MinPositions and @ref Map::MaxPositions delimit the array by room type and zone (in that order).
Called before rooms are instantiated from @ref Map::Temporary, @ref Map::Room and `Data/rooms.ini`.
94
+
The arguments are intended to be used to convey the method progress via @ref DrawLoading.
95
+
96
+
## bool Hook_MapPreventRoomOverlaps()
97
+
98
+
Called before room overlaps are detected amd attempted to be resolved.
99
+
100
+
## bool Hook_MapCreateDoors()
101
+
102
+
Called before doors between rooms are instantiated.
103
+
104
+
## bool Hook_MapConnectAdjacentRooms()
105
+
106
+
Called before adjacent rooms are connected to each other and the doors that connect them via @ref Room::Adjacent and @ref Room::AdjacentDoor.
107
+
70
108
## bool Hook_InitializeEvents()
71
109
72
110
Called before the events for a newly created save are initialized. Allows initializing custom events via @ref CB::Event::Create.
@@ -120,19 +158,19 @@ Called when loading is finished and control is about to be handed to the player.
120
158
121
159
## bool Hook_CreateItem(@ref CB::Item)
122
160
123
-
Called when an item is created. Handles initialization of inventories for inventory items like wallet and clipboard unless overriden.
161
+
Called when an item is created. Handles initialization of inventories for inventory items like wallet and clipboard unless overridden.
124
162
125
163
## bool Hook_UpdateItem(@ref CB::Item)
126
164
127
-
Called for every item every frame. Can be used for custom item logic. Handles gravity, reachability calculations for being picked up by the player and item-push behavior unless overriden.
165
+
Called for every item every frame. Can be used for custom item logic. Handles gravity, reachability calculations for being picked up by the player and item-push behavior unless overridden.
128
166
129
167
## void Hook_RemoveItem(@ref CB::Item)
130
168
131
169
Called when an item is removed from the world and freed.
132
170
133
171
## bool Hook_PickItem(@ref CB::Item)
134
172
135
-
Called when the player tries to pick up an item with sufficient inventory space remaining. The item is not added to the player's inventory when this function is overriden.
173
+
Called when the player tries to pick up an item with sufficient inventory space remaining. The item is not added to the player's inventory when this function is overridden.
136
174
137
175
## bool Hook_DropItem(@ref CB::Item)
138
176
@@ -177,22 +215,22 @@ Returning `""` will delegate responsibility to lower-priority mods and the base
177
215
Called when an NPC is to be spawned from the console.
178
216
Returning `-1` will delegate responsibility to lower-priority mods and the base game.
179
217
Returning `0` will disallow the NPC from being spawned via the console.
180
-
Should only be overriden for custom NPCs when specific changes are necessary to make the NPC function correctly upon creation, in which case `1` must be returned.
218
+
Should only be overridden for custom NPCs when specific changes are necessary to make the NPC function correctly upon creation, in which case `1` must be returned.
181
219
By default, NPCs are created 0.2 units above the player collider's position.
182
220
183
221
## int Hook_ConsoleCheckCanChangeNPCSpeed(CB::NPC::Type type)
184
222
185
223
Called when an NPC's speed is about to be changed via the console.
186
224
Returning `-1` will delegate responsibility to lower-priority mods and the base game.
187
-
Should only be overriden for custom NPCs to indicate that it is unaffected by the @ref NPC::Speed value by returning `0`.
225
+
Should only be overridden for custom NPCs to indicate that it is unaffected by the @ref NPC::Speed value by returning `0`.
188
226
Returning `1` will indicate that the NPCs speed can be changed (the default for custom NPCs).
189
-
Can also be overriden to indicate that a script modification to a base game NPC will allow it to be affected by the @ref NPC::Speed value.
227
+
Can also be overridden to indicate that a script modification to a base game NPC will allow it to be affected by the @ref NPC::Speed value.
190
228
191
229
## int Hook_ConsoleCheckCanToggleNPC(CB::NPC::Type type)
192
230
193
231
Called when an NPC is about to be enabled/disabled.
194
232
Returning `-1` will delegate responsibility to lower-priority mods and the base game.
195
-
Must only be overriden when implementations for `Hook_EnableNPC` and `Hook_DisableNPC` are provided for an NPC type, which is supported in the base game, in which case `1` must be returned.
233
+
Must only be overridden when implementations for `Hook_EnableNPC` and `Hook_DisableNPC` are provided for an NPC type, which is supported in the base game, in which case `1` must be returned.
196
234
Returning `0` will indicate that the NPC cannot be enabled/disabled (the default for custom NPCs).
197
235
198
236
## bool Hook_EnableNPC(@ref CB::NPC)
@@ -204,8 +242,8 @@ Called when an NPC is to be enabled.
204
242
> This hook may be called on already enabled NPCs.
205
243
206
244
> [!IMPORTANT]
207
-
> `Hook_ConsoleCheckCanToggleNPC` must be overriden to allow for this hook to be called.
208
-
> `Hook_DisableNPC` must also be overriden to actually do the disabling, which this hook undoes.
245
+
> `Hook_ConsoleCheckCanToggleNPC` must be overridden to allow for this hook to be called.
246
+
> `Hook_DisableNPC` must also be overridden to actually do the disabling, which this hook undoes.
209
247
210
248
## bool Hook_DisableNPC(@ref CB::NPC)
211
249
@@ -216,5 +254,5 @@ Called when an NPC is to be disabled.
216
254
> This hook may be called on already disabled NPCs.
217
255
218
256
> [!IMPORTANT]
219
-
> `Hook_ConsoleCheckCanToggleNPC` must be overriden to allow for this hook to be called.
220
-
> `Hook_EnableNPC` must also be overriden to undo the disabling.
257
+
> `Hook_ConsoleCheckCanToggleNPC` must be overridden to allow for this hook to be called.
258
+
> `Hook_EnableNPC` must also be overridden to undo the disabling.
0 commit comments