Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(ABANDONED)Need help with "if" functions...
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#5
RE: Need help with "if" functions...

First i have to go through what causes the body of an if statement to be executed. An if statement's purpose is to allow for conditions based on an expression. An if statement triggers when the expression (i.e. what is in the parentheses) evaluates to true. Since AngelScript tends to be picky with variables in the if expression, we have to rely on boolean operators. Boolean operators allow for the expression to return either true or false. However, variables that are already of type bool don't require these operators.

I have no idea what you're trying to do in your script, but it also seems like you don't fully understand how to set and get map variables. By now i would have expected you to understand at least script variables, but it doesn't look like your script illustrates competence in that area either. I think it would be easier if i just refer to you to one of my videos: Script basics. As for map variables, you should only consider setting them when you want them to be saved with the player's progress. Otherwise just stick to script variables.

To get the current value for a map variable you'd use the get functions, like GetLocalVarString, etc. Functions are capable of returning values. You're probably used to void, but the get functions for map variables return a value of the type included in the function name. Therefore when you call that function, you're supposed to store that value in a script variable. For example,
PHP Code: (Select All)
string value GetLocalVarString("map_var_name"); 

As i said before, "&in" is not for if statements; though i should also add they're not for variable declarations either. When a variable does not exist, then you have to declare the variable before you can reference it any where else. The example i gave above is itself a declaration.

Tutorials: From Noob to Pro
(This post was last modified: 11-24-2011, 01:51 AM by Your Computer.)
11-24-2011, 01:51 AM
Website Find


Messages In This Thread
RE: Need help with "if" functions... - by Statyk - 11-24-2011, 12:00 AM
RE: Need help with "if" functions... - by Your Computer - 11-24-2011, 01:51 AM
RE: Need help with "if" functions... - by Statyk - 11-24-2011, 02:17 AM
RE: Need help with "if" functions... - by Statyk - 11-24-2011, 01:45 AM



Users browsing this thread: 1 Guest(s)