TSC Trickery: Help Thread For Simplification & Visual Effects

May 3, 2012 at 5:03 PM
Bonds that separate us
Forum Administrator
"Life begins and ends with Nu."
Join Date: Aug 20, 2006
Location:
Posts: 2846
Age: 33
So I just had a possible brainwave. Over time, I've come up with preferred ways of creating certain effects, and picked up a few from playing other mods. Now, while there's a multitude of "how I make this work" threads, there has (from memory) never really been a place to discuss how to make the code work for you. Say, for example, that someone comes up with an idea for a scene and then goes about thinking how to implement it in a mod. They might assume some parts are impossible and downsize it until it only works with basic coding functions, or scrap it altogether.

There are some things, of course, that require ASM, or drawing ability (>_>), or just aren't feasible. However, particularly in the case of effects that are purely visual, it's possible to get surprisingly far using only TSC. I've also seen many a new mod struggle with basic map or entity effects, but almost never see questions about them, such as what deleting an entity or making them visible or invisible really means. These types of difficulties are more like logic errors than run-time errors, and so don't really fit in with starter-level coding tutorials or quick answers, as they can often be abstract or complex. In many cases there are even multiple ways of doing the same thing.

Classic example: An event takes place where certain entities or tiles are changed, the player saves and reloads, and the changes are lost. Entities can usually be fixed using flags, but maps are only ever loaded in their default configuration. Therefore, rather than having to make a change every single time a map is reloaded, what I do is create the map the way it will look in its final state and change it to its 'initial' state only the first time that it's visited. Failing that, or if certain other changes need to be made upon each load, a h- or v-trigger can be placed directly over the save point, which will instantly go off before the player can do anything. However, this runs into difficulties if such tiles visible near the save point, because the player isn't meant to see them changing. Sometimes it might even be better to create a whole new map, but only when it won't mean even more work or waste space.

I've long wanted to try and find a place where these types of tips and tricks would fit in, but in tute threads they would get drowned out and in the quick answers thread I can only help one person at a time and people may not even think to ask these things there. Hopefully this thread will allow my self and others to help folks out with their ideas as they arise, and maybe save them the trouble we all went through when we were first starting out. For the time being, feel free to discuss/argue my idea here, and if it works out the topic can be made official-ish.

Hugs :debug:
 
May 4, 2012 at 12:19 AM
The Preacher
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Feb 20, 2011
Location: lost in translation
Posts: 336
Age: 31
In other words, this thread is about advanced TSC modding, right? It's cool, we kinda needed a thread like that. We could as well share our special techniques to make cool stuff using only TSC while we're at it.

DoubleThink said:
if certain other changes need to be made upon each load, a h- or v-trigger can be placed directly over the save point, which will instantly go off before the player can do anything.
Yeah, I did that in my mod too, cause I couldn't figure out how to change map tiles upon reloading.

Then I thought that I could as well copypaste the #0090 to #0094 events (to #1090 to #1094 for example), add some <CMP commands (and sometimes <CNP) in them, and add a <WAI command before the <FAI so that the changes could be made during the black screen. This way, everytime I'd need the modified map, I'd call the #109_ events instead of the #009_ events, and everything would work fine.
I still had to put a H/V trigger somewhere though. But this way I'd avoid allowing the player to see the changes in the map.
 
May 4, 2012 at 2:49 AM
Bonds that separate us
Forum Administrator
"Life begins and ends with Nu."
Join Date: Aug 20, 2006
Location:
Posts: 2846
Age: 33
In other words, this thread is about advanced TSC modding, right? It's cool, we kinda needed a thread like that. We could as well share our special techniques to make cool stuff using only TSC while we're at it.
Sort if, I was intending more for it to be a place where people can ask for advice about creating certain effects rather than a compendium
 
May 5, 2012 at 12:09 AM
The Preacher
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Feb 20, 2011
Location: lost in translation
Posts: 336
Age: 31
Well, we can do both.

And for inauguration purposes (and also because I'd like to know), is it possible to remove a boss health bar (after calling a <BSL) in TSC without killing the boss?
<CNP, <ANP, <TRA, <END, <CLR didn't work. I don't have many more ideas D:
 
May 8, 2012 at 4:52 PM
Bonds that separate us
Forum Administrator
"Life begins and ends with Nu."
Join Date: Aug 20, 2006
Location:
Posts: 2846
Age: 33
Coming back to this... it's a bit hard to think of why you would want to do this, because the only purpose of <BSL is to make the health bar show up. All I can think of is having it appear and then disappear for cinematic effect, which come to think of it would make sense, seeing as that's what this thread is for :awesomeface: In that case the easiest method I can think of is to have a background that matches up perfectly with the scene at that moment (i.e. is a screenshot), but then change it so that a row or two of tiles near the bottom of the screen are actually blank and only 'appear' visible because the background is the same. Then, <TRA to an identical map that has the same background with the boss health bar pasted over the top, and <TRA back when you want to remove it. I hope that makes sense - note that it will only work if the screen is static the entire time, unless the background is uniform. There are a couple of other methods I can think of that would achieve the same effect (involving <SMP), but none that would work with a moving background.
 
May 8, 2012 at 7:17 PM
The Preacher
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Feb 20, 2011
Location: lost in translation
Posts: 336
Age: 31
I see. But that means the health bar wouldn't act as a real health bar, would it? And even if it would, the map is too big to allow that kind of trick.
I wanted to make a boss battle where you could escape and change map without fighting, but still have the health bar if you wanted to beat the boss. I guess I'll have to code an assembly function then. Thank you for helping though!
 
May 9, 2012 at 5:42 AM
Been here way too long...
Discord Group Admin
Org Discord Moderator
"Life begins and ends with Nu."
Join Date: Oct 18, 2011
Location:
Posts: 2335
Wait, didn't that happen in Jenka's Nightmare? I'm almost positive there was no hacking in JN, so it must be possible. I'm going to look in the script for Misery's Abode later to see. Or you guys can, if you want.
 
May 11, 2012 at 2:06 PM
Bonds that separate us
Forum Administrator
"Life begins and ends with Nu."
Join Date: Aug 20, 2006
Location:
Posts: 2846
Age: 33
ZT came up with a way to restore from death a long time ago, I'll see if I can find it...

Here we go

Basically the way I've always read this is that upon death you will need to reset/reload the game and then 'fast-forward' it to the point where you died using flag checks. There seems to be no other way to do this using TSC alone.

Additional note: To get a better idea of how dying worked I decided to see what would happen if I put an auto-save in the death script. The result: It loads you exactly at the point where you died, meaning instant auto-death if spikes were involved, except when dying without having saved once before (i.e. profile.dat did not exist), in which case it will load you back in the start room, but only if you select yes at the death query :koron:
 
May 11, 2012 at 4:40 PM
hi hi
"What're YOU lookin' at?"
Join Date: Oct 17, 2011
Location: probably somewhere else
Posts: 1099
Age: 26
Thank you! I have another trouble sometimes: with the MYB command. How does it exactly work? When I set direction to left, it bumps me right, not left. And is there any way to bump player upwards?
 
May 11, 2012 at 9:31 PM
The Preacher
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Feb 20, 2011
Location: lost in translation
Posts: 336
Age: 31
<MYB is like a <MYD that also bumps the player back.
For example, when you use <MYB0000, it will do a <MYD0000 (which makes you loo kto the left) and bumps you back. Which means it actually bumps you to the right since you're now looking to the left.

Thus, I don't think there is a way to bump the player upwards or downwards.
 
May 20, 2012 at 2:09 AM
Member Title
"All your forum are belong to us!"
Join Date: Mar 9, 2011
Location:
Posts: 629
Given the response Mixer got and my personal lack of success, I'm re-asking a question I asked several months ago.
How would one go about bumping the PC upward, like entering the King's Table room or Deep Space in Cave Story. The response I got last time was to use <MYBXXXX, which as I mentioned earlier amounted to no success.
 
May 20, 2012 at 2:47 AM
The Preacher
"Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-Wacka-BLEIUP"
Join Date: Feb 20, 2011
Location: lost in translation
Posts: 336
Age: 31
Well, I checked and the script of King's Table room contains <MYB0410 and <MYB0420. You should try to use them.
 
May 21, 2012 at 10:12 AM
Bonds that separate us
Forum Administrator
"Life begins and ends with Nu."
Join Date: Aug 20, 2006
Location:
Posts: 2846
Age: 33
According to Boots' updated guide, <UNJ is a check for no damage taken - I don't know over how long a period.

To my knowledge, there is no way to make entities spawn part-way between blocks. If so, the only way to move entity-Quote into position would be to have it done offscreen, by using <ANPXXXX:0050:XXXX to get him into the position you want and then using <CNP to turn him into a 0 until you're ready to use him (at which point you change him back).
 
May 21, 2012 at 3:11 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
I thought the no damage taken thing was flag-based
 
May 22, 2012 at 10:51 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
oh right, it was other things

The ikachan generator NPC disappears if the player takes damage so you have to check for its existence with <NCJ
I use this technique in Pyramid mod.
 
Top