Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

If then else eventing with a randomized variable.

Bishiba

Villager
Xy$
0.00
Hello!

I have a question about how to make something a bit easier to handle.

When talking to an NPC, a common event is called, let's call this event "TALK".

And this event looks like this:

Code:
Control Variable: "Randomizer" = Random number between 0-15

If->"Randomizer" = "0"
Then:
Show text: Hello!
Else:
          If->"Randomizer" = "1"
          Then: Show Text: Hi!
          Else:
                    If->"Randomizer" = "2"
                    Then: Show text: Sup brah!?
                    Else:
Etc. all the way up to Randomizer 14.

Is there no way to just make a code like this instead:

Code:
Control Variable: "Randomizer" = Random number between 0-15

If "Randomizer" = "0"
Show text: Hello!
If "Randomizer" = "1"
Show text: Hi!
If "Randomizer" = "2"
Show text: Sup brah!?
If this is possible, that would be great!

Thanks in advance for any discussion or aid in the matter!
 
Top