Page 7 of 7

Re: An Explanation Of Triggers

PostPosted: July 19th, 2014, 9:59 pm
by AwesomeJRFD
I am now the owner of the main post, and I've updated it with a bunch of cool new information, like Static variables and hidden trigger functions.

Re: An Explanation Of Triggers

PostPosted: July 19th, 2014, 10:33 pm
by Raz
Thanks for giving the thread without telling me at all, that's cool. Even if I wasn't doing stuff, it's still a pretty scummy move to just do it without my say in the matter whatsoever.
I was actually planning on adding stuff.
(and yes I'm being completely sarcastic)

Re: An Explanation of Triggers

PostPosted: July 20th, 2014, 1:43 pm
by CedarBranch
AwesomeJRFD wrote:

If I read this right, does that actually mean that the following trick below is now obsolete?


JSlayerXero in 'Designer Tips and Tricks' (Page 10) wrote:So, I figured out a way to retain global variables after death. To copy it straight out of my Mini-LLLDC entry:
Code: Select all
llitem:6:achv2mem;4203;348;64;64;0;1;branch,5,4,g_achvt,1:set,a,1:set,g_achv2t,1:exit:branch,5,7,g_achv2t,1:set,g_achv2t,1:add,g_achv,g_achv,a:set,g_achvt,0|46;4210;280;branch,5,6,achv,1:add,g_achv,g_achv,1:set,achv,1:activate,achv2mem:subtitle,1,%3Cb%3EAchievement%20Unlocked%3A%20%7B%24g_achv%7D/4%3C/b%3E%0DThe%20Ghost%27s%20Heart,75:sleep,60:subtitle_off|6;4288;256;64;64;0;1;set,g_achvt,1:activate,achv2mem

To explain this is layman's terms, basically what happens is that the Large Heart has the code to make my achievements. These are only built to activate once, and will end prematurely if you've ever gotten them before. These then activate a "memory" trigger, in this case the "achv2mem" trigger. The blank hitbox trigger I should've renamed something like "memrecall" since that is its function. It sets a "test" variable and activates the memory trigger. The test variable makes it so that the actually memory function doesn't activate prematurely. When the achievement trigger activates the memory, it also sets a global variable to let the memory know that you got that particular achievement in this life. This prevents you from getting the achievement again when you activate the recall trigger. However, since it is global, it is also used to detect if you have the achievement, but died afterwards. There are probably better ways to word this, but I've explained the basic functions.

Keep this in mind when placing these: The achievement, and to my knowledge, the memory can be anywhere in the level, but the recall has to be placed in such a way that it must be activated before going through a mandatory transition.

Keep in mind that this system is custom-built to work with my level. Modifications may be necessary to make this compatible with other levels.


...Or will they still not work across transitions, if I read it wrong?
(I'm doing something in my 2nd LLLDC entry where I have one of three switches at the end of each of three segments of the level. Each switch swaps an Empty Orb with a Delta Orb via Move Item functions - all within the same transition. I am concerned that the Delta Orbs will revert back out of place if I die inside or outside that particular transition, so then I used JSlayerXero's "memory trick" to attempt to fix this. However, I haven't tested it yet to make sure it clearly is fully compatible with my level; I am a very cautious individual, so I don't want to have any location where respawning/dying from it breaks the level [reverting the Delta Orbs back out of place, and needing to re-press each Switch]. Essentially, I'd love to have a clear, simple solution, and I'm hoping that Static variables is the one.)

Re: An Explanation of Triggers

PostPosted: July 20th, 2014, 2:40 pm
by AwesomeJRFD
Static variables work the same way as regular Global variables in that they work across transitions and different triggers, so yes. They will work fine for that, and Xero's trick is obsolete.

Re: An Explanation of Triggers

PostPosted: July 20th, 2014, 2:56 pm
by CedarBranch
Thank you so much for that clarification. :>

...And now to continue working on my entry. IT HAZ TO B DUN!

Re: An Explanation of Triggers

PostPosted: July 26th, 2014, 10:38 am
by ReSult
I have my own object here, for Grass Levels.
Code: Select all
llitem:194;535;1395;1;1;130;;0|195;559;1416;1;1;125;;0|193;573;1411;1;1;40;;0|193;587;1387;1;1;-140;;0|196;586;1388;1;1;55;;0|189;528;1362;1;1;15;;0|192;549;1318;1;1;-95;;0|193;557;1302;1;1;-110;;0|190;543;1299;1;1;-130;;0|195;570;1310;1;1;-10;;0|194;571;1341;1;1;0;;0|196;571;1339;1;1;-170;;0