a new command.. random jump.

Jun 5, 2011 at 9:22 PM
Senior Member
"Huzzah!"
Join Date: Feb 18, 2011
Location:
Posts: 210
i was hoping someone that knows how to hack ASM so cavestory understands different commands will help.

the idea is easy.

#0100
<RNJ0050:0200<MSG<TURThis is a message.<NOD<END

#0200
<MSG<TURThis is some text.<NOD<END

<RNJ[insert chance to skip to the flag 1-100]:[if skipped - skip to this flag#]
(if not skipped, continue with command)

OR
-which i think will be less efficient...

#0100
<RNJ0050:0200:0300

#0200
<MSG<TURThis is a message.<NOD<END

#0300
<MSG<TURThis is some text.<NOD<END

<RNJ[chance to skip to first flagid - in this case #0200, 1-100 values]:[the flag it will skip to by chance]:[if chances fail, skip here.]

anyone has an idea of how to do it?
its.. so useful.
 
Jun 5, 2011 at 9:42 PM
Member Title
"All your forum are belong to us!"
Join Date: Mar 9, 2011
Location:
Posts: 629
I can understand perfectly how different commands will help.
 
Jun 5, 2011 at 10:45 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
This is quite doable with the variables hack that I finished months ago

http://www.mediafire.com/?yacusdwnnvc74uk
(Doukutsu Assembler file)
http://www.mediafire.com/?5b433a5wo4jaf4n
(defines.txt you probably dont' have either but may need)

<VARXXXX:YYYY
Puts YYYY into variable # XXXX
<VAOXXXX$YYYY
Performs operation $ on XXXX using # YYYY. Valid values of $ are + (addition) - (subtration) * (multiplication) and % (Basically IDIV). Dividing by zero will crash the game, by the way.
<VAZXXXX:YYYY
Zeros YYYY variables, starting at varable # XXXX. <VAZXXXX:0000 will do nothing.
<VAJXXXX:YYYY:ZZZZ:WWWW
Compare XXXX to YYYY using method ZZZZ, if true jump to WWWW. ZZZZ is as follows:
0000: JE
0001: JNE
0002: JG
0003: JL
0004: JGE
0005: JLE
0006: Always jumps, but that's a bug in the code. Any higher than 6 and you may very well crash the game.
<RNDXXXX:YYYY:ZZZZ
Puts random # between XXXX (min) and YYYY (max) into variable ZZZZ.

Changes to ASCII to # function: If your # string begins with the character "V", then it will be evaluated as the variable XXX

<NUM command now prints out the value of variable XXXX as text

i.e.
<RND0100:0120:0000<EVEV000
takes you to a random event between 100 and 120
 
Jun 6, 2011 at 7:24 AM
Senior Member
"Huzzah!"
Join Date: Feb 18, 2011
Location:
Posts: 210
wow GJ!... it even has multipile options which was the 2nd thing i wanted to ask about...
but i dont understand how to implement it. i downloaded python and the assembler,
ive downloaded the files and i click multi file assembly so it wont only assemble ASM.txt, but also
defines and TSC+... but it gives an error when assembling defines and crashes the game when the command is used.
 
Jun 6, 2011 at 12:54 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
You aren't supposed to assemble define.txt, that's just a global defines list
TSC+.txt replaces assembly.txt or whatever it was. There are some other files that need to be assembled that I kind of forgot about though.

http://www.mediafire.com/?5bpb1n4b64hj54d

These are in AutoHacker format. Consistency is a foreign word to me. I went over them for like a whole day getting it so they didn't adversely affect any NPCs or anything, I think.
 
Jun 6, 2011 at 2:46 PM
Senior Member
"Huzzah!"
Join Date: Feb 18, 2011
Location:
Posts: 210
still doesnt work. i got a fresh copy of CS, renamed TSC+.txt to asm.txt
and assembled.
then i assembled the hex codes with autohacker and ran the game with the RND script.

#0400
<RND0500:0501:0000<EVE0000

#0500
<MSG<TURThis is text.<NOD<END

#0501
<MSG<TURThis is a message.<NOD<END

#1000
<END

the game crashed as soon as i launched #0400.
 
Jun 6, 2011 at 8:33 PM
Pirate Member
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Dec 26, 2007
Location: Lithuania
Posts: 1946
Shit Noxid, so you actually managed to put variables in cavestory? How fucked up is that lol?
 
Jun 6, 2011 at 9:30 PM
Been here way too long...
"Life begins and ends with Nu."
Join Date: Jan 4, 2008
Location: Lingerie, but also, like, fancy curtains
Posts: 3054
Jun 7, 2011 at 4:00 AM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
Noxid, your Autohacker files for TSC+ definitely don't work.
(that would be this link: http://www.mediafire.com/?5bpb1n4b64hj54d)

I tried it with both hex4.txt and AltHex4.txt on a clean version of CS 1.0.0.6 and I got a crash immediately after starting the game.
Specifically, the crash was at address 411e09 where the program hits an INT3 located between functions (using AltHex4.txt).

Also, there is a clear problem with your Doukutsu Assembler version of TSC+.txt (the ASM source code - http://www.mediafire.com/?yacusdwnnvc74uk). I didn't do a direct assemble; I just looked at the ASM source itself. Suddenly I realized: this is actually your optimized version of the TSC parser. Even though it parses <RND, it doesn't look like the functionality for <RND is there! In other words, this is the wrong file.

From your blog: "Other business: I rewrote the bulk of the TSC parser and made it less than 48% of its original length." <--That's the file you gave Voyce. It's not the TSC variable hack. It's the TSC space-efficiency hack.


Please ignore what I just said while I test both the Autohacker and the Assembler stuff simultaneously applied to the same exe.

EDIT2: Even after using the Autohacker Variable Hack + Assembler Parser Hack on the same game exe, I still get stuck at 411e09. I tried this:

Code:
CPU Disasm
Address   Hex dump          Command                       Comments
00411DFC  |> \8B4D F4       MOV ECX,DWORD PTR SS:[EBP-0C]
00411DFF  |.  E8 BDEF0600   CALL 00480DC1                 ;procedural call. No ADD ESP,X needed.
00411E04  |.  E8 54A10700   CALL 0048BF5D                 ;uh oh. Not a procedural call! But no arguments, so it's okay?
[color=#7F7F7F]00411E09  |.  8BE5          MOV ESP,EBP
00411E0B  |.  5D            POP EBP
00411E0C  \.  C3            RETN[/COLOR]
00411E0D      CC            INT3
00411E0E      CC            INT3
00411E0F      CC            INT3

But then I just get another error, so the function probably isn't supposed to return at all, but jump somewhere? I'm not sure what's wrong.
 
Jun 7, 2011 at 5:48 AM
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
They are indeed supposed to be used together, but I must have gotten something mixed up inbetween the elevenhundred different revisions.

I think TscHack[19] was designed to go on-top of the WAV ORG hack that was publicly distributed (I don't know where the link is). You can try TscHack[13] (I think this one uses the Undead Core?) and if it still doesn't work then I'll just take a look at it tomorrow.
 
Jun 7, 2011 at 6:47 AM
Not anymore
"Run, rabbit run. Dig that hole, forget the sun."
Join Date: Jan 28, 2010
Location: Internet
Posts: 1369
Age: 34
Okay, I can confirm TscHack[13] works.

Code:
#0100
<PRI[color=#7F7F7F]<RND0200:0201:0029<EVEV029[/COLOR]<MSG<TURYou fumbled--failed to flip a coin.<NOD<END

#0200
<MSG<TURFlipped a coin: heads.<NOD<END

#0201
<MSG<TURFlipped a coin: tails.<NOD<END

#1000
<END

So here's the TSC I used. Run event 100 and you will see either heads or tails with a 50/50 chance.

----
Voyce, there are a few things you need to do now:

1. Get a fresh copy of Cave Story.
2. Take TscHack[13] and use the Autohacker 2 to apply the hack to your game .exe
3. Take The TSC Parser Hack and use the Doukutsu Assembler v0.4 (choose Direct Assemble) on the same game .exe (yes, you need both)
4. Use the TSC-script above and enjoy. I avoided variable 0 because I think it was giving me issues.
 
Jun 7, 2011 at 10:24 AM
Senior Member
"Huzzah!"
Join Date: Feb 18, 2011
Location:
Posts: 210
this is friggin awesome.

theres just one problem... it does a little text sound and a delay when doing the <RND command...
any fix for that?
 
Jun 7, 2011 at 1:44 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
It shouldn't.
Are you sure you didn't put an extra 'newline' after your event number?
Those can cause such a problem.

edit: I forgot to mention, the first few variables are (supposed to be) 'reserved'. They are:
V000 - Current Health
V001 - Max Health
V002 - Xpos
V003 - Ypos
V004 - Gun XP?
V005 - Gun XP till?

Handy things to calculate with I'm sure.
 
Jun 7, 2011 at 3:08 PM
Senior Member
"Huzzah!"
Join Date: Feb 18, 2011
Location:
Posts: 210
nope..
#0400
<RND0500:0501:0029<EVEV029<END

#0500
<PRI<MSG<TURThis is some text.<NOD<END

#0501
<PRI<MSG<TURThis is a message.<NOD<END

#1000
<END
 
Jun 7, 2011 at 4:23 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
Top