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

[vJASS] Collision Ability

Status
Not open for further replies.
Level 13
Joined
Mar 19, 2010
Messages
870
Hi hivers,

i have an idea to make an ability which deactivates the collision of a hero for x seconds.. BUT the collision should only work for all allied computer controlled units but not for allied real player units. Is that possible?

Reg.
 

Cokemonkey11

Spell Reviewer
Level 29
Joined
May 9, 2006
Messages
3,537
You'll need to disable collision and then build your own pathfinding algorithm to override the existing one. Nestharus https://github.com/nestharus has built an A* (high performance) pathfinding algorithm in JASS but even that is too slow for viability. You'll need to severely limit the use cases or cut out features if you want any chance to do this.

I'd rank this in the top 10 most difficult class of problems in JASS.
 
Level 13
Joined
Mar 6, 2008
Messages
852
Simple thoughts about what you could make:

- Make a shift movement spell which let your hero shift through allied units in a specific direction but not through enemy units.

- Make the hero flying with a flying hight of 0.
-- Then you could take flying away if there is an enemy unit near the casting hero
-- or you could slightly knock back the hero from enemy units so that he or she can not fly over an enemy unit.
 
Level 26
Joined
Aug 18, 2009
Messages
4,097
Give 'Ghost' to the hero, then periodically pick living ground (and that suffice your conditions) units around it (IsUnitInRangeXY considers collision size) and knock the hero away from those. You probably have only single heroes having activated the feature, so it's much more performant from their end.
 
Status
Not open for further replies.
Top