Battle Tutorial - Run Event on Skill Use?

esterk

Lovable Rogue
Veteran
Joined
Sep 19, 2017
Messages
174
Reaction score
135
First Language
English
Primarily Uses
RMMV
Hey everyone, I am setting up a battle tutorial in my game to teach players some basics on the system.

However, I want to get a bit complex with it by requiring the player to make certain selections in order to progress it. For example, I want to require the player to use a certain Skill, or use the Guard or Attack command. Doing so would trigger a Show Text event with the foe saying something like 'Good job!'.

It would also be nice if I could get a Show Text event if the player doesn't do it correctly, say if they selected Escape or Item instead, a show text would say something like 'No, that's wrong!' and then let them pick a command again and keep doing this until they selected the correct one.

I can't figure out how to get something like this to run. I figure it may be done via a Common Event but can;t seem to wrap my head around how exactly something like this would get evented.

Any help is much appreciated! :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
So maybe use a variable to keep track of what step you're up to, so you know what the player is meant to do next.
Create a common event and attach it to each skill the player will have at the start of the game, including attack, guard, and any others (same common event for each one).
Then in the damage formula for each one, turn on a switch (different switch for each skill). To do this, you'll need to have the switch first, then add the damage formula. For example, if the default damage formula is a.atk - b.def then you would change it to $gameSwitches.setValue(x, true); a.atk - b.def.
Finally set out your common event to check what step the player is up to (maybe use a label for each one), then to check what was the action taken (based on whether the appropriate switch is on), and respond accordingly. Then do a Jump To Label to go to the end of the common event, and after that turn all the switches off again, and this might also be where you advance the tutorial variable to the next one.
 

esterk

Lovable Rogue
Veteran
Joined
Sep 19, 2017
Messages
174
Reaction score
135
First Language
English
Primarily Uses
RMMV
So I think I understand what you are saying, but the one thing I'm not understanding is the variable you mention at the start. So should I set a variable for each action and have it increase that variable by 1? I'm not sure how the variables come into play here.

Thank you for your response, this is very helpful in trying to set this up :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Use one variable, not one for each action. This is your "tutorial" variable. Increment it at each part of the tutorial, then your common event will know:
- if the variable is 1, the player is supposed to use the Attack skill
- if the variable is 2, the player is supposed to Defend
- if the variable is 3, the player is supposed to use <whatever you give them from the Skills menu>
- if the variable is 4, the player is supposed to use a rock from the items menu

The switches tells you what the player actually did. The variable tells you what they're expected to do. Each time they do something right, increment the variable and tell them what they've got to do next. Each time they do something wrong, also show a message, but don't increment the variable.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,016,998
Members
137,562
Latest member
tamedeathman
Top