Thorne, Azrael, Smokin Joe, Soulscreech Powers Feb 27, 2017 18:08:21 GMT
Post by Woitek on Feb 27, 2017 18:08:21 GMT
in hexdeximals it looks like this:
Well, it's working like that:
Game have specified memory where are all ghosts in the game.
Every ghost have 528 bytes array, and game load them until in name not find symbol "!" in hex 0x21.
After that, every ghost name from this array is compared with name existing in exe. Game does it by making from them hashsums. So first, they add all existing ghosts names to hash table, and then when ghost load, game compare new hash with existing table, if new hash match with any existing hash, then game link it with specific ghost.
Ghost are link with TEXT name. So if you want to add ghost to menu, you have to apply for specific ghost class his text ID. In this article I wrote how look like this specific array: bspviewer.wiki-site.com/index.php/Haunter_data.
Generally, all you have to do for make rejected ghost work is change isAtStart to 1, and add ghost to menu.
Life starts to be more complicated when you want add ghost to ghoulroom. This game is very static, and all scripts are builded in exe. I've done it by replacing some useless structures in script, with ghost one.
In exe it use structure like this:
D8 55 8C 00 A4 15 8E 00 88 2B 8E 00 B0 15 8E 00
GhostName we already know from exe, but for add new spawns we need text what was never used by game, because we need hook it to specific ghost in hash table. Thats why I use for spawns and camera texts for unused objects from Trainspook level.
And that's it. Last thing you have to do is open scenario file(gamedata.bsp), open chunk with type 1020, add spawn point with camera, and in place where is hash, replace it with new one based on text what you use in exe.