Potential TSC Hacks

May 4, 2009 at 11:27 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
Well, CAT is apparently useless, so I'm gonna cannibalize it for an extension of an existing command. I'm gonna give you guys the hack in the end, and hopefully it will help you with adding some cool stuff into your mods. Give your suggestions here.

from page two:
Mega-ultra post - now with an exclusive super special promise!
And color coded! ^^


TSC2:
<IN+xxxx:yyyy - add y to integer variable x
<IN-xxxx:yyyy - subtract y from integer variable x
<INJxxxx:yyyy:zzzz - jump to event z if integer variable x is equal to y
<IRJxxxx:yyyy:zzzz - jump to event z if integer variable x is greater than y
<ILJxxxx:yyyy:zzzz - jump to event z if integer variable x is less than y
<INTxxxx - outputs integer variable x into textbox
<EID - tsc input is as an integer variable.
<DID - tsc input is a literal value


QUOTE:
<ML-xxxx - subtracts from max life
<ML=xxxx - sets max life

<MLSxxxx - saves max and current life to file x
<MLLxxxx - loads max and current life from file x
<MIMxxxx - moves the co-ords of mychar downwards by x*32. 0 would be norm, 1 mimiga mask, and so forth.

<KIL - Kills quote instantly.

COORDINATES:
<CRDxxxx:yyyy - stores the coordinates (x,y)
<MYC - stores the player's coordinates
<NPCxxxx - stores the coordinates of entity x
<BSC - stores the coordinates of the stage boss
<CR+xxxx:yyyy - adds (x,y) to the stored coordinates
<CR-xxxx:yyyy - subtracts (x,y) from the stored coordinates
<CRxxxxx - stores the x coordinate only
<CRyyyyy - stores the y coordinate only
<CPC000X - X is either 0 (for X-coordinate) or 1 (for Y-coordinate). outputs coord as text


NPC:
<NPOxxxx:yyyy:zzzz:wwww - creates npc w at distance xy from quote, and away from quote in direction z.
<TAPxxxx - Destroys all enemies within an x radius of quote.
<ENJxxxx:yyyy:zzzz - if the amount of entity x is equal to number y, jump to event z


OTHER:
<WAMxxxx:yyyy - ZAM if y is 0, but sets current weapon energy to x if y is 1.
<FLAxxxx:yyyy:zzzz - Flash the screen with the color specified by xyz.
<WMUxxxx - Waits for the music to reach click x
<MUJxxxx:yyyy - jump to event y if music is at or past click x

<SPRxxxx:yyyy - changes sprite sheets x (1 or 2) to sprite sheet y (sprite sheet number, would have to give a list)
<WAIxxxx - waits for x ticks without interupting gameflow

<WAPxxxx - classic wai
<AGIxxxx - 500 is normal agility. above is faster, below is slower.

<YNJxxxx:yyyy - YNJ, but with a third option


RED - Very difficult to implement, because of space issues or otherwise.
YELLOW - Requires me to hack the saving macro (annoying)
PURPLE - Medium difficulty.
GREEN - Can do fairly easily
BLUE - Already done it.

So, what does this awesome color coding system mean to you?
well, purple ones are what I'm most likely to do, but agility has a few awesome uses, so I might do that first.

actually, here are a few hack packs I thought up and could make for you guys
Char Hack Pack said:
<MIMxxxx - moves the co-ords of mychar downwards by x*32. 0 would be norm, 1 mimiga mask, and so forth.
<AGIxxxx - 500 is normal agility. above is faster, below is slower.
and depending on space...
<MLSxxxx - saves max and current life to file x
<MLLxxxx - loads max and current life from file x
Music Hack Pack said:
<WMUxxxx - Waits for the music to reach click x
<MUJxxxx:yyyy - jump to event y if music is at or past click x
Use Hack Pack said:
<WAIxxxx - waits for x ticks without interupting gameflow
<WAPxxxx - classic wai
<YNJxxxx:yyyy - YNJ, but with a third option
Health Manipulator Pack said:
<ML-xxxx - subtracts from max life
<ML=xxxx - sets max life
<MLSxxxx - saves max and current life to file x
<MLLxxxx - loads max and current life from file x

or any single hack. (besides tsc2 and coords)
also, cheesy, your ideas are not abandoned, I'm going to work on them later.

btw, my exclusive super special promise is to get you whichever hack pack is liked best by the end of june.

so...
yay or nay?
 
May 4, 2009 at 11:31 PM
Cold Agony of Resolute Vacuum
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jan 1, 2008
Location: Elsewhere
Posts: 1973
<TAPXXXX
Destroys all enemies within X blocks.

<CPC000X
X is either 0 (for X-coordinate) or 1 (for Y-coordinate)
Outputs coordinates as text.

<ML-XXXX
Uhm, dur?
 
May 4, 2009 at 11:33 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
cool; got another idea too, because of an obnoxious coding problem in my mod
<ENJXXXX:YYYY:ZZZZ -
if the number of entity x is equal to number y, jump to event z
 
May 4, 2009 at 11:36 PM
Cold Agony of Resolute Vacuum
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jan 1, 2008
Location: Elsewhere
Posts: 1973
Lace said:
cool; got another idea too, because of an obnoxious coding problem in my mod
<ENJXXXX:YYYY:ZZZZ -
if the number of entity x is equal to number y, jump to event z

Ah, like...
If there are EXACTLY 32 Stumpies, jump to event 0134, which kills them all?
 
May 4, 2009 at 11:53 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
or turns them all into mutant undead monkeys.
but yes.
 
May 5, 2009 at 12:07 AM
Been here way too long...
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jun 22, 2008
Location:
Posts: 251
<KIL

Kills quote instantly. I know this could easily be accomplished by other shenanigans, but oh well, it might be useful, somewhere.

And if you are looking for commands to cannibalize, <TAM is redundant as you can just use AM+ and AM-. Not much space to work with in it, though.

<SWCXXXX SWitch Charachters to X. That way you can use as many characters as you want. I kinda doubt that is possible with the engine works, though. At least without some major hacks. Also <CAT doesn't take parameters, so it might be tough. I don't think I could do it, kudos to you if you can.
 
May 5, 2009 at 5:24 PM
graters gonna grate
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jul 2, 2008
Location: &
Posts: 1886
Age: 31
I've had this idea about improving the coordinate specification system for a while now, which would involve modifying many existing TSC commands, as well as adding some new ones.

Any command that has screen coordinates as paramaters (for example <MOV <MNP <CMP <TRA) would need to be modified and have the coordinate parameters removed. The game would have a buffer to keep track of the "stored coordinates" which would be used by those commands. The stored coordinates could be modified with the following commands:

<CRDxxxx:yyyy stores the coordinates (x,y)
<MYC stores the player's coordinates
<NPCxxxx stores the coordinates of entity x
<BSC stores the coordinates of the stage boss
<CR+xxxx:yyyy adds (x,y) to the stored coordinates
<CR-xxxx:yyyy subtracts (x,y) from the stored coordinates
<CRXxxxx stores the x coordinate only
<CRYyyyy stores the y coordinate only

Examples:

Move quote to (10,10)
<CRD0010:0010<MOV

Move quote to 10 spaces below entity 9999
<NPC9999<CR+0000:0010<MOV
 
May 5, 2009 at 7:34 PM
Been here way too long...
"..."
Join Date: Jan 21, 2006
Location:
Posts: 369
How about a physics altering command. Run faster and jump higher.
 
May 5, 2009 at 8:34 PM
graters gonna grate
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jul 2, 2008
Location: &
Posts: 1886
Age: 31
I've been thinking about this and I've come up with a really strange but cool idea. Could be pretty difficult do implement, though.

The first part of my idea isn't that complicated: replace the flags with integers. <FL+xxxx and <FL-xxxx become <IN+xxxx:yyyy and <IN-xxxx:yyyy respectively (add/subtract y to/from integer variable x). <FLJxxxx:yyyy becomes <INJxxxx:yyyy:zzzz (jump to event z if integer variable x is equal to y). You might also want to add <IGJx:y:z and <ILJx:y:z to check for greater that/less than respectively rather than equal to. You will also need <INTxxxx:yyyy to set integer variable x equal to y. Perhaps you could also change the <NUMxxxx command (which outputs the most recent ammo increase to the textbox) to output integer variable x to the textbox.

Now here's where things get tricky. Implementing this idea will require a hack to the TSC parsing algorithm and not just to each individual command. In order for these integer variables to be useful, you'd need to be able to use them as parameters for commands. To do this, there would need to be two new commands: <ID+ (enable indirection) and <ID- (disable indirection). When indirection is disabled, all TSC commands work the way they normally do. When indirection is enabled, however, each paramater sent to any TSC command is treated as an index in the array of integer variables, rather than as a literal value.

This could be an extremely useful feature for scripting (making it more like programming than scripting, really). As an example, suppose I want to <CMP the top row of a map 100 tiles wide to tile 0000. With "normal" TSC, I'd have to write 100 <CMP commands to do this. However, with my proposed upgrade, I could simply do this:

<INT0000:0000<INT0001:0000
#0100
<ID+<CMP0000:0001:0001<ID-
<IN+0000:0001<ILJ0000:0100<END

thus reducing 100 TSC commands to a mere 8.
 
May 5, 2009 at 8:39 PM
Cold Agony of Resolute Vacuum
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jan 1, 2008
Location: Elsewhere
Posts: 1973
SeriousFace said:
How about a physics altering command. Run faster and jump higher.

Could this be done as an expansion of <UNI?

'Coz I could really use that.
 
May 5, 2009 at 10:51 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
I've been thinking about this and I've come up with a really strange but cool idea. Could be pretty difficult do implement, though.

The first part of my idea isn't that complicated: replace the flags with integers. <FL+xxxx and <FL-xxxx become <IN+xxxx:yyyy and <IN-xxxx:yyyy respectively (add/subtract y to/from integer variable x). <FLJxxxx:yyyy becomes <INJxxxx:yyyy:zzzz (jump to event z if integer variable x is equal to y). You might also want to add <IGJx:y:z and <ILJx:y:z to check for greater that/less than respectively rather than equal to. You will also need <INTxxxx:yyyy to set integer variable x equal to y. Perhaps you could also change the <NUMxxxx command (which outputs the most recent ammo increase to the textbox) to output integer variable x to the textbox.

Now here's where things get tricky. Implementing this idea will require a hack to the TSC parsing algorithm and not just to each individual command. In order for these integer variables to be useful, you'd need to be able to use them as parameters for commands. To do this, there would need to be two new commands: <ID+ (enable indirection) and <ID- (disable indirection). When indirection is disabled, all TSC commands work the way they normally do. When indirection is enabled, however, each paramater sent to any TSC command is treated as an index in the array of integer variables, rather than as a literal value.

This could be an extremely useful feature for scripting (making it more like programming than scripting, really). As an example, suppose I want to <CMP the top row of a map 100 tiles wide to tile 0000. With "normal" TSC, I'd have to write 100 <CMP commands to do this. However, with my proposed upgrade, I could simply do this:

<INT0000:0000<INT0001:0000
#0100
<ID+<CMP0000:0001:0001<ID-
<IN+0000:0001<ILJ0000:0100<END

thus reducing 100 TSC commands to a mere 8.
Cool. I've been looking at a way to make tsc more like programming for a while, but this si better than most ideas I've had. hacking the parser isn't actually that hard, since it's basically just a lot of nested if else statements, and yeah. The main problem i see with that plan is space, you'd need a lot of it to do what you're proposing, and that means one of two things, cannibalizing space, or streamlining cave stories really messy code. neither of these are particularly viable, since cannibalization would destroy to many things to be useful, and streamlining would take forever and a half,as well as screwing up all those handy dandy hacking tutorials we have. So I don't think I'll do it for this project, however, I'm working on a side side project that it might be really useful for.

also, my not silly friend:
How about a physics altering command. Run faster and jump higher.
that I could probably do, and in a pretty short time, too. I don't quite get how the command would work, though, multiplication would keep proportions, but make the character spaz out at higher levels, and addition simply wouldn't work. maybe something like the following:
Code:
y = b*.2e^.0032x
where y is the agility, b is the base agility, and x is the inputted number.
but some people have problems with exponentials.
 
May 5, 2009 at 11:00 PM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
OH NO, EXPONENTIALS!!!

Lace said:
Code:
y = b*.2e^.0032x
where y is the agility, b is the base agility, and x is the inputted number.
but some people have problems with exponentials.
Actually, I have a problem with any thing that requires graphing, =D

This all sounds awesome {Because I'm lazy and am attracted to short cuts...
"thus reducing 100 TSC commands to a mere 8"....}
But, if/when you made the TSC hack, how hard would it be to inter-grade it in existing mods..?
 
May 7, 2009 at 4:23 AM
Been here way too long...
"Ha! Ha! Ha! Mega Man is no match for my Mimiga Man!"
Join Date: Jun 22, 2008
Location:
Posts: 251
If WoC's coordinate system isn't possible, what about <NPOxxxx:yyyy:zzzz:wwww

xxxx = horizontal offset from quotes position
yyyy = vertical offset from quotes position
zzzz = direction (0 = up and right, 1 = up and left, 2 = down and left, 3 = down and right)
wwww = NPC to create

So that you could create an NPC a certain distance away from quote. This could also be done with tiles.
 
May 16, 2009 at 2:42 PM
graters gonna grate
"Heavy swords for sale. Suitable for most RPG Protagonists. Apply now!"
Join Date: Jul 2, 2008
Location: &
Posts: 1886
Age: 31
Alright I just had another idea. It would be really nice if you could synchronize cutscenes with the music. This could be done with two commands: <WMUxxxx (wait for the music to reach click x) and <MUJxxxx:yyyy (jump to event y if music is at or past click x)
 
May 16, 2009 at 3:31 PM
Been here way too long...
"The Ultimate Sword of Extraordinary Magnitude"
Join Date: Jul 1, 2007
Location: Australia
Posts: 285
Age: 35
A command that plays an event after a certain amount of time has passed would be nice.
 
May 16, 2009 at 4:38 PM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
What about...

I don't know if this is stupidly impossible or what... {So don't laugh D=}
..but..
Could you make a command that would be able to change the sprite sheet{s} of the current map...? :(
 
May 19, 2009 at 12:28 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: 3054
Mega-ultra post - now with an exclusive super special promise!
And color coded! ^^


TSC2:
<IN+xxxx:yyyy - add y to integer variable x
<IN-xxxx:yyyy - subtract y from integer variable x
<INJxxxx:yyyy:zzzz - jump to event z if integer variable x is equal to y
<IRJxxxx:yyyy:zzzz - jump to event z if integer variable x is greater than y
<ILJxxxx:yyyy:zzzz - jump to event z if integer variable x is less than y
<INTxxxx - outputs integer variable x into textbox
<EID - tsc input is as an integer variable.
<DID - tsc input is a literal value


QUOTE:
<ML-xxxx - subtracts from max life
<ML=xxxx - sets max life

<MLSxxxx - saves max and current life to file x
<MLLxxxx - loads max and current life from file x
<MIMxxxx - moves the co-ords of mychar downwards by x*32. 0 would be norm, 1 mimiga mask, and so forth.

<KIL - Kills quote instantly.

COORDINATES:
<CRDxxxx:yyyy - stores the coordinates (x,y)
<MYC - stores the player's coordinates
<NPCxxxx - stores the coordinates of entity x
<BSC - stores the coordinates of the stage boss
<CR+xxxx:yyyy - adds (x,y) to the stored coordinates
<CR-xxxx:yyyy - subtracts (x,y) from the stored coordinates
<CRxxxxx - stores the x coordinate only
<CRyyyyy - stores the y coordinate only
<CPC000X - X is either 0 (for X-coordinate) or 1 (for Y-coordinate). outputs coord as text


NPC:
<NPOxxxx:yyyy:zzzz:wwww - creates npc w at distance xy from quote, and away from quote in direction z.
<TAPxxxx - Destroys all enemies within an x radius of quote.
<ENJxxxx:yyyy:zzzz - if the amount of entity x is equal to number y, jump to event z


OTHER:
<WAMxxxx:yyyy - ZAM if y is 0, but sets current weapon energy to x if y is 1.
<FLAxxxx:yyyy:zzzz - Flash the screen with the color specified by xyz.
<WMUxxxx - Waits for the music to reach click x
<MUJxxxx:yyyy - jump to event y if music is at or past click x

<SPRxxxx:yyyy - changes sprite sheets x (1 or 2) to sprite sheet y (sprite sheet number, would have to give a list)
<WAIxxxx - waits for x ticks without interupting gameflow

<WAPxxxx - classic wai
<AGIxxxx - 500 is normal agility. above is faster, below is slower.

<YNJxxxx:yyyy - YNJ, but with a third option


RED - Very difficult to implement, because of space issues or otherwise.
YELLOW - Requires me to hack the saving macro (annoying)
PURPLE - Medium difficulty.
GREEN - Can do fairly easily
BLUE - Already done it.

So, what does this awesome color coding system mean to you?
well, purple ones are what I'm most likely to do, but agility has a few awesome uses, so I might do that first.

actually, here are a few hack packs I thought up and could make for you guys
Char Hack Pack said:
<MIMxxxx - moves the co-ords of mychar downwards by x*32. 0 would be norm, 1 mimiga mask, and so forth.
<AGIxxxx - 500 is normal agility. above is faster, below is slower.
and depending on space...
<MLSxxxx - saves max and current life to file x
<MLLxxxx - loads max and current life from file x
Music Hack Pack said:
<WMUxxxx - Waits for the music to reach click x
<MUJxxxx:yyyy - jump to event y if music is at or past click x
Use Hack Pack said:
<WAIxxxx - waits for x ticks without interupting gameflow
<WAPxxxx - classic wai
<YNJxxxx:yyyy - YNJ, but with a third option
Health Manipulator Pack said:
<ML-xxxx - subtracts from max life
<ML=xxxx - sets max life
<MLSxxxx - saves max and current life to file x
<MLLxxxx - loads max and current life from file x

or any single hack. (besides tsc2 and coords)
also, cheesy, your ideas are not abandoned, I'm going to work on them later.

btw, my exclusive super special promise is to get you whichever hack pack is liked best by the end of june.

so...
yay or nay?
 
May 19, 2009 at 12:38 AM
Level 73 Procrastinator
"Life begins and ends with Nu."
Join Date: Apr 6, 2009
Location: Forgotten Tower
Posts: 2052
OH JEEZE!

HOLY CRAP!!!
My mind whirls at the possibilities presented with these promised hacks!!!!
{I could have really used the integers ones for my Mini-game... ^.^;}
This list looks freakin' awesome!!
If there's any help I can provide, let me know =D
 
May 19, 2009 at 12:58 AM
Been here way too long...
"..."
Join Date: Jan 21, 2006
Location:
Posts: 369
Oh lace, how about a tsc command that changes what the map button does?
 
May 19, 2009 at 1:15 AM
Hax on....Hax off....
"Big Joe Tire and Battery Restaurant! Opening Soon! Eat at Big Joes!"
Join Date: Jan 5, 2009
Location: Easter Island
Posts: 476
oooh wow that's all pretty cool. I didn't think it was possible to had new tsc commands.
The one that sets walking speed looks pretty sweet. Maybe you should try one that changes jump height or something? Hehehe Are you gonna share these or are you just gonna show all these and say hey! look what I can do and you can't *poke tongue out*!.
I don't really particularly need these but they look pretty sweet.
 
Top