Creating candles that go out after walking x number of steps

Hello! So I have a current setup where the Player has a lantern, and can use candles as an item to light her lantern. I have it set up as a common event that's triggered whenever you consume the candle item:

1739261185113.png


This is how I have the common event set up.

1739261554376.png


It works. I'm using VisuStella's Lighting FX plugin to create a radial light around the character whenever this common event is triggered.

1739261624134.png


However, I want to make it so this plugin fx disables itself after the Player takes X number of steps after consuming the candle item. There's an option in the plugin command to disable the effect, so that part is easy enough.

Let's say for example, after using a candle, the radial light turns off after 15 steps are taken after the item has been used. I've tried a lot of different ways to set this up, but none of them have worked. I'm having difficulty calling up the number of steps AND triggering the plugin fx to be disabled once steps + 15 steps takes place. I think pushing this all through a Common Event is also confusing me. Please help!
If using a candle activates that common event, then why do you have inside the common event an if/else branch for if you have candles? If you don't have candles, you can't use the candle item to call the common event? Also, the trigger shouldn't be parallel, set the trigger to 'none'. Also in the common event control a variable (name "steps start") to game data: steps + turn on your switch called 'lantern on'.

Then make another common event (lantern timing). That one is set to parallel and switch 'lantern on'.
In this second common event you control another variable (name "steps total") to game data: steps. Then you need to subtract the variables: 'steps total' - 'steps start' and check in a conditional branch if that is greater or equal to 15 -> use plugin command to turn off light + turn off the switch 'lantern on'.
If using a candle activates that common event, then why do you have inside the common event an if/else branch for if you have candles? If you don't have candles, you can't use the candle item to call the common event?
Good question 😅 I figured I should have the character complain about not having enough candles if you run out and try to use them, but I guess that's pretty unnecessary lol

Also, the trigger shouldn't be parallel, set the trigger to 'none'. Also in the common event control a variable (name "steps start") to game data: steps + turn on your switch called 'lantern on'.

Then make another common event (lantern timing). That one is set to parallel and switch 'lantern on'.
In this second common event you control another variable (name "steps total") to game data: steps. Then you need to subtract the variables: 'steps total' - 'steps start' and check in a conditional branch if that is greater or equal to 15 -> use plugin command to turn off light + turn off the switch 'lantern on'.
Ahh I got it working!! Thank you so much.

Original thread: https://forums.rpgmakerweb.com/threads/creating-candles-that-go-out-after-walking-x-number-of-steps.175355/