• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Dummy problems

Status
Not open for further replies.
Level 7
Joined
Dec 8, 2005
Messages
319
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)
 
Level 11
Joined
Jul 12, 2005
Messages
764
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...
 
Level 11
Joined
Jul 12, 2005
Messages
764
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])
 
Level 7
Joined
Dec 8, 2005
Messages
319
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)
 
Level 11
Joined
Jul 12, 2005
Messages
764
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.
 
Status
Not open for further replies.
Top