• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • The Eevee Expo Game Jam has concluded! 🎉 Head on over to the game jam forum to play through the games.
    Don't forget to come back September 21st to vote for your favorites!
  • Reminder: AI-generated content is not allowed on the forums per the Rules and Regulations. Please contact us if you have any questions!

Idea How do I check if it's the player's turn during a battle in a script?

Laiffoo

Rookie
Member
Joined
Dec 29, 2024
Posts
6
The title is pretty self-explanatory, but as I mentioned in a previous post, I am working on a new battle mechanic that uses items called "Wisps," each with different abilities. I have managed to set up a UI in battle and even create a script that makes the mechanic work.

However, one issue remains: the UI stays visible for the entire battle, even after the player has finished choosing a move. I’m not sure how to fix this, since I can’t find any examples of how to check if it’s currently the player’s turn. This obviously becomes an issue because the player can toggle the Wisp on and off after the player's turn.

Thanks for any help!
 
T
The title is pretty self-explanatory, but as I mentioned in a previous post, I am working on a new battle mechanic that uses items called "Wisps," each with different abilities. I have managed to set up a UI in battle and even create a script that makes the mechanic work.

However, one issue remains: the UI stays visible for the entire battle, even after the player has finished choosing a move. I’m not sure how to fix this, since I can’t find any examples of how to check if it’s currently the player’s turn. This obviously becomes an issue because the player can toggle the Wisp on and off after the player's turn.

Thanks for any help!
I feel like you're not really using the correct terminology here, as there isn't really any such thing as the "player's turn."

Battles take place in phases. There's the Command Phase, where all trainers lock in their decisions; then comes the Attack Phase, where each Pokemon on the field performs their action based on priority/speed; and then there's the End Phase, where all end-of-round effects take place and various conditions are reset.

What you seem to want to do is implement a UI that is displayed during the Command Phase, and hidden during all subsequent phases. So, I would imagine that this UI should be something that is built directly into the Fight menu UI. However, it sounds like you just built it into the general Battle UI instead, so it displays at all times during the battle. So, my advice would be to make this custom UI specifically something that is designed into the Fight Menu itself (like the Mega Evolution toggle).
 
Back
Top