| 04-23-2007, 05:03 PM | #1 |
I have a trigger with the functions like so: Trigger: Environment - Create a 0.90 second wave deformation from Position1 to Position2 with radius 100.00, depth -96.00, and a 0.00 second trailing delayThis moves a wave across the ground where the ground looks like it is bubbling up. The distance between the two positions is varied. my problem is I would like to trigger damage and special effects on any units that happen to be at or around the crest/top of the hill that is made and i dont know how to track this since the distance can be further or shorter depending on how far the points are from eachother... and when they are farther the wave moves faster so that it guarantees that it always finishes at 0.90 seconds. thx for your time. |
| 04-23-2007, 07:35 PM | #2 |
Well, we can use the simple formula D=R*T for this. D = distance, R = rate, T = time. You know that the time will always be 0.90 seconds, and if you know Position1 and Position2 you know the distance. The thing to solve for here is the rate. Now we solve for R: R = D/T Let's assume that the distance is 100.00: R = 100/.9 R = 111.111...; so it will move Approximately 111.1 units per second. Then (assuming you're using a dummy unit to do the damage) multiply that by the interval of your repeating timer (let's say that it runs every 0.05 seconds): 111.1*0.05 = 5.55 Thus, you would want to move your dummy unit 5.55 distance every time the timer runs. To go about this, I would suggest that you create a global variable that stores this value (after deriving it) to a global variable, which you then reference in your timer. If you want to trigger all of your effects and damage without using a dummy unit, here's what you could do (still using a repeating timer): Every time the trigger runs, set a point variable equal to TheOriginatingPoint offset by (TheDistanceInterval [5.55 in the above example] * NumberOfTimesTheTimerHasRun) towards (TheAngleBetweenPosition1AndPosition2 degrees). Trigger: Set DamagePoint = OriginatingPoint offset by (5.55*TimerCounter) towards 37.9543 degreesThen, set a unit group equal to the units within (I would assume 100.00 since that's your deformation radius) [you could also use a region/rect, but that would require JASS], pick every unit in it, and do your damage/sfx to/on it. Additionally, you would need to add each unit to a unit-group that would contain each unit that has been affected. When the above step (damage/sfx) is performed, make sure that that unit group only contains units that aren't in the big group. This ensures that no unit is damaged twice by the spell. I hope you get the gist of what I'm saying here. If you need more help, just ask. |
| 04-23-2007, 07:56 PM | #3 | |
Quote:
D = RT? |
| 04-23-2007, 11:25 PM | #4 |
I realized that RIGHT after I walked to my next class. Dumb. Fix'd the above post. |
