Looked around and couldn't seem to find an answer to this one. When the player walks onto a region tile, the conditional branch will immediately start firing off even if the player is just standing there. I'd like to have it so if the player is moving in the region tiles area, that's when it fires off. Similar to Pokémon games when you walk through the grass. In Pokémon, if you are just standing in the grass, nothing happens, but when you start walking through it, you have a chance of encountering a mon. How can I achieve something like this?
How to have Region ID conditions to only fire off while moving? (SOLVED)
RPG Maker MV SupportHiya!
While I'm unsure how it may react in this particular case, you could try putting that conditional branch inside another conditional branch which has a script as its condition with the following:
This in theory will check to ensure you're moving and only run the other conditional branch if that's the case but I haven't tested myself yet to see how reliable it might be.
Otherwise, a more dedicated plugin that handles common events upon entering into regions may be a more optimal solution!
Edit: I just quickly tested it and I believe this should work the way you were describing!
While I'm unsure how it may react in this particular case, you could try putting that conditional branch inside another conditional branch which has a script as its condition with the following:
Code:
$gamePlayer.isMoving()
This in theory will check to ensure you're moving and only run the other conditional branch if that's the case but I haven't tested myself yet to see how reliable it might be.
Otherwise, a more dedicated plugin that handles common events upon entering into regions may be a more optimal solution!
Edit: I just quickly tested it and I believe this should work the way you were describing!
If you want, I could make you a plugin that triggers a common event each time the player takes a step on the right region(s).
I'm quite new to the whole plugin market, but this seems very similar to something I tried before, so I am positive I can do it.
I'm quite new to the whole plugin market, but this seems very similar to something I tried before, so I am positive I can do it.
Thank you, I'll give this a try!
I've just tested and unfortunately, it's causing it to fire off instantly over and over again. Could you provide an example of how you used it?
Hiya!
In this example when you walk into region 2, it triggers when you're moving and not when you're standing still.
Thanks! I got that part working now, but I am having an issue now of all battles firing off after each other. I've tried using an else branch but that didn't help. What am I doing wrong?
Ah, it looks like you need to use the Exit Event Processing command after each one of those results' battles, otherwise depending on the number rolled it's just going to keep checking down the line.
So say the RNG was a 2. It would indeed both be lower than 19 and 9 so it'll keep running down without that.
You'd need to reverse the order too so it goes lowest RNG and up, otherwise the lowest ones will never be triggered.
For example, if you rolled an 8, it'll never be able to check the 9 or lower one, because it'll always hit the 19 and lower first.
So say the RNG was a 2. It would indeed both be lower than 19 and 9 so it'll keep running down without that.
You'd need to reverse the order too so it goes lowest RNG and up, otherwise the lowest ones will never be triggered.
For example, if you rolled an 8, it'll never be able to check the 9 or lower one, because it'll always hit the 19 and lower first.
Thanks, I did some revisions to the numbers in general and it's working much better now. I increased the RNG to 1-230 and lowered the RNG for the battle triggers so it's not happening every other step or so. Seems to be a decent balance for the time being, at least with two monsters so far. That "is player moving" script is a real game changer though!
You know a condition can have an "If else" statement?
Look at the left bottom corner:
Now it can be set up like this:
The way you have set it up, it runs multiple times, because if the var is 3, it is smaller than 9, but also smaller than 19.
Look at the left bottom corner:
Now it can be set up like this:
The way you have set it up, it runs multiple times, because if the var is 3, it is smaller than 9, but also smaller than 19.
yes.
that's what happens when you set the event to parallel: it checks at every tick of [the huge loop that is the top-most structure that updates the scene]
the game's own programming is already updating things in "parallel".
you don't need to set another check: you just need a way to tap into that loop.
It's quite simple.
All you need to do is to keep comparing 2 variables for a single trigger in a parallel event.
Have one variable keep checking the player's region ID
The other one will only update if you are in a different region ID
So as long as
You don't need to check if the character is moving because the only way these variables may change is by moving your player.
Including having your player moved by event, so you might have to be careful with that.
Works wonder.
All you need to do is to keep comparing 2 variables for a single trigger in a parallel event.
Have one variable keep checking the player's region ID
Current Region ID.The other one will only update if you are in a different region ID
Last Region ID.So as long as
Last Region ID == Current Region ID it won't trigger.You don't need to check if the character is moving because the only way these variables may change is by moving your player.
Including having your player moved by event, so you might have to be careful with that.
Works wonder.
Original thread: https://forums.rpgmakerweb.com/threads/how-to-have-region-id-conditions-to-only-fire-off-while-moving-solved.168511/