• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[General] Move [Unit] instantly moves unit into cliffs?

Status
Not open for further replies.
Level 9
Joined
May 31, 2010
Messages
366
Unit - Move [Unit] <gen> instantly to (loc20 offset by 125.00 towards (Facing of [Unit] <gen>) degrees)

When i use this trigger to create an instant blink like effect on a clickable ability (like whindwalk for example) it moves the unit into cliffs if its standing right infront of a cliff - the unit then gets stuck there and has to use it again to get out

need help please T.T

(ill provide a creenshot if needed)
 
Level 9
Joined
May 31, 2010
Messages
366
that would at least prevetn the bug but would also negate the effects of the ability :/ i more think its a porblem of the editor settings or does this kind of thing happen to all who try to use move instantly functions?

i once had the problem that water was walkable for ground units, that was a problem caused by settings on the vjass we, so i guess this is maybe similiar to the issue i have now?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
that would at least prevetn the bug but would also negate the effects of the ability :/ i more think its a porblem of the editor settings or does this kind of thing happen to all who try to use move instantly functions?
Well you are moving it into something so it is kind of obvious it would get stuck inside... It is the WC3 game engine and how it treats moves.

It does try to displace the unit if it gets stuck inside unpathable area, but it may some times fail to do so.

One can try to displace the unit in smaller increments, stopping when it hits something not pathable. This at least would give some movement without embedding into cliffs or skipping pathing.
 
Level 9
Joined
May 31, 2010
Messages
366
so this is a kind of problem anyone would encounter?
cuz its not like "it fails sometimes" to displace it, it always does..

i tried to make a kind of ability that u just click on and it launches the hero about 256 into the facing direction, it worked pretty well until i accidentally hit a wall :/ guess i can only think of another ability then

thank you guys anyways for ur replys :D
 
Level 12
Joined
Feb 22, 2010
Messages
1,115
As Dr Super Good said, you need to check forward of unit incrementally and find last available point to jump.
  • Actions
    • Set StartingPoint = (Position of (your unit))
    • Set JumpIncrement = 25
    • Set JumpCurrentDistance = 0
    • Set JumpMaxDistance = 150
    • Set JumpPoint = StartingPoint
    • For each (Integer A) from 1 to (JumpMaxDistance / JumpIncrement), do (Actions)
      • Loop - Actions
        • Set JumpCurrentDistance = (JumpCurrentDistance + JumpIncrement)
        • Set TempPoint = (StartingPoint offset by (Real(JumpCurrentDistance)) towards (Facing of (your unit)) degrees)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Terrain pathing at TempPoint of type Walkability is off) Equal to False
          • Then - Actions
            • Set JumpPoint = TempPoint
          • Else - Actions
            • Custom script: exitwhen true
    • Unit - Move (your unit) instantly to JumpPoint
If you want your unit to be able to jump through walls/cliffs, do not terminate for loop at first unpathable point (remove exitwhen true line)
 
Status
Not open for further replies.
Top