Hi all. I'm trying to find out the best way to handle a sequence of events. Say things must happen in order, 1, 2, 3, 4, 5. If you do one incorrectly, you're back at one. If you do 1, 2, and 3, and make a mistake you're back at one again. etc. Can you tell me the best way to do this? I'm not new to programming, but I'm new to this program. I know you can use scripts, simple variables, switches, events, etc. Can you tell me what I should look into first to find what I am looking for? Just a point to the correct tutorials will do. Thanks.
Following a sequence of events. [Solved]
RPG Maker MV SupportI've a Project with a Map which does exactly this; I turned it into an autonomous Project to answer this very question from someone else. It can be downloaded from my Google Drive here...
Flame.zip ...
You're welcome to have a look at how I did it (Best way..? Maybe not, but it works well enough..!), without resorting to plug-ins. Feel free to ask any questions about it; hope it helps.
Thanks for the help. I'll check it out and let you know if I have any questions. Really appreciate it.
the best way is to have a variable count up if you do the correct thing and block if you're out of sequence - very easy to do with control variable and conditional branch
Thanks, this is exactly the effect I want. Unfortunately, it's Greek to me. If this were written in C# I could follow it. I appreciate the help and the quick response.
Thanks for the pointer. I know you can use variables in the program, I was hoping this would be the answer. I'll just dig up tuts on how they work with this program. Thanks a bunch.
OK, let's break this down into its essentials first. Here's the gist of what's going on...
We'll start with Flame 1, which is the 3rd from the left. We'll ignore the red globe and look at the Event just below; the Pillar. Double-click will show the code, in a simple, one-page Event...
We start with a test, to see if the Flame is Off (otherwise do nothing; it's already lit...). The key part is the two red lines below (ignore the other stuff...), which turn On a Flame_1 Switch, and sets a Variable Previous_Flame to be '8'. Why '8'..? We'll see in the next Flame Pillar.
The Flame_2 Pillar is that on the far left. Double-click again to see the code, again a simple one-page Event...
Firstly, a test, to see if the Flame_2 is already lit, in which case do nothing (we'll see this in every one, so take it as read...). Now comes the interesting part; another test...
Was the last Pillar to be triggered Flame 1..? We'll know if the Variable has a value of '8'. If that's the case, we're in sequence, and can light Flame_2, and make the Variable take the value '7'. If not, we'll turn Off all of the Flames (whether they're lit or not, they will be once we turn their Switches Off...). We'll put our Variable to 0, and wait...
Touching any Pillar will now be ineffective, as they will all find, when they test in the same manner, that the Variable is 0, and so do nothing. The only Pillar which will react is the Flame_1 Pillar, to start again.
This time, we'll light Flame_1, then, in sequence, Flame_2. The Variable is now with a value '7'. Only one Pillar will give a correct response when testing this value; that's the Pillar for Flame_3, very top right...
Any other Pillar will, just like the Flame_2 one, extinguish all and reset the Variable. The Flame_3 Pillar will be the only one to light Flame_3, then put the Variable to a value of '6'. Can you see a pattern emerging here..? Each Pillar decrements the Variable by 1, and the following Pillar in the sequence tests for this new value. If it's correct, light the Flame and decrement, if not, extinguish all and reset the Variable.
In sum, their is a Switch for each Flame which the Pillar will either turn On, allowing its Flame to light, or all Switches get turned Off and the Variable reset.
That's it in verbal form. All of the rest is just 'gubbins' (a technical term...) for controlling other Events and doing Animations, but don't affect the 'logic' of what's going on, and can be ignored. Does it help at all..?
I have to apologize for putting you through so much work when a few questions might have worked. When I saw Andar's response I knew from seeing tutorials that he was talking about events and I know I could find resources to figure it out.
When I saw your program, I didn't know how to find your events. Now I know what the white border is. 🙂 I downloaded your game and started going through the files. When I saw the json files and the way they were named, I thought you wrote them and that is what I needed to do. Hence the Greek. I shouldn't have a problem applying this in my situation as it's even easier. I'll ask any questions if they come up.
Thanks so much for the help.
Turns out this wasn't the best for my application, but this will definitely come in handy elsewhere as the game is definitely a puzzler.
Good stuff; we'd like to see the results, in time.
Original thread: https://forums.rpgmakerweb.com/threads/following-a-sequence-of-events-solved.65951/