Quick Modding/Hacking Answers Thread

Nov 2, 2019 at 12:39 PM
Senior Member
"Master using it, and you can have this!"
Join Date: Sep 23, 2019
Location: Vresun Ciraian Ruins
Posts: 88
In BL, the options to change tileset, npc and background prefixes don't work, it is just a placeholder?
It works fine on mine, maybe yours is broken?
I should probably clear that up, no code is required to work on the scripts for Cave Story (this isn't Game Maker, lol). Instead, you just have to use text script commands (or TSC), in order to set up event flags and actions.

However, if you want custom TSC, custom entities, HUD changes, or anything over the top, you can open up the executable through OllyDbg and apply assembly hacks in x86 (or if you're using CSE2 and you have knowledge in the C language, then you actually do have to code new files through MinGW).
Problem is putting these commands in the right order, and figuring out what they actually do. I won't be using assembly hacks because I'm starting out and I don't have the skill for it yet.

To put it simply, vanilla modding is a lot of working with a bunch of pre-programmed entities and commands, entities will (often) behave the way they should when put in the map and tsc commands run whatever they are made to do when their events are called (which is usually done through setting event ids and other flags such as interactible on entities).
If you need a more detailed explanation and help getting into it feel free to ask me i guess, i like explaining this kinda stuff.
Okay, so it's not as difficult as first thought. It's just a matter of understanding what these commands/entities actually do and them implementing them. Then I also have to learn how flags work. I'd be sure to ask you Mint (and you'll even be credited in the mod's ReadMe file).
 
Nov 2, 2019 at 2:41 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Apr 9, 2019
Location: Between Time and Space
Posts: 28
Nov 2, 2019 at 2:52 PM
Part-Time Perfectionist
CS Beta Content Discord Admin
"Bleep, Bloop, Bleep, Bloop"
Join Date: Dec 26, 2014
Location: the back of their own hand.
Posts: 1599
Age: 120
I'm using the version 0.5.1.1 No JRE, which one do you use?
Those options have had dubious functionality since post-0.5.0.0. (i.e. have been broken for fucking ages) I'd suggest trying to edit them in 0.5.0.0 and seeing if they function correctly there. Also, do you really need to modify them? It might be a pain in the arse.
That said, I've never used the option myself, so it may be that you have to change the values in the exe manually ...
Essentially: Experiment to see what versions work and how they work.
 
Nov 2, 2019 at 2:56 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Apr 9, 2019
Location: Between Time and Space
Posts: 28
Those options have had dubious functionality since post-0.5.0.0. (i.e. have been broken for fucking ages) I'd suggest trying to edit them in 0.5.0.0 and seeing if they function correctly there. Also, do you really need to modify them? It might be a pain in the arse.
That said, I've never used the option myself, so it may be that you have to change the values in the exe manually ...
Essentially: Experiment to see what versions work and how they work.
Ok, I'll try not to mess with this stuff anymore, I don't need it that much.
Another thing, where the orange smoke in NpcSym is loaded? Super missiles launcher I guess?
 
Nov 2, 2019 at 2:59 PM
Best cow
"Life begins and ends with Nu."
Join Date: Jun 27, 2013
Location:
Posts: 2447
Age: 25
Those options have had dubious functionality since post-0.5.0.0. (i.e. have been broken for fucking ages)
Aka when will Noxid or Leo ever fix their shit? Broken tutorial guides if you're on w7, executable corruption if you delete all rooms, etc.
Another thing, where the orange smoke in NpcSym is loaded? Super missiles launcher I guess?
They're for those meteors the Undead Core spits out
 
Nov 2, 2019 at 3:01 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Apr 9, 2019
Location: Between Time and Space
Posts: 28
Nov 2, 2019 at 3:06 PM
Part-Time Perfectionist
CS Beta Content Discord Admin
"Bleep, Bloop, Bleep, Bloop"
Join Date: Dec 26, 2014
Location: the back of their own hand.
Posts: 1599
Age: 120
Are they? What bitmap does npc.tbl say the entity reads the sprites from?
NPC spritesheet 2, which is NpcAlmo2.
 
Nov 2, 2019 at 3:08 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Apr 9, 2019
Location: Between Time and Space
Posts: 28
Nov 2, 2019 at 3:15 PM
Part-Time Perfectionist
CS Beta Content Discord Admin
"Bleep, Bloop, Bleep, Bloop"
Join Date: Dec 26, 2014
Location: the back of their own hand.
Posts: 1599
Age: 120
Nov 2, 2019 at 3:16 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Apr 9, 2019
Location: Between Time and Space
Posts: 28
Super Missile explosions.
Thank You.

The missiles that enemies drop can replenish any gun ammunition or just the missile launcher?
 
Nov 2, 2019 at 6:12 PM
Part-Time Perfectionist
CS Beta Content Discord Admin
"Bleep, Bloop, Bleep, Bloop"
Join Date: Dec 26, 2014
Location: the back of their own hand.
Posts: 1599
Age: 120
The missiles that enemies drop can replenish any gun ammunition or just the missile launcher?
Only the missile launchers.
 
Nov 2, 2019 at 6:19 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Apr 9, 2019
Location: Between Time and Space
Posts: 28
Only the missile launchers.
Well, auto-charge is the solution then. Thanks

The dropped missiles only appear when you get the missile launcher specifically, there's a flag that makes them appear, or am I missing something?
 
Nov 3, 2019 at 3:14 AM
Part-Time Perfectionist
CS Beta Content Discord Admin
"Bleep, Bloop, Bleep, Bloop"
Join Date: Dec 26, 2014
Location: the back of their own hand.
Posts: 1599
Age: 120
Well, auto-charge is the solution then. Thanks

The dropped missiles only appear when you get the missile launcher specifically, there's a flag that makes them appear, or am I missing something?
Uhh let's see...

Okay, I think I FINALLY have it. I'd been trying to work this code out for ages.
00471B80 - LoseNpChar(u32int NpCharObjectAddress, bool createDeathEffect) calls 0046F430 - SetBulletObject(32int x, 32int y, 32int missileAmount), which in turn runs this code:
Code:
CPU Disasm
Address   Hex dump               Command                                                                         Comments
0046F44D      C745 FC 00000000   MOV DWORD PTR SS:[EBP-4],0
0046F454      EB 09              JMP SHORT 0046F45F
0046F456      8B4D FC             MOV ECX,DWORD PTR SS:[EBP-4]
0046F459      83C1 01             ADD ECX,1
0046F45C      894D FC             MOV DWORD PTR SS:[EBP-4],ECX
0046F45F      837D FC 08          CMP DWORD PTR SS:[EBP-4],8
0046F463      7D 56               JGE SHORT 0046F4BB
0046F465      8B55 FC             MOV EDX,DWORD PTR SS:[EBP-4]
0046F468      6BD2 14             IMUL EDX,EDX,14
0046F46B      8B82 C89B4900       MOV EAX,DWORD PTR DS:[EDX+499BC8]
0046F471      8945 C8             MOV DWORD PTR SS:[EBP-38],EAX
0046F474      837D C8 05          CMP DWORD PTR SS:[EBP-38],5
0046F478      74 08               JE SHORT 0046F482
0046F47A      837D C8 0A          CMP DWORD PTR SS:[EBP-38],0A
0046F47E      74 18               JE SHORT 0046F498
0046F480      EB 2C               JMP SHORT 0046F4AE
0046F482      8B4D CC             MOV ECX,DWORD PTR SS:[EBP-34]
0046F485      C7448D D0 00000000  MOV DWORD PTR SS:[ECX*4+EBP-30],0
0046F48D      8B55 CC             MOV EDX,DWORD PTR SS:[EBP-34]
0046F490      83C2 01             ADD EDX,1
0046F493      8955 CC             MOV DWORD PTR SS:[EBP-34],EDX
0046F496      EB 21               JMP SHORT 0046F4B9
0046F498      8B45 CC             MOV EAX,DWORD PTR SS:[EBP-34]
0046F49B      C74485 D0 01000000  MOV DWORD PTR SS:[EAX*4+EBP-30],1
0046F4A3      8B4D CC             MOV ECX,DWORD PTR SS:[EBP-34]
0046F4A6      83C1 01             ADD ECX,1
0046F4A9      894D CC             MOV DWORD PTR SS:[EBP-34],ECX
0046F4AC      EB 0B               JMP SHORT 0046F4B9
0046F4AE      8B55 CC             MOV EDX,DWORD PTR SS:[EBP-34]
0046F4B1      C74495 D0 00000000  MOV DWORD PTR SS:[EDX*4+EBP-30],0
0046F4B9      EB 9B               JMP SHORT 0046F456
0046F4BB      837D CC 00         CMP DWORD PTR SS:[EBP-34],0
0046F4BF      75 07              JNE SHORT 0046F4C8
0046F4C1      33C0               XOR EAX,EAX
0046F4C3      E9 5B010000        JMP 0046F623
This checks every weapon slot for weapons ID 5 and 10 (the Missile Launcher and the Super Missile Launcher). If it cannot find any, it immediately ends the function and returns false (which is used to tell the game to spawn XP instead, kinda debunking the myth that missile pickups replace health pickup spawns), otherwise it spawns the missiles and returns true.
 
Nov 3, 2019 at 10:11 AM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Apr 9, 2019
Location: Between Time and Space
Posts: 28
This checks every weapon slot for weapons ID 5 and 10 (the Missile Launcher and the Super Missile Launcher). If it cannot find any, it immediately ends the function and returns false (which is used to tell the game to spawn XP instead, kinda debunking the myth that missile pickups replace health pickup spawns), otherwise it spawns the missiles and returns true.
Interesting, thanks for the answer, and the code.
Now, when you have the turbocharge equipped it will work for any gun or just the machine gun?
(Or any gun with auto charging?)
 
Last edited:
Nov 3, 2019 at 2:32 PM
Best cow
"Life begins and ends with Nu."
Join Date: Jun 27, 2013
Location:
Posts: 2447
Age: 25
Interesting, thanks for the answer, and the code.
Now, when you have the turbocharge equipped it will work for any gun or just the machine gun?
(Or any gun with auto charging?)
It works on Machine Gun, and surprisingly the Spur. Equipping the Turbocharge with the Spur makes it charge up just a little bit faster.
 
Nov 3, 2019 at 2:37 PM
Junior Member
"Wow! The more I drink of this magical beverage, the more games I can play! Wheee!"
Join Date: Apr 9, 2019
Location: Between Time and Space
Posts: 28
It works on Machine Gun, and surprisingly the Spur. Equipping the Turbocharge with the Spur makes it charge up just a little bit faster.
Nice! Too bad we can't see that in the original game.
How does the game determine how many exp you lose by damage?
And how do I remove the machine gun recoil?
 
Last edited:
Nov 4, 2019 at 6:18 PM
Senior Member
"Huzzah!"
Join Date: Mar 25, 2019
Location:
Posts: 201
I have issues yet again but this time it's more annoying than usual.
What I did is I expanded the tileset so I could fit more tiles in it and created new tiles.
So far nothing strange, right?
Well, I tried to use those new tiles in a map and I spent some time doing so but when I loaded the mod again all the new tiles were turned into the corresponding tiles from the original tileset(which I had not deleted by the way, it was just above the new one).
Now I have to do this crap all over again but first I would need to know how to fix it.
Any ideas?
Oh, and if you have an answer please tell me what causes it as well, thank you.
 
Nov 4, 2019 at 8:43 PM
Best cow
"Life begins and ends with Nu."
Join Date: Jun 27, 2013
Location:
Posts: 2447
Age: 25
The maximum size for each tileset is 256x256 pixels. Anything taller will just make it loop back. So if you're just using similar tilesets between separate rooms, it's recommended to make a copy of the original tileset and replace any tile that won't be used with the new ones.
 
Top