How do I get a persisting on/off or yes/no variable?
Hello! I want a very simple variable that records if an event has happened. What I want to do is use this for quests and have it persist between scenes. For example.... has the player discovered the clue about the dead miners? If yes, then a dialogue tree will become available with an NPC. If not, the dialogue remains hidden. Any ideas how to do this?
To cover some of the bases, yes I always make sure the spelling and capitalization of variables are the same and I use them saved as an "effect" to stamp it in my scene and eliminate human error.
I also have successfully used number variables with the "get" and "add" modifiers to track a player's obtained currency, and had it persist throughout all of my scenes.
I just need to know how to make the variable something more of an on/off toggle rather than a number gatherer.
Thanks in advance for your help!
-
Could you use a "0" for a no and a "1" for a yes?
Pablo -
I'm not really sure.... How would I use gadgets in a way that would translate the 0 to a no and 1 for a yes? I need to get it to where dialogue prompts only appear after the player completes an event in another scene. The reason I am trying to use variables is because I know of no other gadget that persists in dreams between scenes.
-
Hey,
As Pablo says, the way to do this is to use the number value.
It starts at 0, so this would be your "no" state. When the variable is zero, the player hasn't completed the event in the other scene. If you plug the value of this variable into the power of your dialogue prompts, it will set their power to zero, so they'll be disabled.
Then, when the player completes the event, you set it to 1. Now, anything that variable is wired into will get a positive signal -- if you wire it into the power of your dialogue logic then it will turn on, because the player completed the event.
Hope that helps :)
- Liam
Iniciar sesión para dejar un comentario.