IF command with multiple variables

This forum is meant for posting anything related to Adventure Maker that doesn't fit in the other forums.Please post technical questions in the Technical Support Forum!

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

IF command with multiple variables

Postby Softstar » Thu Jun 26, 2008 5:23 am

Hi,

I'm trying to make a script where it checks the values of multiple variables and then does sometime if they are all the correct value.

How would I go about doing that?

Thanks.
Softstar
Junior Member
 
Posts: 11
Joined: Wed Dec 26, 2007 11:46 pm

Postby Mystery » Sat Jun 28, 2008 3:35 am

I would say it depends on what exactly you want to check.
What values can those variables have? Just 0 or 1, or even other values?

If all variables should have the value 1, you can simply use something like this (of course you need to enter what action should happen):

Code: Select all
If variable1 + variable2 + variable3 + variable4 = 4 Then
   Action.GoToFrame "Frame_Name"
Else
   Action.GoToFrame "Frame_Name"
End If


If it's more complex, and variables have to have different values, you could use something like this:

Code: Select all
If variable1 + variable2 + variable3 + variable4 = 4 and variable5 + variable6 = 0 Then
   Action.GoToFrame "Frame_Name"
Else
   Action.GoToFrame "Frame_Name"
End If


Maybe this already helps you, otherwise post your question again providing more details about the variable values :)
User avatar
Mystery
Forum Admin and Games Page admin
 
Posts: 2990
Joined: Sat Feb 04, 2006 8:12 am
Location: Switzerland


Return to Adventure Maker General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests