• 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.

Restriction of item usage

Status
Not open for further replies.
Level 4
Joined
Nov 7, 2010
Messages
68
I want to restrict the usage of an item (that can be cast pretty much anywhere, so it is not unit restricted or an AoE) to a certain area around the unit OR in a region/rect.
I don't know what to put under conditions/actions...


windows screenshot
 
make an event begins casting an ability. then in the actions get the points. then check the x and y of the point if its in the region you are trying to cast onto (you can find it in boolean comparison) then order the unit to stop or whatever. i dont have warcraft atm i will show u the trigger once i have access to warcraft.
 
Last edited:
Level 4
Joined
Nov 7, 2010
Messages
68
make an event begins casting an ability. then in the actions get the points. then check the x and y of the point if its in the region you are trying to cast onto (you can find it in boolean comparison) then order the unit to stop or whatever. i dont have warcraft atm i will show u the trigger once i have access to warcraft.

Could you tell me how stop the leak and how to make the condition work?


photo host
 
do it like this

event
starts the effect of an ability
condition
ability compare == your ability
action
set point = target point of the ability being cast
if (region(playable map area contains(point)) == false)
then
unit - order unit to(stop)

the condition that you want to go for is one found in the
boolean -> region that says the point is in region(playable map area)
the other condition that you also want to consider is
boolean -> environment that checks if the pathing for (ground) unit is enabled.

then you can order your caster to stop.
also clean the point that you have created
 
Level 4
Joined
Nov 7, 2010
Messages
68
also clean the point that you have created

Thanks for your help, I made it exactly as you said and now the only thing I don't know is how to stop it from leaking / clean it.
So I guess I should make a custom script: call RemoveLocation (udg_Warpgate1) ?
Do I put it at the end of the trigger or somewhere else?

Also, stop/hold position/cancel order does not work. Ability finishes casting (even if it has casting time set)and then that order takes place which is bad (not working as intended).
Any way to work that out?


So it is like this now:

gif upload
In this OR condition are regions I do not want ability to be cast in
 
Last edited:
Level 4
Joined
Nov 7, 2010
Messages
68
change the event into begins casting an ability -- this one is triggered before the spell's effect is fired. (sorry the event that i posted before this one is the wrong event).

you cleaned the leak correctly.

Yep, works great. Thanks a lot!
 
Status
Not open for further replies.
Top