Hi there,
I only recently started using ZGameEditor and I have to say it's impressive. I went through all the tutorials, made some changes to the game made in Tut3 to learn a bit more. At one point I found out that I needed to check which Appstate the game was in and couldn't find the variable which would tell me that. I eventually had each state set a variable onLoad so that I could check later, but I'm wondering, is there any way to reach a native variable which would tell me what state the application is in?
Thanks,
Yilmaz
Appstate
Moderator: Moderators
Hi and welcome to these forums, Yilmaz!
You are correct there is no variable that can be tested for which appstate is currently active. This is a limitation to the expression system which only deals with numerical variables. The workaround is to set a variable in each appstate.onStart as you already found out. Also try to keep state-specific logic in that appstates onUpdate for minimizing the need for checking which state is active in other code.
Regards,
Ville
You are correct there is no variable that can be tested for which appstate is currently active. This is a limitation to the expression system which only deals with numerical variables. The workaround is to set a variable in each appstate.onStart as you already found out. Also try to keep state-specific logic in that appstates onUpdate for minimizing the need for checking which state is active in other code.
Regards,
Ville