It really depends on what you are trying to do. because the editor is so open the possibilities are endless. I can give you only a single example that our group is working on where math functions have been useful. In this example we needed triggers to accomplish some aspects of this ability but we needed the actions to take place where the user clicked for the spell to occur, but to happen only after a "Missile" had flown to that spot. We are able to find this time via math!
As you might guess we have no idea how long it will take our missile to hit the target point by just guessing. Since there is a major unknown that could change from each use, which is the distance from the caster location (where our missile appears) and then where our target point is (where the missile is going to impact). From the trigger you can see we need 2 units appear at the target source when our missile impacts that spot. Our solution was in our use "Distance" Variable in the "Wait" Action. To find the appropriate amount of time we had to take the missile speed (in our case we had set the mover to a max speed of 20) and divide that by the "Distance" Variable (which is our distance because it can vary from cast to cast).
Anyway this is a very simple function of the math available in the editor frankly there are far more complex computations within the editor. My suggestion if you aren't familiar with some of these math equations is to study up. Going to any number of math websites (google is your friend) and reading up on them will help. Once you are familiar with how these math equations work you will be able to find many uses for them. Hopefully our team's example is helpful in revealing just how numerous the possibilities are. If you have more questions you can either PM me or post here.
the end point is easy to find, but that's not what our goal was, it was to have these units appear when the missile hits the ending point, that's a time issue not a location issue.
If your saying there is an easier way to find out the distance between where the caster is and the target point, I just don't see how cause both are necessary in order do the wait time calculation.
Basically the max range of the spell is 7 but if someone casts it from a range of 3 the distance between the target point and caster change. we needed a variable to calculate that number because it would change every time the spell is cast.
Here is a video for all to see so you can get a visual idea of what we needed it may clear up some questions. Brotherlaz I'm not 100% sure but fairly positive we played around with how to do this idea and this seemed like the best way.
Does anyone know of a tutorial where it can teach me the usefulness of each math function?
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
It really depends on what you are trying to do. because the editor is so open the possibilities are endless. I can give you only a single example that our group is working on where math functions have been useful. In this example we needed triggers to accomplish some aspects of this ability but we needed the actions to take place where the user clicked for the spell to occur, but to happen only after a "Missile" had flown to that spot. We are able to find this time via math!
As you might guess we have no idea how long it will take our missile to hit the target point by just guessing. Since there is a major unknown that could change from each use, which is the distance from the caster location (where our missile appears) and then where our target point is (where the missile is going to impact). From the trigger you can see we need 2 units appear at the target source when our missile impacts that spot. Our solution was in our use "Distance" Variable in the "Wait" Action. To find the appropriate amount of time we had to take the missile speed (in our case we had set the mover to a max speed of 20) and divide that by the "Distance" Variable (which is our distance because it can vary from cast to cast).
Anyway this is a very simple function of the math available in the editor frankly there are far more complex computations within the editor. My suggestion if you aren't familiar with some of these math equations is to study up. Going to any number of math websites (google is your friend) and reading up on them will help. Once you are familiar with how these math equations work you will be able to find many uses for them. Hopefully our team's example is helpful in revealing just how numerous the possibilities are. If you have more questions you can either PM me or post here.
I think there's a more accurate way to find the ending point.
But anyway, you can also set the Unit 1/2 and other variables to Local Variable, so you don't take too much space in the actions area.
Member since 2010. Made the -The Thing- [Revival] game. Nostalgic of the WC3 days.
the end point is easy to find, but that's not what our goal was, it was to have these units appear when the missile hits the ending point, that's a time issue not a location issue.
If your saying there is an easier way to find out the distance between where the caster is and the target point, I just don't see how cause both are necessary in order do the wait time calculation. Basically the max range of the spell is 7 but if someone casts it from a range of 3 the distance between the target point and caster change. we needed a variable to calculate that number because it would change every time the spell is cast.
I wonder why not make the missile produce an effect on impact, and look for this effect instead?
Here is a video for all to see so you can get a visual idea of what we needed it may clear up some questions. Brotherlaz I'm not 100% sure but fairly positive we played around with how to do this idea and this seemed like the best way.