• 🏆 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!

"Pick random unit mathcing condition" function que

Status
Not open for further replies.
Level 8
Joined
Dec 9, 2005
Messages
523
I have a spell that when activated, every 1/2 second a dummy unit casts something on a random enemy unit around the caster (range 700).
Only, it doesn't work. I wonder what's wrong.

I started with:
Event: Unit starts the effect of ability,
Action: Turn on trigger (effect trigger).

The every half second is in that trigger.

Help? Thanks.
 
Level 8
Joined
Dec 9, 2005
Messages
523
Okay here's the trigger (the effect one; all the variables are in the other trigger).


Events
Time- Every 0.50 seconds of game time

Actions
set Shadowtarget= (random unit from(units within 700.00 of (position of Angelus) matching (((matching unit) belongs to an enemy of (Owner of Angelus)) Equal to True)
Wait 0.20 seconds
Unit - Order fieldofshadowunit to Neutral - Firebolt shadowtarget
 
Level 13
Joined
Aug 31, 2005
Messages
823
Does the unit you want to cast firebolt have that ability? Part of your problem could lie there, additionally your dummy units ability might not have the range to target the unit. Iv found the best way to fix a glitch is to take things one step at a time.
Try this:
-Check the Ability (firebolts) cast range
-Check to make sure the ability can target heros
-Try adding a buff to see if the ability is casting and possibly not doing damage
-Make sure your dummy unit has firebolt
-Make sure the dummy unit is within the camra bounds
-Check to see if your problem is with your triggers (place your dummy unit on the map where he would appear and try to cast the ability yourself manually)

Hope some of that helps
 
Level 13
Joined
Aug 31, 2005
Messages
823
Also, if your still having problems you could just rewrite your action more like this.

Unit - Order (Dummy_Unit) to Neutral - Firebolt (Random unit from (Units within 512.00 of (Position of (Your_Hero))))

Also the dummy unit must have the ability Neutral-Firebolt to be able to cast it as i stated earlier.

Anyway hope this works out for ya.
 
Status
Not open for further replies.
Top