I can't seem to find options for trig functions (sin, cos, tan) or for roots or powers. I only see the four basic arithmetic operations (+, -, *, /).
I'm looking to place points in relation to each other using trig functions to find angles made by positions of other points (via X,Y coordinates). Is this possible?
Well I do know that if you go to the trigger edtor window, go under data, and hit view script, you can go into the xml view and type out the commands in there (or my hitting hitting ctrl + f11). I myself have yet to experiment with programming with straight up xml script. It would be difficult however because you would have to look at the patterns and language to properly program with it, BUT, I would recommend reading the following below instead...
Here is the thing, within the trigger editor, integers can support powers, addition, subtraction and the like, what you are thinking you are restricted to (and you are with integers). "Real" numbers on the other hand (decimal place holding numbers) can support sin, cosine, and tangent math operations within the trigger editor, which can be found under math. So in short, you need to use "real" (generally called doubles in programming) variable types, and not "integer" variable types in order to do what you want to do :)
Once you have changed it to "real" variable types, a whole new plethora of mathematical manipulations should be available to use. I guess it makes sense seeing as these operations usually use or spit out decimals in their inputs and outputs. Using those trig functions in the trigger editor would be a bit easier in my opinion, but if you want to use data, then I would continue to fool around with the workaround that one fella was describing in the thread.
Edit: Now that I think of it, since you were most likely using integers, the editor probably would have given you an error if you tried to use that xml script on the integer variables.
i was using real numbers already, that wasn't the problem
i was on the "value" source that only showed the four arithmetic options. i switched over to "function" and i found everything (d'oh) thanks for the help though
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I can't seem to find options for trig functions (sin, cos, tan) or for roots or powers. I only see the four basic arithmetic operations (+, -, *, /).
I'm looking to place points in relation to each other using trig functions to find angles made by positions of other points (via X,Y coordinates). Is this possible?
I wanted to know because there is a way I could use this as a workaround for my other topic: http://www.sc2mapster.com/forums/development/data/70692-need-help-with-visuals-actors-data-for-custom-ghost/#p7
i found some scripts on sc2mapster but i have no clue what to do with these
-<li><a href="/galaxy/triggers/square-root/">Square Root</a> - Returns the square root of a number</li>
<li><a href="/galaxy/triggers/sine/">Sine</a> - Returns the sine of an angle</li>
<li><a href="/galaxy/triggers/cosine/">Cosine</a> - Returns the cosine of an angle</li>
<li><a href="/galaxy/triggers/tangent/">Tangent</a> - Returns the tangent of an angle</li>
<li><a href="/galaxy/triggers/power/">Power</a> - Returns a value raised to a given power or exponent</li>
-i have only worked with the trigger shell menus, never with the actual XML script. anyone know how i use these in the trigger editor?
@Chyvelle1: Go
Well I do know that if you go to the trigger edtor window, go under data, and hit view script, you can go into the xml view and type out the commands in there (or my hitting hitting ctrl + f11). I myself have yet to experiment with programming with straight up xml script. It would be difficult however because you would have to look at the patterns and language to properly program with it, BUT, I would recommend reading the following below instead...
Here is the thing, within the trigger editor, integers can support powers, addition, subtraction and the like, what you are thinking you are restricted to (and you are with integers). "Real" numbers on the other hand (decimal place holding numbers) can support sin, cosine, and tangent math operations within the trigger editor, which can be found under math. So in short, you need to use "real" (generally called doubles in programming) variable types, and not "integer" variable types in order to do what you want to do :)
Once you have changed it to "real" variable types, a whole new plethora of mathematical manipulations should be available to use. I guess it makes sense seeing as these operations usually use or spit out decimals in their inputs and outputs. Using those trig functions in the trigger editor would be a bit easier in my opinion, but if you want to use data, then I would continue to fool around with the workaround that one fella was describing in the thread.
Edit: Now that I think of it, since you were most likely using integers, the editor probably would have given you an error if you tried to use that xml script on the integer variables.
Hope that helps a ton! :D
@joecab: Go
i was using real numbers already, that wasn't the problem
i was on the "value" source that only showed the four arithmetic options. i switched over to "function" and i found everything (d'oh) thanks for the help though