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

Channel spell help

Status
Not open for further replies.
Level 2
Joined
Feb 9, 2012
Messages
4
How to make the custom channel spell not able to target ground in black areas or outside map boundaries. Blink spell is like this, it wont let you cast in a black boundary limit area.

Could you rewrite that, because I didn't quite get what the question was.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Set at map init:
  • Set r1 = (Max X of (Playable map area))
  • Set r2 = (Min X of (Playable map area))
  • Set r3 = (Max Y of (Playable map area))
  • Set r4 = (Min Y of (Playable map area))
When casting:
x = TargetedX
y = TargetedY

if x < r1 and x > r2 and y < r3 and y > r4 then
ok
else
abort
endif
 
Level 13
Joined
Mar 24, 2010
Messages
950
thats not a bad idea for coding it simple, but was hoping the spell was customizable enough to be able to mimic how the blink spell works.

Reason is there is black areas on the map that are not just map boundaries so it would still be able to cast in those black areas. unless i set up a ton more dimensions. I can think of a easy way to code it, but is the channel spell just not have that option for it somewhere? I thought it was suppose to be the most customizable spell lol
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
just get an IsPointWalkable system than use that to check if you can walk there. (this will also apply for cliffs, doodads, etc)
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Maybe you can use
  • Custom script: if IsLocationVisibleToPlayer(location, player) then
  • *do things here*
  • Custom script: else
  • *abort*
  • Custom script: endif

that will only check if the point is visible. you can see boundary
 
Status
Not open for further replies.
Top