Warcraft III resources & community, 2003–2006 · archived

Dummy problems

6 posts
#1

Dummy problems

what is wrong with my code? and soul beam is frost beam and the casting spell and a blank War stomp with a stun that takes 1 sec to cast.


Spirit Release
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Voodoo Spirit Release.
Actions
Unit - Create 1 Spirit (Dummy) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 0.00 degrees
Unit - Add Soul Beam to (Last created unit)
Unit - Set level of Soul Beam for (Last created unit) to (Level of Voodoo Spirit Release. for (Triggering unit))
Unit - Order (Last created unit) to Neutral - Breath Of Frost (Position of (Last created unit))
Unit - Make (Last created unit) face 45.00 over 0.00 seconds
Unit - Order (Last created unit) to Neutral - Breath Of Frost (Position of (Last created unit))
Unit - Make (Last created unit) face 90.00 over 0.00 seconds
Unit - Order (Last created unit) to Neutral - Breath Of Frost (Position of (Last created unit))
Unit - Make (Last created unit) face 135.00 over 0.00 seconds
Unit - Order (Last created unit) to Neutral - Breath Of Frost (Position of (Last created unit))
Unit - Make (Last created unit) face 180.00 over 0.00 seconds
Unit - Order (Last created unit) to Neutral - Breath Of Frost (Position of (Last created unit))
Unit - Make (Last created unit) face 225.00 over 0.00 seconds
Unit - Order (Last created unit) to Neutral - Breath Of Frost (Position of (Last created unit))
Unit - Make (Last created unit) face 270.00 over 0.00 seconds
Unit - Order (Last created unit) to Neutral - Breath Of Frost (Position of (Last created unit))
Unit - Make (Last created unit) face 315.00 over 0.00 seconds
Unit - Order (Last created unit) to Neutral - Breath Of Frost (Position of (Last created unit))
Unit - Kill (Last created unit)
#2
you cannot oreder a unit to cast a spell multiple times, cause a spell has a minimum cooldown (despite you set it to 0). you have to create a dummy for each angle. and also if the target order point is the unit's position, it will be a mess...
so create a dummy at caster position, order it to cast the spell to a polar offset point, then repeat this method to each angle you want. use a loop...
#3
how do i loop it if i have to change the angle?
#4
create a real variable with init value 0, let's call it Angle :P
also it's recommended to create a TempLoc point variable!
do this:

set TempLoc[1] = position of triggering unit
set Angle = triggering unit's facing (or simply set this to 0)

for each integer A from 1 to 8
loop
-create a dummy at TempLoc facing 0
-add 'ability' to lastcreatedunit
-set TempLoc[2] = point with polar offset (the center will be TempLoc[1], and the offset is hm.. anything maybe 100, and the angle is Angle!)
-order lastcreatedunit to ... at TempLoc[2]
-set Angle = Angle + 45
-custom script: call RemoveLocation(udg_TempLoc[2])

outside the loop!!!:
-custom script: call RemoveLocation(udg_TempLoc[1])
#5
ok i dont know what a temp loc is but this is my code! what is wrong with it this time!

Spirit Realease
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Voodoo Spirit Release.
Actions
Set blast[0] = 0.00
For each (Integer A) from 1 to 8, do (Actions)
Loop - Actions
Unit - Create 1 Spirit (Dummy) for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing 0.00 degrees
Unit - Add Soul Beam to (Last created unit)
Unit - Set level of Soul Beam for (Last created unit) to (Level of Voodoo Spirit Release. for (Triggering unit))
Unit - Order (Last created unit) to Neutral - Breath Of Frost ((Position of (Last created unit)) offset by 50.00 towards blast[0] degrees)
Set blast[0] = (blast[0] + 45.00)
Unit - Kill (Last created unit)
#6
TempLoc (or name it as you want) is a point variable, that is used for dealing with leaks.
Each time you use (Position of (Triggering Unit)), or any type of this, u create a point (location). If u create many points, it will cause lagg in your map!!
In a spell like yours, you use a loop. In each loop, you create 3 points with these:
(Position of (Triggering unit))
((Position of (Last created unit))
((Position of (Last created unit)) offset by 50.00 towards blast[0] degrees)
You do this 8 times, so you create 24 points each time you cast this spell.
To destroy points (and leaks), store these points in a variable. When you've used the point, destroy it with a custom script:
call RemoveLocation(udg_YourPointVariable)


The problem with your script is that you kill the dummy. It has no time to cast the spell. Give it an expiration timer, instead of killing it.