I have a good understanding of how to use variables / float variables and how they work, but there is a tiny piece of coding that I don't get....[mcode]:=[/mcode]WHAT IS THIS THING? ???I have read that it is very useful and a great time saver, but I don't have the slightest idea of how it works...Please explain what it is and how I should decide whether to use it or variables.And if it is at all related to the IfElse trigger, please explain.Spoiler, click to toggle visibiltyI may have confused := as a shortcut for variables, when it was actually a shortcut for IfElse in the 1st place. I don't know which... [/center]
From the docs (exp.html):Quote:=The assignment operator. An unredirected variable name (var(n) or fvar(n) for suitable values of n) must appear on the left-hand side. If the left-hand side contains an integer variable, then the right-hand side is truncated to an integer before assignment. If the left-hand side contains a float variable, then the right-hand side is converted to float if necessary before assignment. In both cases, the value of the expression is the value that is assigned to the variable.In other words var(X) := Y, will give variable X the value Y.It can save you some (Var) controllers. A simple example:[mcode][State -2, Total Hittime]type = VarAddtrigger1 = p2movetype = Htrigger2 = var(20):=0var(20) = 1ignorehitpause = 1[/mcode]As long as p2movetype = H is true, this will add 1 to var(20). But if it is false, the second trigger will be checked and var(20) will then be set back to 0. So you dont need an extra VarSet controller to reset the variable.