Warcraft III resources & community, 2003–2006 · archived

"Pick random unit mathcing condition" function que

10 posts
#1

"Pick random unit mathcing condition" function que

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.
#2
there may be an error with the other trigger. Can you post it? also im not sure if world editor accepts .5 as an integer, it freaked out when i tried to do that once.
#3
Eh? Really? It can't accept .5? Okay let me try every second then.

You see, the problem is that this computer is not my map making computer so I need to go there first and type it and .. well I usually forget heheh...

But thanks for giving me an answer. I'll let you know how it turns out.
#4
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
#5
Where did you set the variable "fieldofshadowunit" to the unit you want to cast firebolt?
#6
In the uh.. triggering trigger.

I set the Angelus = casting unit
and
fieldofshadowunit = last created unit (along with the expire timer, etc. etc.).

Why? No problem in that, right? This problem is annoying me because this Hero is ready and this is the only power on him that doesn't work -_-'
#7
BUMP. Please guys, I need this fixed.. :?
#8
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
#9
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.
#10
Okay thanks! You just inspired me to try the exact same code, but with a visible (non locust) unit. I want to see if my dummy actually shows up.

PS. I already made sure the spell range, mana cost, and target is righ, which is why this is so frustrating T_T
The conversation continued. After wc3sear.ch closed, 2 further replies were posted to this thread on The Hive Workshop. Read them there →