Trigger based on enemy explod and variable change while pause

Started by Shana Fenix, February 08, 2017, 08:44:32 PM

Previous topic - Next topic

Shana Fenix

Hello there!
I am stuck once more.
There's two issues I need help with.

1. I have a mechanic in place that works against certain characters. Aside other triggers I also need it to trigger when the enemy has a certain explod ID out. Now I know that you can check for enemynear,numexplod(666), but I only want it to trigger once each time the explod is out.

and 2. Is there any way to set a variable via -2 even when stuck in the enemy (super)pause? It works completely fine when in an enemy state but not when in an enemy state and paused. Any ideas?

Any help is, as always, very appreciated! o/

altoiddealer

Quote from: Shana Fenix on February 08, 2017, 08:44:32 PM
Hello there!
I am stuck once more.
There's two issues I need help with.

1. I have a mechanic in place that works against certain characters. Aside other triggers I also need it to trigger when the enemy has a certain explod ID out. Now I know that you can check for enemynear,numexplod(666), but I only want it to trigger once each time the explod is out.

and 2. Is there any way to set a variable via -2 even when stuck in the enemy (super)pause? It works completely fine when in an enemy state but not when in an enemy state and paused. Any ideas?

Any help is, as always, very appreciated! o/

1. persistent = 0
Spoiler: or use a var (click to show)

trigger1 = var(10) = 0
trigger1 = enemynear,numexplod(666)
trigger1 = var(10) := 1 ;sets to 1
trigger2 = var(10) = 1
trigger2 = !enemynear,numexplod(666)
trigger2 = var(10) := 0 ;resets var

2. have you used ignorehitpause = 1?


Shana Fenix

Quote from: altoiddealer on February 09, 2017, 12:40:01 AM
1. persistent = 0
Spoiler: or use a var (click to show)

trigger1 = var(10) = 0
trigger1 = enemynear,numexplod(666)
trigger1 = var(10) := 1 ;sets to 1
trigger2 = var(10) = 1
trigger2 = !enemynear,numexplod(666)
trigger2 = var(10) := 0 ;resets var

2. have you used ignorehitpause = 1?

Hmm. The variable way might just work since I need it to trigger multiple times in the same state.
I think this gave me a few good ideas how to work with that.

As for the other problem - yes, I am using ignorehitpause = 1 for that variable change, which is what perplexes me about this.

altoiddealer

1.  So this might be what you're looking for here:

trigger1 = enemynear,numexplod(666) != var(10)
trigger1 = var(10) := Cond(enemynear,numexplod(666) > var(10),enemynear,numexplod(666),0)

Increases var(10) if enemy has more than logged explods.  Resets to 0 otherwise.


Shana Fenix

Hmm! I have used a helper and some variables and it works for now but this seems to be a much easier way I didn't know existed, so thank you!
Gotta try that sometime. Makes for a much more neat code. And much less, too.

That leaves the pause issue, I guess.
I wonder if it's impossible.

Edit: Finally got this to work by making a helper at the start of battle when facing that one certain enemy that counts the variables up to its root when I need it to. It doesn't seem to be affected by the superpause so that's that.
Marking this as solved~
Thanks for the help earlier ;3