So this is a topic on how to make a turn based RPG game. If you don’t know what a turn based RPG is, think Pokémon.
How To Make The Turn Based Parts:
Variables are helpful in turn based because you can set variables to all the different characteristics of your battle(for example a specific move you can use). If you want to make the core turn based part though it is pretty simple. Use a check Once Block and the check if Turn(a variable)=1 (Turn 1 is your turn and Turn 2 is your opponent’s) you can put this inside a when tapped block. For complete reference to Pokémon, When Ember(a move) is tapped Check once if turn=1. Then put whatever you want inside the check Once block. If it was an attack that took away the enemies HP it could be something like this: When Ember Is Tapped Check Once If Turn=1 [Increase Boss HP by -2]
You can do this both ways with the enemy and with yourself.
How To Make A Move That Acts Like Defense System:
This is where it takes a little bit of thought to figure out how to do this because think normally you can’t do this with variables. Or at least 100% accurate. You can make it 99.99% accurate, but using variables it won’t always work. I will show you why. Let’s say whenever you use the move “Defend” a shield pops up. And you want the shield to stay through to the enemies Turn and back to yours. With variables you have to keep repeating to check when your opponent’s turn ends. You have to use repeat and wait Blocks, which means that if under a certain period of time “X”(x would be how much time you put I the wait Block" and it would just keep repeating. Of course, you can’t use repeat forever because hen that conditional can’t do anything else which is bad. Using one conditional makes this easier because setting a variable and then checking for it won’t work properly because it is in the same conditional. So, you have to use a combination of check Once If that check when the variable switches:
Check Once If Turn=1 [Check Once If Turn=2 [Check Once If Turn=1 [Set Invisibility 100%]]]
Since it can’t repeat forever, it has to keep switching between turns. And it has to get through Turn 2 again before it can get back to turn 1, when it disappears.
I know this was me kind of talking about how to make this but a I hope somebody read all of it and now understands how to make one of these games. https://c.gethopscotch.com/p/z3uep4c30
@/POMTL
There’s one part you might think a bit more about though. Regarding the defense shield & using variables, you said:
it won’t always work. I will show you why. Let’s say whenever you use the move “Defend” a shield pops up. And you want the shield to stay through to the enemies Turn and back to yours. With variables you have to keep repeating to check when your opponent’s turn ends.
This can be done elegantly and 100% accurately using variables (without continually checking & without waits). Give it some thought how you might do this by using conditional When rules…
I see both of your points. Final fantasy is what came to mind for me as well when you mentioned “distance” before. However, strictly speaking, the damage isn’t based on distance but rather it’s likely a simple multiplier dependent on the row of the attacker.
Either way, a turned based combat game would be cool on Hoscotch.
@HopscotchRemixer What username & title is your project (linked above) published under? I’d like to check it out. After one of the recent Hopscotch updates, forum links to projects quit working.