Quick Modding/Hacking Answers Thread

Nov 9, 2012 at 1:02 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
Download Cave Editor (CE)/Sue's Workshop (SW)/Booster's Lab (BL) (I would suggest the first or third) and look for a guide on the program of your choice. I'm not exactly sure how to change it in BL, but you can change the bullet data in CE from the options at the top. If you want to actually change the image for all of the weapons, you'll have to change the file extensions for all the files in the data folder. You can do this in CE through Game Settings - just change the text .pbm to .bmp. Then you can go into the data folder and freely edit any images you want.
One rule, though: do not increase the width of any of the images. Extending the height is fine, though.

To change the character change MyChar.bmp. To change the weapons change Arms.bmp, Bullet.bmp, and ArmsImage.bmp.
 
Nov 9, 2012 at 3:27 AM
Melon Lord
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Sep 20, 2011
Location: Rialto
Posts: 337
Age: 27
Pronouns: he/him
Hey guys, just have a little graphical problem with my sprites.

The problem is my character's mouth takes on the colors of something like that sign. Should I just make her mouthless or is there a way to fix this?
 
Nov 9, 2012 at 3:30 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
Don't use #000000 for your mouth. Don't use it for anything except transparent stuff. Change the colour to R:0 G:0 B:1 or if you can't do that just make it really dark blue.
 
Nov 9, 2012 at 3:35 AM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
Pronouns: he/him
Don't do that. Use Pixel's signature very dark green. Or you can hack the game to use magenta instead of black for transparency, but that's not recommended for beginners.
 
Nov 9, 2012 at 3:36 AM
Melon Lord
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Sep 20, 2011
Location: Rialto
Posts: 337
Age: 27
Pronouns: he/him
Don't use #000000 for your mouth. Don't use it for anything except transparent stuff. Change the colour to R:0 G:0 B:1 or if you can't do that just make it really dark blue.

Thanks very much. It works.
 
Nov 9, 2012 at 3:37 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
No problem, happy to see new people taking an interest in modding.
 
Nov 9, 2012 at 5:53 AM
Been here way too long...
"What're YOU lookin' at?"
Join Date: Oct 17, 2011
Location: probably somewhere else
Posts: 1104
Age: 27
Pronouns: none
Nov 11, 2012 at 3:04 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
Things are being weird again.
Code:
CPU Disasm
Address Hex dump		 Command								 Comments
00423A4E |> \8B0D D85A4A00 MOV ECX,DWORD PTR DS:[4A5AD8]
00423A54 |. 030D E05A4A00 ADD ECX,DWORD PTR DS:[4A5AE0]
00423A5A |. 0FBE51 01	 MOVSX EDX,BYTE PTR DS:[ECX+1]
00423A5E	 83FA 4B	 CMP EDX,4B
00423A61	 0F85 85000000 JNE 00423AEC
00423A67	 A1 D85A4A00 MOV EAX,DWORD PTR DS:[4A5AD8]
00423A6C	 0305 E05A4A00 ADD EAX,DWORD PTR DS:[4A5AE0]
00423A72	 0FBE48 02	 MOVSX ECX,BYTE PTR DS:[EAX+2]
00423A76	 83F9 41	 CMP ECX,41
00423A79	 75 71		 JNE SHORT 00423AEC
00423A7B	 8B15 D85A4A00 MOV EDX,DWORD PTR DS:[4A5AD8]
00423A81	 0315 E05A4A00 ADD EDX,DWORD PTR DS:[4A5AE0]
00423A87	 0FBE42 03	 MOVSX EAX,BYTE PTR DS:[EDX+3]
00423A8B |. 83F8 4A	 CMP EAX,4A
00423A8E |. 75 5C		 JNE SHORT 00423AEC
00423A90 |. 8B0D E05A4A00 MOV ECX,DWORD PTR DS:[4A5AE0]
00423A96 |. 83C1 04	 ADD ECX,4
00423A99 |. 51		 PUSH ECX								 ; /Arg1
00423A9A |. E8 61DEFFFF CALL 00421900						 ; \Amamichi2.00421900
00423A9F |. 83C4 04	 ADD ESP,4
00423AA2	 8B15 84E14900 MOV EDX,DWORD PTR DS:[49E184]
00423AA8	 83F8 00	 CMP EAX,0
00423AAB	 7C 25		 JL SHORT 00423AD2					 ; Jump if arg1 < 0
00423AAD	 39C2		 CMP EDX,EAX
00423AAF	 7C 25		 JL SHORT 00423AD6					 ; Jump if value < arg1
00423AB1	 83C1 08	 ADD ECX,8
00423AB4	 51		 PUSH ECX
00423AB5	 E8 46DEFFFF CALL 00421900
00423ABA	 83C4 04	 ADD ESP,4
00423ABD	 50		 PUSH EAX
00423ABE	 E8 CDDEFFFF CALL 00421990						 ; Run "success" event
00423AC3	 83C4 04	 ADD ESP,4
00423AC6	 8305 E05A4A00 ADD DWORD PTR DS:[4A5AE0],8
00423ACD	 E9 D5170000 JMP 004252A7
00423AD2	 39C2		 CMP EDX,EAX
00423AD4 ^ 7E DB		 JLE SHORT 00423AB1					 ; Jump if value < arg1
00423AD6	 8305 E05A4A00 ADD DWORD PTR DS:[4A5AE0],8
00423ADD	 E9 C5170000 JMP 004252A7
00423AE2	 90		 NOP
00423AE3	 90		 NOP
00423AE4	 90		 NOP
00423AE5	 90		 NOP
00423AE6	 90		 NOP
00423AE7	 90		 NOP
00423AE8	 90		 NOP
00423AE9	 90		 NOP
00423AEA	 90		 NOP
00423AEB	 90		 NOP
So that's the <AMJ command (it is now <KAJ)

Code:
CPU Disasm
Address   Hex dump		  Command								  Comments
00424EAF  |> \A1 D85A4A00   MOV EAX,DWORD PTR DS:[4A5AD8]
00424EB4  |.  0305 E05A4A00 ADD EAX,DWORD PTR DS:[4A5AE0]
00424EBA  |.  0FBE48 01	 MOVSX ECX,BYTE PTR DS:[EAX+1]
00424EBE  |.  83F9 4B	   CMP ECX,4B
00424EC1  |.  75 70		 JNE SHORT 00424F33
00424EC3  |.  8B15 D85A4A00 MOV EDX,DWORD PTR DS:[4A5AD8]
00424EC9  |.  0315 E05A4A00 ADD EDX,DWORD PTR DS:[4A5AE0]
00424ECF  |.  0FBE42 02	 MOVSX EAX,BYTE PTR DS:[EDX+2]
00424ED3  |.  83F8 41	   CMP EAX,41
00424ED6  |.  75 5B		 JNE SHORT 00424F33
00424ED8  |.  8B0D D85A4A00 MOV ECX,DWORD PTR DS:[4A5AD8]
00424EDE  |.  030D E05A4A00 ADD ECX,DWORD PTR DS:[4A5AE0]
00424EE4  |.  0FBE51 03	 MOVSX EDX,BYTE PTR DS:[ECX+3]
00424EE8  |.  83FA 2B	   CMP EDX,2B
00424EEB  |.  75 46		 JNE SHORT 00424F33
00424EED  |.  8B0D E05A4A00 MOV ECX,DWORD PTR DS:[4A5AE0]
00424EF3  |.  83C1 04	   ADD ECX,4
00424EF6  |.  51		    PUSH ECX								 ; /Arg1
00424EF7  |.  E8 04CAFFFF   CALL 00421900						    ; \Amamichi2.00421900
00424EFC  |.  83C4 04	   ADD ESP,4
00424EFF  |.  A3 84E14900   MOV DWORD PTR DS:[49E184],EAX
00424F04  |.  8305 E05A4A00 ADD DWORD PTR DS:[4A5AE0],8
00424F0B  \.^ E9 97030000   JMP 004252A7
And that's the duplicate <FAC command. (It is now <KA+)

What I want to do is <KA+XXXX to add a number to memory from a tsc command, for a "karma system" of sorts. Then I want to <KAJXXXX:YYYY to run an event if your "karma" is less than or equal to X (if X is less than 0) or if it is greater than or equal to X (if X is more than 0). I run <KA+0001<KAJ0010:0400, which is supposed to make a message box appear, but instead it makes text noises and <FAO0004 happens for some reason. I have no idea what's going on.

Also those comments were only there to help me keep track of the <KAJ code so feel free to ignore them.
 
Nov 11, 2012 at 3:32 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
<KAJXXXX:YYYY has 13 characters, so you need to change ADD DWORD PTR DS:[4A5AE0],8 to ADD DWORD PTR DS:[4A5AE0], D . Also I'm pretty sure that you need to reset the value of ECX back to the TSC pointer before you add 8 to it, or else you're trying to read the characters that come after <KAJXXXX:YYYY as the second number/event to jump to. Also, whenever a function is called (like the run event or get number from XXXX), you need to assume that EAX, ECX, and EDX will be cleared/changed. They don't stay the same if you call a function.
 
Nov 11, 2012 at 3:34 AM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3052
Things that immediately pop out to me:
- ecx may not be preserved through the calling of 421900. If this is the case, mov ecx, [4A5AE0], and then add ecx, 9
- if ecx is preserved through the calling, then you need to replace add ecx,8 with add ecx,5. (at 0x423ab1)

ALSO if you want karma to be added to memory, you're gonna want to change 0x424eff
 
Nov 11, 2012 at 3:45 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
- ecx may not be preserved through the calling of 421900. If this is the case, mov ecx, [4A5AE0], and then add ecx, 9

ALSO if you want karma to be added to memory, you're gonna want to change 0x424eff

There is a 99% chance ECX will not be preserved, given the compiler optimizations for doukutsu (the use of pipelining). And yeah he's going to want to change that MOV to an ADD. Right now it is just setting his karma to 1.

Also I don't know how you're expecting to get negative numbers to work, since the TSC interpreter wasn't written to actually handle them. You can force negative numbers using special ASCII characters, given the way the interpreter works, but it won't be pretty.
 
Nov 11, 2012 at 3:47 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
GIRakaCHEEZER said:
And yeah he's going to want to change that MOV to an ADD. Right now it is just setting his karma to 1.
Oh haha rite silly me

Anyway this is my revised code. Now all it does is make billions of text noises forever and ever.
Code:
CPU Disasm
Address Hex dump		 Command								 Comments
00423A4E |> \8B0D D85A4A00 MOV ECX,DWORD PTR DS:[4A5AD8]
00423A54 |. 030D E05A4A00 ADD ECX,DWORD PTR DS:[4A5AE0]
00423A5A |. 0FBE51 01	 MOVSX EDX,BYTE PTR DS:[ECX+1]
00423A5E	 83FA 4B	 CMP EDX,4B
00423A61	 0F85 85000000 JNE 00423AEC
00423A67	 A1 D85A4A00 MOV EAX,DWORD PTR DS:[4A5AD8]
00423A6C	 0305 E05A4A00 ADD EAX,DWORD PTR DS:[4A5AE0]
00423A72	 0FBE48 02	 MOVSX ECX,BYTE PTR DS:[EAX+2]
00423A76	 83F9 41	 CMP ECX,41
00423A79	 75 71		 JNE SHORT 00423AEC
00423A7B	 8B15 D85A4A00 MOV EDX,DWORD PTR DS:[4A5AD8]
00423A81	 0315 E05A4A00 ADD EDX,DWORD PTR DS:[4A5AE0]
00423A87	 0FBE42 03	 MOVSX EAX,BYTE PTR DS:[EDX+3]
00423A8B |. 83F8 4A	 CMP EAX,4A
00423A8E |. 75 5C		 JNE SHORT 00423AEC
00423A90 |. 8B0D E05A4A00 MOV ECX,DWORD PTR DS:[4A5AE0]
00423A96 |. 83C1 04	 ADD ECX,4
00423A99 |. 51		 PUSH ECX								 ; /Arg1
00423A9A |. E8 61DEFFFF CALL 00421900						 ; \Amamichi2.00421900
00423A9F |. 83C4 04	 ADD ESP,4
00423AA2	 8B15 84E14900 MOV EDX,DWORD PTR DS:[49E184]
00423AA8	 83F8 00	 CMP EAX,0
00423AAB	 7C 2B		 JL SHORT 00423AD8					 ; Jump if arg1 < 0
00423AAD	 39C2		 CMP EDX,EAX
00423AAF	 7C 2B		 JL SHORT 00423ADC					 ; Jump if value < arg1
00423AB1	 8B0D E05A4A00 MOV ECX,DWORD PTR DS:[4A5AE0]
00423AB7	 83C1 08	 ADD ECX,8
00423ABA	 51		 PUSH ECX
00423ABB	 E8 40DEFFFF CALL 00421900
00423AC0	 83C4 04	 ADD ESP,4
00423AC3	 50		 PUSH EAX
00423AC4	 E8 C7DEFFFF CALL 00421990
00423AC9	 83C4 04	 ADD ESP,4
00423ACC	 8305 E05A4A00 ADD DWORD PTR DS:[4A5AE0],0D
00423AD3	 E9 CF170000 JMP 004252A7
00423AD8	 39C2		 CMP EDX,EAX
00423ADA ^ 7E DB		 JLE SHORT 00423AB1
00423ADC	 8305 E05A4A00 ADD DWORD PTR DS:[4A5AE0],0D
00423AE3	 E9 BF170000 JMP 004252A7

Well I thought I fixed something but I really didn't
 
Nov 11, 2012 at 3:55 AM
Lvl 1
Forum Moderator
"Life begins and ends with Nu."
Join Date: May 28, 2008
Location: PMMM MMO
Posts: 3713
Age: 32
MagicDoors said:
Oh haha rite silly me

Anyway this is my revised code. Now all it does is make billions of text noises forever and ever.
Code:
CPU Disasm
Address Hex dump		 Command								 Comments
00423A4E |> \8B0D D85A4A00 MOV ECX,DWORD PTR DS:[4A5AD8]
00423A54 |. 030D E05A4A00 ADD ECX,DWORD PTR DS:[4A5AE0]
00423A5A |. 0FBE51 01	 MOVSX EDX,BYTE PTR DS:[ECX+1]
00423A5E	 83FA 4B	 CMP EDX,4B
00423A61	 0F85 85000000 JNE 00423AEC
00423A67	 A1 D85A4A00 MOV EAX,DWORD PTR DS:[4A5AD8]
00423A6C	 0305 E05A4A00 ADD EAX,DWORD PTR DS:[4A5AE0]
00423A72	 0FBE48 02	 MOVSX ECX,BYTE PTR DS:[EAX+2]
00423A76	 83F9 41	 CMP ECX,41
00423A79	 75 71		 JNE SHORT 00423AEC
00423A7B	 8B15 D85A4A00 MOV EDX,DWORD PTR DS:[4A5AD8]
00423A81	 0315 E05A4A00 ADD EDX,DWORD PTR DS:[4A5AE0]
00423A87	 0FBE42 03	 MOVSX EAX,BYTE PTR DS:[EDX+3]
00423A8B |. 83F8 4A	 CMP EAX,4A
00423A8E |. 75 5C		 JNE SHORT 00423AEC
00423A90 |. 8B0D E05A4A00 MOV ECX,DWORD PTR DS:[4A5AE0]
00423A96 |. 83C1 04	 ADD ECX,4
00423A99 |. 51		 PUSH ECX								 ; /Arg1
00423A9A |. E8 61DEFFFF CALL 00421900						 ; \Amamichi2.00421900
00423A9F |. 83C4 04	 ADD ESP,4
00423AA2	 8B15 84E14900 MOV EDX,DWORD PTR DS:[49E184]
00423AA8	 83F8 00	 CMP EAX,0
00423AAB	 7C 2B		 JL SHORT 00423AD8					 ; Jump if arg1 < 0
00423AAD	 39C2		 CMP EDX,EAX
00423AAF	 7C 2B		 JL SHORT 00423ADC					 ; Jump if value < arg1
00423AB1	 8B0D E05A4A00 MOV ECX,DWORD PTR DS:[4A5AE0]
00423AB7	 83C1 08	 ADD ECX,8
00423ABA	 51		 PUSH ECX
00423ABB	 E8 40DEFFFF CALL 00421900
00423AC0	 83C4 04	 ADD ESP,4
00423AC3	 50		 PUSH EAX
00423AC4	 E8 C7DEFFFF CALL 00421990
00423AC9	 83C4 04	 ADD ESP,4
00423ACC	 8305 E05A4A00 ADD DWORD PTR DS:[4A5AE0],0D
00423AD3	 E9 CF170000 JMP 004252A7
00423AD8	 39C2		 CMP EDX,EAX
00423ADA ^ 7E DB		 JLE SHORT 00423AB1
00423ADC	 8305 E05A4A00 ADD DWORD PTR DS:[4A5AE0],0D
00423AE3	 E9 BF170000 JMP 004252A7

Well I thought I fixed something but I really didn't

The problem is at 00423AC3. The value of EAX has changed since you called 421900 two lines before it, so now you're jumping to some unknown event number, so the game is breaking because of it. Also I would recommend NOT adding 0D to the TSC text pointer after calling 421990, since that will just fuck things up. 421990 changes the value of the TSC text pointer, so you don't need to touch it after you call it.
 
Nov 11, 2012 at 4:04 AM
Professional Whatever
"Life begins and ends with Nu."
Join Date: Jan 13, 2011
Location: Lasagna
Posts: 4481
Pronouns: she/her
...But I'm trying to use the second parameter to determine which event is called. Isn't that what you're supposed to do? Store the text pointer value, add 8, push, call 421900 for ascii function, then push eax and call 421990?

God I am such an idiot
I needed to add 9, not 8
It works fine now, thanks.
 
Nov 24, 2012 at 5:51 AM
Veteran Member
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Aug 21, 2012
Location: At a computer
Posts: 337
How do i set up an NPC change event? I tried <CNP with the entity number and then the type of entity i wanted to change it to but it doesnt work.
Edit:Fixed.
 
Nov 24, 2012 at 6:30 AM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
Pronouns: he/him
That would be a change of entity type, not a change of entity event.
 
Nov 24, 2012 at 8:52 PM
Junior Member
"Fresh from the Bakery"
Join Date: Oct 28, 2012
Location:
Posts: 11
In Sue's Workshop And In Other CaveStory Modders, An Event ID Is Needed,Some Of Them Are For Doors And Chests.So Post Id And What They Do.And If You Cant Please Tell Me What The Knife/Blade is.
IDs/Suggestions


(Nice Job Prof.Eich)
 
Nov 24, 2012 at 8:59 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
Event ID is related to the tsc (script) files. 0-90 go in head.tsc and the rest are in the map's script file. Look at the event to see what it does.

This doesn't need to be a thread so I'm merging it with the quick answers thread. Please use that in future if you have questions.
 
Nov 24, 2012 at 9:20 PM
Junior Member
"Fresh from the Bakery"
Join Date: Oct 28, 2012
Location:
Posts: 11
How Do I Get A Chest To Give Me The Blade? Is It A Event Id?Alos Thanks
 
Nov 24, 2012 at 9:31 PM
In my body, in my head
Forum Moderator
"Life begins and ends with Nu."
Join Date: Aug 28, 2009
Location: The Purple Zone
Posts: 5998
Pronouns: he/him
Step 1: Don't use Sue's Workshop
Step 2: Look at the list of TSC commands. Read what they all do.
Step 3: http://www.cavestory.org/forums/threads/1667/
 
Back
Top