How to manage free moving and battle state

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By RichmondGames

Hello,
I’m struggling to find how to change the game state with a signal. Or is there a better way?

I have a player character that I want to move freely till an enemy detects them. Then it should become turn based. Much like Fallout 1 or 2. The scene doesn’t change, just the state of the players and NPCs.

Currently I have a player that moves, and enemies that roam freely. They can detect the player individually… but whats the best way to change everyones state? Or am I going about this wrong?

:bust_in_silhouette: Reply From: zen3001

I’m no expert but the way I would do it is putting all the combat participants in an array in an autoload, have a function in the autoload that changes that state of all nodes in the array and since it’s an autoload you can pretty much call that function from where ever you want. from the player or one of the character.