Saturday, April 21, 2012

Leveling Ability/trigger help

Ok, i'm making an ability where you use the ability on a ground point and trigger's make 2 lava spawns with activated immolation and tell them to move to this point, they dissapear when they hit that point, but i do not know how to set it up so their's more and stronger lava spawns when you level the ability, here's my current two triggers


Code:
Unit - A unit Begins casting an ability

(Ability being cast) Equal to Fire Storm NEWEST

Set Firestormpointmove = (Target point of ability being cast)
Set Firestormcasterpoint = (Position of (Casting unit))
Wait 0.05 seconds
Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Casting unit)) at Firestormcasterpoint facing Default building facing degrees
Set FirestormMovingFire[1] = (Last created unit)
Wait 0.01 seconds
Unit - Order (Last created unit) to Move To Firestormpointmove
Unit - Create 1 Lava Spawn (Level 1) for (Owner of (Casting unit)) at Firestormcasterpoint facing Default building facing degrees
Set FirestormMovingFire[2] = (Last created unit)
Wait 0.01 seconds
Unit - Order (Last created unit) to Move To Firestormpointmove

One above for creating the units and ordering them to move


Code:
Unit - A unit Is issued an order targeting a point

Or - Any (Conditions) are true
Conditions
FirestormMovingFire[1] Equal to (Ordered unit)
FirestormMovingFire[2] Equal to (Ordered unit)
FirestormMovingFire[3] Equal to (Ordered unit)
FirestormMovingFire[4] Equal to (Ordered unit)
FirestormMovingFire[5] Equal to (Ordered unit)

Wait 4.00 seconds
Unit - Kill (Ordered unit)

and thats the one to kill them when they arrive at the point.

also: the cast range is 600 and the lava spawn move speed is 260|||If you want timing that is accurate to fractions of a second, Wait commands won't work well. You'll need to use timers or periodic time events.

Anyway, instead of creating a unit type variable named "Lava Dude (level 1)", Lava Dude (level 2), etc., you could create an array, where Lava_Dude[1] is the first level, and Lava_Dude[2] is the second level, etc.. Then, when you spawn your unit, you can do it like "create Lava_Dude[Level of ability being cast]", and that will automatically pick the one you want as the ability's level increases.

You could also do the same thing with the amount of units that are being created. "Create (level of ability being cast) units...".|||Quote:






View Post

If you want timing that is accurate to fractions of a second, Wait commands won't work well. You'll need to use timers or periodic time events.

Anyway, instead of creating a unit type variable named "Lava Dude (level 1)", Lava Dude (level 2), etc., you could create an array, where Lava_Dude[1] is the first level, and Lava_Dude[2] is the second level, etc.. Then, when you spawn your unit, you can do it like "create Lava_Dude[Level of ability being cast]", and that will automatically pick the one you want as the ability's level increases.

You could also do the same thing with the amount of units that are being created. "Create (level of ability being cast) units...".




Thank you, I'll have to try and test it, actually I really didn't know you could like sync the variables and triggers to that extent...but I've really only recently started using variables [I used to have long and pointless triggers that were shortened dramatically by variables.|||Quote:






View Post

If you want timing that is accurate to fractions of a second, Wait commands won't work well. You'll need to use timers or periodic time events.




Actually, the way i've changed it, when the lava guys get to the point, they have about 1 second of free time before they dissapear inless i do the maximun cast range [800]

How would i make it so the range i cast it is how long the lava guys would last?|||Again, if the range increases with the ability's level, you could use that number to determine the amount of time till expiration. To do that, you could either make a variable array, such as Life_Time[], and use that in a similar manner as I described earlier, or you could do some math, like ((level of ability being cast) x 0.5) seconds.

Either way, I think it will be a lot easier if you were to simply add an expiration timer to each unit right after it is created. That way it will be automatically killed after the specified duration, and you can avoid having to fool with that second trigger.

No comments:

Post a Comment