So I have created an obstacle that has the following so far:
3 pages:
1st page (very back): Idle on a timer, turn on Self-switch A
2nd page (middle with condition of Self-Switch A on): still idle on a timer, turns on Self-Switch B.
3rd page (Very front with condition of Self-Switch B on): displays some emitting "gas" while on a timer, then both self-switches (A and B ) turn OFF to cycle back to page 1 all over again.
Throughout these events, the priority is below the characters, and the trigger is parallel.
How do I make it to where, on the 3rd page, if the player happens to be touching the event while on this page....the player suffers damage? I feel like it's something to do with the trigger, but I can't quite find a way to check if the player is touching the event during this page.
don't change the pages on a parallel process, especially not if there are dozens of similar events.
you'll need at least two different event.
one event on parallel process controlling all other changing trap events - especially if you have many more of them.
On the trap events themselves, all harmless pages should be action button an doing nothing, while the harmfull pages should be on player touch and have the commands to reduce HP or whatever.
I agree with Andar that it's best to have a master event. That being said, if you want to keep the current config, the best way to do it is to have the event loop several times before deactivating (Yanfly Self-variable or a temporary variable counting down), have each loop wait for less time than it takes for the player to move from one tile to the next, check player position vs the event position every loop, and if they match trigger the damage. Thhhattt being said you're far better off doing the master event idea.
If you want your gas events to have different timing, you could get creative with math to have a single variable control them all with different events active at different numbers e.g. gas event 1 is active when the temp variable is 1-5, gas event 2 is active from 3-8, etc.
there is a script command to change the self-switches of other events.
you'll have to look it up, it's a bit complex because you need to identify the switch by a data sequence, but it will allow you to change the pages by that event's self-switches.
All you need is a variable, you don't need to change switches. Just have a variable labeled "Tempvariable" and lay out the pages such that the variable can easily control the flow. You can reuse the variable elsewhere.
more like variable x:
condition of pages
page 1 = no variable,
page 2 = variable x >= 1
page 3 = variable x >= 2
on page 1, after timer, variable x +=1
on page 2, after timer, variable x +=1
on 3rd page, after timer or attacking animation to damage the player
variable x = 0 (or variable x -= 2 (which is the same, but 0 reset
(which I would do) but the above one works too.
there are more methodes that achieve the same effect, but basicly, you need
2 pages, 1 with timer, 1 for attack and repeat, so why 3 pages?
wait 300
variable X += 1
wait 180
variable x += 1
wait 240
variable x +=1
unless animation change between page 1 (normal), 2 (charge), 3 (fire)
than it's a different story though. otherwise, variable or wait can be simple,
wait 300
wait 180 (or wait 480 in 1x)
than switch page. it depends what the exact event should look like 🙂
Yeah, just to clarify guys:
I have 3 pages because there's 3 different sprites (Well, really 9 but I have stepping on all the time so its fine)
On the 1st page, there's a 5 second wait (300 frames) before the sprite changes.
On the 2nd page, it changes to the "warning" sprite that lasts 2 seconds (120 frames) before giving damage.
On the 3rd page is finally when the obstacle emits the harmful gas for 3 seconds (180 frames) before reverting back to page 1 to start all over again.
Not really sure if that clarifies my goal, but the variable options sounds a bit promising. It's just gonna be a bit tricky to manage if I decide to have...well, more than 1 of said trap.