TSC Periodic Loops - A problem

Oct 14, 2006 at 7:18 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 20, 2006
Location:
Posts: 115
I've been experimenting with TSC a lot recently, and I have found that while the <WAI is running, entities cannot harm Quote. What I've been doing is this:

Code:
#0125
<WAI0050
//Code
<WAI0050
//Code
<FLJ0125:0125<END

Anyway, while this is running, Quote cannot be harmed. I can turn it off by nulling flag 0125, but that won't help because I don't know when he's hurt. Does anyone know how to bypass this or make a loop which does not interfere with the entities?
 
Oct 14, 2006 at 8:24 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 33
Pronouns: No homie
Maybe rune?

Edit: Oh thats spam sorry lol maybe ask him? :p
 
Oct 14, 2006 at 8:52 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 20, 2006
Location:
Posts: 115
I'm sure if he wishes to respond, he will when he sees the thread. The point was to ask everyone the question, because anyone might know.
 
Oct 14, 2006 at 9:58 PM
Hoxtilicious
"Life begins and ends with Nu."
Join Date: Dec 30, 2005
Location: Germany
Posts: 3218
Age: 33
Pronouns: No homie
Well I had same prob with my mod...
Sorry as I said its spam :p But you can surely PM him he knows about everything ín Cave Story hes like wikipedia muwahahahah hes like god *lol*
 
Oct 15, 2006 at 3:02 AM
Senior Member
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Mar 1, 2006
Location: Grasstown
Posts: 155
Age: 40
To allow for timed scripts of any sort that don't give quote invulnerability would require rewriting the relevant routines in cave story.

Depending on what you're trying to accomplish, though, you may be able to use a different method to achieve your goal.
 
Oct 15, 2006 at 12:48 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 20, 2006
Location:
Posts: 115
Rewriting the relevant routines? What does that mean?

I have also discovered that Quote can be hurt by terrain, such as spikes or lava. Prehaps it's possible to re-order the sequence in which damage is dealt to deal it at the same time as terrain; before waits stop it.
 
Oct 15, 2006 at 9:25 PM
Senior Member
"I, Ikachan. The Life and Documentary of the OrigiNAL SQuiD."
Join Date: Mar 1, 2006
Location: Grasstown
Posts: 155
Age: 40
Actually the problem is that when an event is running, the game doesn't register collisions between quote and other entities. As a result, not only can he not take damage, he can't leave the room, or start any conversations.

And rewriting the relevant routines is something that would generally be done to Cave Story's source code, and then recompiling it. Of course, CS isn't open source, so the best we can do is kind of hack at the compiled code with hex, or disassemble it and hack around the assembly code. Neither of which is very good for finding, let alone fixing, the routine that checks if the player is touching any objects.
 
Oct 16, 2006 at 6:20 PM
The Bartender
"All your forum are belong to us!"
Join Date: Jun 18, 2006
Location: Montreal, Canada
Posts: 581
Age: 40
You can easily do a few quick patches in assembly to check if Quote's "hurt" timer is running. It depends what you're trying to do exactly, though.

From what I gather, you want to switch off your loop when Quote is hurt. You could add a tiny patch that sets the flag to "On" when Quote is hit by something (I remember seeing some bounding box collision checks in there - shouldn't be too hard to find) At the start of your script, you'd initialize this to 0 (or you could also do it directly when the "hurt" timer expires and Quote stops flashing) and then you're set.

From my experience, scripts cannot run in parallel. So this is something to consider - what you might want to do could be completely impossible without rewriting the scripting engine from the ground up, so beware.
 
Oct 16, 2006 at 6:45 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 20, 2006
Location:
Posts: 115
The problem is, the flags will only react as the loop refreshes - too late for me. I guess that I'll have to rely on tileset based damage to keep the structure. Thanks.
 
Oct 29, 2006 at 2:29 PM
Senior Member
"This is the greatest handgun ever made! You have to ask yourself, do I feel lucky?"
Join Date: May 20, 2006
Location:
Posts: 115
The curse gets worse - while the loop is active, events cannot activate! I've already designed an entire level around the loop - and Julian can't leave it, save in it or anything! What do I do? There must be some assebly way around this, just to re-order the events.
 
Oct 30, 2006 at 7:00 PM
The Bartender
"All your forum are belong to us!"
Join Date: Jun 18, 2006
Location: Montreal, Canada
Posts: 581
Age: 40
Events are not parallel. They run sequentially. There is no way of making events work together.

Assembly? Maybe. But it would mean redesigning the script parser from the ground up and very heavy alterations. Scripts were never meant to run in parallel.

I tried this before, hoping I could have, say, explosions going off as the player escapes. Much to my dismay, there is no way of getting this to work with out evnts. And why should it? The script parser only loads one script at a time. How, then, can it run a second script? There's only memory reserved for one script, and the parser doesn't have any code to switch to other scripts.

Sorry mate. You're going to have to find another way of doing whatever it is you have in mind.
 
Back
Top