NotifyCallback¶
NotifyCallback is a function in Sonic Origins that handles communicating between RSDKv5U and Hedgehog Engine 2.
Usage¶
Set game.callbackParam0
, game.callbackParam1
, and game.callbackParam2
to the needed parameters (unused parameters do not need to be set), then call EngineCallback() with Callback
set to the appropriate callback ID.
Note
The names of each callback are not defined by the engine itself. Instead, Sonic Team elected to define them and their corresponding IDs as global variables in Sonic CD's GameConfig.
Call CallNativeFunction2() or CallNativeFunction4() (depending on the amount of parameters needed) with callback
set to NotifyCallback and param1
set to the appropriate callback ID. Set param2
, param3
, and param4
to the needed parameters. Unused parameters should be set to 0
.
Note
The names of each callback are not defined by the engine itself. Instead, Sonic Team elected to define them and their corresponding IDs as global variables in Sonic 1 and 2's GameConfigs.
Call NotifyCallback() with callback
set to the appropriate callback ID and param1
, param2
, and param3
set to the needed parameters. Unused parameters should be set to NULL
.
Callbacks¶
ID | Callback | Description |
---|---|---|
128 | NOTIFY_DEATH_EVENT | Notifies Hedgehog Engine 2 of a Player death. |
129 | NOTIFY_TOUCH_SIGNPOST | Notifies Hedgehog Engine 2 when a sign post has been touched. |
130 | NOTIFY_HUD_ENABLE | |
131 | NOTIFY_ADD_COIN | Awards the player the given amount of coins. |
132 | NOTIFY_KILL_ENEMY | Notifies Hedgehog Engine 2 to update the mission objective. |
133 | NOTIFY_SAVESLOT_SELECT | |
134 | NOTIFY_FUTURE_PAST | |
135 | NOTIFY_GOTO_FUTURE_PAST | |
136 | NOTIFY_BOSS_END | |
137 | NOTIFY_SPECIAL_END | |
138 | NOTIFY_DEBUGPRINT | Has no effect in-game, but would have likely printed the given values to the console in debug builds of Sonic Origins. |
139 | NOTIFY_KILL_BOSS | |
140 | NOTIFY_TOUCH_EMERALD | |
141 | NOTIFY_STATS_ENEMY | |
142 | NOTIFY_STATS_CHARA_ACTION | |
143 | NOTIFY_STATS_RING | |
144 | NOTIFY_STATS_MOVIE | |
145 | NOTIFY_STATS_PARAM_1 | |
146 | NOTIFY_STATS_PARAM_2 | |
147 | NOTIFY_CHARACTER_SELECT | Opens Sonic Origins's character select menu, then sets callbackResult and continueFlag when the menu is closed. |
148 | NOTIFY_SPECIAL_RETRY | |
149 | NOTIFY_TOUCH_CHECKPOINT | Notifies Hedgehog Engine 2 that a Lamp Post/Star Post has been touched. |
150 | NOTIFY_ACT_FINISH | |
151 | NOTIFY_1P_VS_SELECT | |
152 | NOTIFY_CONTROLLER_SUPPORT | Opens the controller setup screen in the Nintendo Switch version of the game, then sets callbackResult based on the platform and controller count. |
153 | NOTIFY_STAGE_RETRY | |
154 | NOTIFY_SOUND_TRACK | |
155 | NOTIFY_GOOD_ENDING | |
156 | NOTIFY_BACK_TO_MAINMENU | |
157 | NOTIFY_LEVEL_SELECT_MENU | |
158 | NOTIFY_PLAYER_SET | |
159 | NOTIFY_EXTRAS_MODE | |
160 | NOTIFY_SPIN_DASH_TYPE | |
161 | NOTIFY_TIME_OVER | |
162 | NOTIFY_TIMEATTACK_MODE | |
163 | NOTIFY_STATS_BREAK_OBJECT | |
164 | NOTIFY_STATS_SAVE_FUTURE | |
165 | NOTIFY_STATS_CHARA_ACTION2 | |
1000 | NOTIFY_1000 | Unknown callback. |
1001 | NOTIFY_1001 | Unknown callback. |
1002 | NOTIFY_1002 | Unknown callback. |
1003 | NOTIFY_PLAYER_SAVED_VALUES | |
1004 | NOTIFY_1004 | Unknown callback. |
1005 | NOTIFY_1005 | Unknown callback. |
1006 | NOTIFY_TITLECARD_INIT |