Jump to content

Photo
- - - - -

[Tips&Tricks/2.50] Light-all-torches-before-they-burn-out Mechanis

Tips&Tricks 2.50

  • Please log in to reply
4 replies to this topic

#1 NoeL

NoeL

    Legend

  • Members
  • Real Name:Jerram

Posted 14 January 2014 - 03:12 AM

Overview
This is a tutorial for a mechanism that requires all braziers on screen to be lit to activate, but the braziers will burn out after a while unless the player is able to light all of them (in which case they'll all burn indefinitely).

Combos
On your combo page you'll need:

  • An unlit brazier.
  • A sequence of several identical combos (same speed/anim. frames) of a lit brazier, each cycling to the next in the series with the last cycling back to the unlit brazier. The number of combos you need in this series depends on three things: 1) the animation speed of the flame, 2) the length of the burn before it reverts to unlit, and 3) the precision of the burn time (e.g. is a burn time anywhere between 2.5 and 3.5 seconds going to be ok, or does it need to be as close to 3 seconds as possible?). The faster, longer and more precise, the more combos needed. I've gone with six.
  • A permanently lit brazier.

(alternatively, rather than having a series of identical looking combos you could have the flame peter out over the length of the combo sequence. Keep the speed/anim. frames the same but use different tiles)

Set them up in your combo table as shown below. The picture on the right shows what inherent flags each combo needs assigned.


mhw9.png52cq.png
Combo Cycling
This section deals with the middle series of combos and how they relate to each other.

When you look at the 'Edit Combo' screen you'll see a little checkbox at the bottom that says "Restart Animation when Cycled To". This box was implemented because in earlier releases of ZC combos would animate in the table even if they weren't on screen, meaning that unless you had two combos with the same number of frames and animation speed you couldn't really know what frame of animation a combo would be in when it was cycled to. If for example you wanted to cycle to an animation of a statue crumbling, it could be half or even fully through the animation at the point the combo becomes visible on screen, leading to a less than impressive effect. The work around for this was to have a separate combo for every 1-2 frames of animation and have the first cycle to the second, the second to the third, etc., so that you could cycle to the first combo in the animation sequence and be sure that it would begin on the first (or second) frame. This gave a far better effect at the expense of combo table space and complexity. The "Restart Animation when Cycled To" option fixes this problem. You can have a single combo with a long animation and not have to worry about it starting half way through.

HOWEVER, as I discovered when designing this mechanism, the "Restart Animation when Cycled To" option affects all instances of that combo. So when I was lighting up a second brazier and cycling to a single combo of an animated flame, it would restart that flame's animation in addition to every other lit brazier on screen. This would reset the burn time for all lit braziers and have all of them go out simultaneously if you failed to light another one quick enough (this could definitely have utility, but not exactly what we're looking for right now). Because we don't want all the braziers to restart their countdown we need to leave "Restart Animation when Cycled To" unchecked and set up our combo cycling the old-school way.

So, we need a number of combos, each representing a frame or two of animation. Since the first combo could appear at any time throughout its animation we need to make the amount of time each combo is visible on screen brief if we want the burn time of the lit braziers to be fairly consistent (alternatively, if you want a more random burn time you can use fewer combos with longer animations). I've gone with two frames at a speed of 10, cycled over six combos. Not a very long burn time, but you can tweak this to your own specs.

6kif.png

If you have no idea what I'm talking about, here's an example that might help you visualise it. If you're with me, skip this spoiler:

Spoiler


Flags
My test screen is pretty simple: just three "braziers" (i.e. big triforces... I was lazy ok?) on a plain background.

2h66.png

Each brazier has an inherent flag 4 (burn trigger any), but we're also going to put screen flag 95 (trigger -> self, secret) on our braziers. We're using a trigger -> self flag so that only the brazier hit with a flame triggers, but since we also need secrets to activate we're using flag 95 instead of 94.

ep82.png

Screen Data
Quick section this time; just make sure 'Hit All Triggers-> 16-31' is checked. This makes secrets activate when all the burn triggers are activated (i.e. all the braziers are lit). If the dmap is set to Overworld or Interior and you want the secret to be temporary (it's permanent by default) just check 'Secrets are Temporary'. Secrets are always temporary in NES Dungeons and checking 'Hit All Triggers->Perm secret' doesn't change this.

458i.png

Secret Combos
Here's where things get a little tricky because we have to use a little known (and hidden) feature: tiered secrets. This allows you assign screen flags to secret combos and is necessary for more complex puzzles.

First of all, set all the 'Burn' secret combos to the first combo in our 'lit brazier' sequence. You also need to assign flag 95 to each of the secret combos (hold ctrl and click the secret combo). Without this, relighting a previously burned out brazier would trigger all the secrets, causing all braziers to ignite.

bo4p.png

For our last step, we need to set our secret combos. Since we have given our lit brazier sequence the inherent flag 16, we need to set secret combo 16 to our permanently burning brazier.

ru3g.png

Once all the burn triggers have been triggered, our screen data tells us to activate secret combos 16-31. Secret combo 16 is set as our permaburn brazier combo and all our lit brazier combos have flag 16 on them, causing them all to become permaburn braziers. Simple, right?

You would also use secret combos 17-31 to make some other change to the screen, for example a chest appearing. Otherwise the mechanism would be pretty useless.

Fin


  • ShadowTiger, Shane, Jared and 5 others like this

#2 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 14 January 2014 - 12:27 PM

This is a very informative tutorial! Thank you for making it, this will surely help users out. :) In fact, I didn't even think this was possible without scripts, so I know I've learned something from this!


  • Shane likes this

#3 NoeL

NoeL

    Legend

  • Members
  • Real Name:Jerram

Posted 14 January 2014 - 07:43 PM

If there's one thing I hate about the inclusion of scripting it's how quick everyone is to jump to it as the solution for everything. Not that it really matters, but ZC is already capable of doing many of the things people write scripts for (such as this torch mechanism). It's much more rewarding (for me anyway) figuring out how to do something within ZC without resorting to scripting.
  • nicklegends, Shane, strike and 7 others like this

#4 Nimono

Nimono

    Ultra Miyoa Extraordinaire!

  • Members
  • Real Name:Matthew
  • Location:Static Void Kingdom

Posted 15 January 2014 - 12:05 PM

If there's one thing I hate about the inclusion of scripting it's how quick everyone is to jump to it as the solution for everything. Not that it really matters, but ZC is already capable of doing many of the things people write scripts for (such as this torch mechanism). It's much more rewarding (for me anyway) figuring out how to do something within ZC without resorting to scripting.

If I may: I'd love to see you make more tutorials showing people how to make things like this without scripting, that people think are only possible with it. For example, this tutorial makes me wonder if it's possible to make 4 statues you need to strike with a single sword slash without scripts. Could be a good series of sorts!



#5 NoeL

NoeL

    Legend

  • Members
  • Real Name:Jerram

Posted 15 January 2014 - 07:42 PM

If I may: I'd love to see you make more tutorials showing people how to make things like this without scripting, that people think are only possible with it. For example, this tutorial makes me wonder if it's possible to make 4 statues you need to strike with a single sword slash without scripts. Could be a good series of sorts!

Hmm, maybe I'll start up a thread asking for suggestions. Regarding the statues, do you mean hitting them all with a spin attack? That would just be a simple variation on this mechanism - make the statues triggered by the sword rather than a candle and have their "burn time" so short that a spin attack is the only sword move fast enough to get them all within that time.



Also tagged with one or more of these keywords: Tips&Tricks, 2.50

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users