you need to know which player’s tun it is. Put that information somewhere, maybe a scene variable. Decide how you want to switch the turns (time triggered, event triggered) and modify that variable accordingly
one player will hurt the other player if some event happens (keyboard, mouse, joystck, …).
Add another condition that it must be this player’s turn
Probably you also want to add this condition to the player move functions, so the inactive player can neither attack nor flee
Maybe I am wrong with 3. Let me explain what I was thinking of:
I did assume you use GDevelop, which can continuously update and render multiple players and their world while limiting it to a turn-based game.
With that I further assume a player can do different things (like walk, attack, or defend). If you only allowed attacks to happen when it is a player’s turn, would that imply that other players can still walk and defend although it is not their turn? Or would you like to limit those to be available only to the active player?
In my mind I see a turn based game in which characters can only attack when it is their turn but can run away anytime. How would then an attack ever have effect? As you may have thought about it and also may have solved that issue, in point 3 I said ‘probably you also want…’.
well it’s an undertale fangame, and in undertale the fights are turn based, where in your turn you can FIGHT, ACT, use an ITEM or FLEE (unless your in specific conditions where you can also spare), and in the enemy’s turn you need to dodge bullets. i did that but removed the ITEM, ACT and MERCY (which is flee and spare), and when i tried to apply the FIGHT option (which is a button on the screen that you need to press to attack), the button was supposed to disappear when it’s the enemy’s turn, but it only disappeared on the first enemy turn, and stayed on the rest. that’s why i posted the question on the forum. hope that gave you a bigger picture of what am i working on.
Thank you for that context. I never played undertale games at all. In fact I was never keen on turn based games. My domain was more RTS, where both players can act simultaneously.
But your button visibility problem should be easy to fix. If you know when it is the player’s turn you make them visible, and when it is some non player character’s turn you hide them. Or is that too easy?
I get the feeling your confusion is not related to GDevelop, although the way you have to enter your events and actions may be distracting. Therefore I suggest to take a pen and paper and write down what you want to implement, then try again on GDevelop.
The clearer your idea of the problem and it’s solution is the less you confuse what you enter in GDevelop.
i did, and i think i got a basic idea of what that could be. i think that somewhere in the lines of my events i made an event that makes the GDevelop think that i want it to change the player turn variable only once, something like the “trigger once” condition. so perhaps you can tell what could cause it to think that?
ok, i hope i did it right. but if you could try to only help with the player turn problem, i know it is a bit annoying to ask something like that, i just want to be able to still understand at least the majority of my events
umm… is everything ok? it seems like your’e online but don’t check on my topic… can you at least say something so i know you are actually seeing my replies??
In the analytics of itch.io I can see there are many visits to the game profile coming from the GDevelop forum.
In fact, I just clicked the link that leads to the game page and immediately took me to… well, the game page, where the game starts automatically, and where you can download the game source files.