• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] make ability only target walkable terrain

Status
Not open for further replies.
Level 21
Joined
Mar 29, 2020
Messages
1,237
hey there,

is there a way to make a point targeting ability (channel based) only target walkable terrain in the object editor? or does it have to be done manually with triggering?

also -this ability will have an aoe-type targeting image. if the above has to be triggered - is there a way to make the ability happen only in points within the aoe targeter that are walkable?

(for clarity - example - someone casts infernal with half the targeter over water, - the unit should appear but where the targeter is over land, but if the whole targeter is over water - shouldn't cast)

thanks!
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
Has to be done with triggers

And for the "walkable points within the radius", that can be done by checking the walkability-type of multiple points that are offset from the center of the target point.

So like:
East
Point[1] = Center point + X:50, Y:0
Point[2] = Center point + X:100, Y:0
North
Point[3] = Center point + X:0, Y:50
Point[4] = Center point + X:0, Y:100
West
Point[5] = Center point - X:50, Y:0
Point[6] = Center point - X:100, Y:0
South
Point[7] = Center point - X:0, Y:50
Point[8] = Center point - X:0, Y:100
Etc... for NE, NW, SE, SW

From there you'll have to figure out what to do with these points.
 
Last edited:
Level 8
Joined
Mar 19, 2017
Messages
248
You could try tinkering around Tiny Castle item ability as this is an ability that uses Wc3 building mechanics (ie. you use a dummy building unit wth no model that recquires walkability placing).
If this doesn't work you will most likely need triggers: a spell cast event, a check walkability action, and maybe a sim error type system so to stop the caster and ability effects should the ability be used failing the walkability check. Also don't forget the neat Wc3 error sound and UI message.
 
Status
Not open for further replies.
Top