Feb 20, 2015 at 11:17 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: Aug 2, 2014
Location: inactivity.
Posts: 115
I gave this(EDIT: To be specific, a early version which only supported 1 NPC. That changed quickly.) to QuoteHax and Noxid, and Noxid decided it might be useful and that I should make a forum post for it.
The name was basically made up on the spot.
This is a project to allow making Cave Story NPC replacements in C.
It's pretty incomplete, but there's enough templates that anyone good with ASM should be able to add the rest for you. (same way as Noxid's defines.txt became standard)
I've added a modified Debug Cat to use as a test, but the code for a normal Debug Cat is in the comment above the code for the modified one.
It works by replacing the "goto NPC pointer" code with "goto NPC216".
Then, NPC216 calls upon game.dll, which contains your code. If a NPC isn't handled by game.dll, the included code will fall back on the NPC pointer table(although this can be disabled)
Because of that, this should be compatible with all of your Doukutsu Assembler NPCs, as long as they don't use NPC216. If they do, just rewrite them in C.
Also, this only messes with NPC216 and the "jump to npc" code, so you can just apply it along with all your other various Doukutsu Assembler.
The included NPC is mostly a test/joke. Only 2 Cave Story functions work for now(CreateNPC and CreateBullet) and CreateBullet hasn't been tested.
Talking of which, this won't help you modify bullets-just NPCs for now.
Maybe Noxid can add it in-he knows Cave Story better.
Have fun with it.(I've licensed all the files I can-meaning the Doukutsu Assembler files and my C header and file-under Public Domain.)
EDIT2: Just thought to mention: game_dll is the source to game.dll, that's where you do the NPC modification. The VC++ project is already setup to compile into the Cave Story folder.
Big thanks to Noxid, defines.txt was really helpful, along with another document he gave me(see his profile feed)
http://dl.dropboxusercontent.com/u/21184720/CaveStoryMod-TestCMod.7z
The name was basically made up on the spot.
This is a project to allow making Cave Story NPC replacements in C.
It's pretty incomplete, but there's enough templates that anyone good with ASM should be able to add the rest for you. (same way as Noxid's defines.txt became standard)
I've added a modified Debug Cat to use as a test, but the code for a normal Debug Cat is in the comment above the code for the modified one.
It works by replacing the "goto NPC pointer" code with "goto NPC216".
Then, NPC216 calls upon game.dll, which contains your code. If a NPC isn't handled by game.dll, the included code will fall back on the NPC pointer table(although this can be disabled)
Because of that, this should be compatible with all of your Doukutsu Assembler NPCs, as long as they don't use NPC216. If they do, just rewrite them in C.
Also, this only messes with NPC216 and the "jump to npc" code, so you can just apply it along with all your other various Doukutsu Assembler.
The included NPC is mostly a test/joke. Only 2 Cave Story functions work for now(CreateNPC and CreateBullet) and CreateBullet hasn't been tested.
Talking of which, this won't help you modify bullets-just NPCs for now.
Maybe Noxid can add it in-he knows Cave Story better.
Have fun with it.(I've licensed all the files I can-meaning the Doukutsu Assembler files and my C header and file-under Public Domain.)
EDIT2: Just thought to mention: game_dll is the source to game.dll, that's where you do the NPC modification. The VC++ project is already setup to compile into the Cave Story folder.
Big thanks to Noxid, defines.txt was really helpful, along with another document he gave me(see his profile feed)
http://dl.dropboxusercontent.com/u/21184720/CaveStoryMod-TestCMod.7z