• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Targeting Problem

Status
Not open for further replies.
Level 7
Joined
Feb 15, 2005
Messages
183
not really. Just make a trigger that says

Event - Unit begins casting spell
condition - spell = invis
-OR-
unit type of unit of ability being cast is transport = false
unit calssification is organic = false
unit calsification is ect ect ect
" " " " " "
" " " " " "
action -
order casting unit to stop.



this will make it so that if you target anythingelse not listed in the conditions, it will cancel the spell before it is cast.
 
Level 7
Joined
Feb 15, 2005
Messages
183
Yes, I know what you what. How does that not work then? make the spell so you can target anything, but make the spell cancel if you target something that does not fit into what ever critera you have. Instead of alerting the fields in the object editor you have to make a trigger with the appropriate alterations. You can use boolean conditions to get the unit type/classification. And unit-type coomparisons for what ever specific units you want targeted aswell.
 
Level 13
Joined
Jul 4, 2005
Messages
1,064
It is more complicated way:

Mark this transporting unit e.g. as "Tauren" in Object Editor. Remember: all other unit on your map CANNOT be marked as "Tauren" then.

Then, go to Ability Editor and in "Targets Allowed" check "Tauren".

Last point, go to Interface Editor, find string which appears when unit tries to cast spell on unit not being marked as "Tauren" and change it e.g. to "This spell can only be casted on Transporter".
 
Level 7
Joined
Feb 15, 2005
Messages
183
It's dangerous when u start changing unit types and the like. sometimes the fields just arnt acurate. But if it works, then thats cool. I have just had experience in the past which causes errors even if u have all the fields set to what you want. the targeting system is a bit flakey.
 
Level 7
Joined
Feb 15, 2005
Messages
183
oh im sorry, Noobystance. I hvae tried messing with the fields, and some of them overlap, and are just plain weird. I never got them to work how I wanted, so I had to restort to triggers. The trigger way just isn't as nice, because you don't get the default messages and error clicks, like when you try to target an invalid target.

You may want to add a text message after unit stop order, to let the player know why their spell was canceled.
 
Status
Not open for further replies.
Top