This is probably rather stupid (I'm probably just missing something obvious) but how do you go about easily adding multiple variables (integers) together? I know you can continue to add the addition function but it ends up being nested [i.e. (((1+1)+1)+1)]. What I want is (1+1+1+1).
Simply say X = (custom script) 1 + 1 + 1 + 1 instead of using the GUI function. You don't have to convert your entire trigger to custom just set the value of whatever your trying to set the value of to a custom script instead of a GUI function (all GUI is compiled into custom script anyway). If you don't know how to do it its quite simple just set any integer value and then you will see several check boxes that are things like a value (just a simple value), variable, function or custom script. Simple chose custom script instead of function.
Is there an easy way to do it when what I'm adding together is a number of variables (the variables themselves are always integer values). And how does the arithmetic(multiple) work exactly, maybe I'm not understanding it correctly.
Just for clarification what I want to do is this: Set X = Value 1 + Value 2 + Value 3 + Value 4 (where Value # is a variable with a set integer value). As well, I'd prefer to use the GUI.
My way you wouldent actualy use custom script in any major way (just 1 line) just create a normal GUI variable and set it to equal custum script then for the custom script enter lets say those 4 integer variables are z, y, a, and b just type z + y +a +b pretty simple (and you can write the rest of your trigger in normal GUI no need to actually learn script. IMO GUI is very nice but sometimes its easier just to use script which is why blizz gave us the ability to easily convert between the two using the GUI interface. You could do it with the arithmetic(multiple) function I would imagine but iv never used it. If you want I can upload an example map its actually very simple and very fast to write this way.
Here it is with custom script. I tried to make it with the Arithmetic(multiple) function to show you both ways but it had weird syntax so I didn't bother.
Hope it helps
This is probably rather stupid (I'm probably just missing something obvious) but how do you go about easily adding multiple variables (integers) together? I know you can continue to add the addition function but it ends up being nested [i.e. (((1+1)+1)+1)]. What I want is (1+1+1+1).
Thanks.
Simply say X = (custom script) 1 + 1 + 1 + 1 instead of using the GUI function. You don't have to convert your entire trigger to custom just set the value of whatever your trying to set the value of to a custom script instead of a GUI function (all GUI is compiled into custom script anyway). If you don't know how to do it its quite simple just set any integer value and then you will see several check boxes that are things like a value (just a simple value), variable, function or custom script. Simple chose custom script instead of function.
Hope that helps
@zanethanatos: Go
There is also an arithmetic(multiple) function that does this.
Is there an easy way to do it when what I'm adding together is a number of variables (the variables themselves are always integer values). And how does the arithmetic(multiple) work exactly, maybe I'm not understanding it correctly.
Just for clarification what I want to do is this: Set X = Value 1 + Value 2 + Value 3 + Value 4 (where Value # is a variable with a set integer value). As well, I'd prefer to use the GUI.
My way you wouldent actualy use custom script in any major way (just 1 line) just create a normal GUI variable and set it to equal custum script then for the custom script enter lets say those 4 integer variables are z, y, a, and b just type z + y +a +b pretty simple (and you can write the rest of your trigger in normal GUI no need to actually learn script. IMO GUI is very nice but sometimes its easier just to use script which is why blizz gave us the ability to easily convert between the two using the GUI interface. You could do it with the arithmetic(multiple) function I would imagine but iv never used it. If you want I can upload an example map its actually very simple and very fast to write this way.
Hope that helps
Upload away if you wouldn't mind, just need to see an example to use it right I think.
Here it is with custom script. I tried to make it with the Arithmetic(multiple) function to show you both ways but it had weird syntax so I didn't bother. Hope it helps
Mucho Gracias