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

How to make non-flying unit move at a certain height?

Status
Not open for further replies.
Level 8
Joined
Mar 26, 2009
Messages
301
Mentioned unit is a missile (a projectile launched from rifleman's gun)
I want projectile to move at constant 50 height. But It needs to Movement Type - None.
Because, if I make it a flying unit , (even at 0 collision) it does not pass through other air units. With Movement Type - None, it is possible to make 2 units exist on same exact location... So how do we do this? =)
 
Level 8
Joined
Mar 26, 2009
Messages
301
That actually worked. I tried it with foot units, they were however uneager to pass through each other (with locust ability and zero collision) That doesn't seem to be an issue with air units. But now I have a newer problem:
That bullet projectile has a trigger focused on it, to check cliff level changes. If projectile moves to a higher ground it is destroyed immediately (creating the illusion of it being hit to the ground) That doesn't exactly work that way but it is sufficent for now.
The thing is; when projectile approaches a cliff (just getting closer, no arrival here) It begins to rise above it's normal height (goes up into the air) and makes a weird appearance. (In Movement Type - None, this was not an issue) So how do we fix this? =)
 
Level 28
Joined
Mar 25, 2008
Messages
2,955
What's your minimum flying height?
Change it to lower values if it's above 0.00.

I can't remember if that actually worked but here's something else:
  • MoveInit
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • Set g = (Units of type *yourtype*)
      • Unit Group - Pick every unit in g and do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF' - Conditions
              • (Number of units in g) greater than (>) 0
            • 'THEN' - Actions
              • Set p1 = (Position of (Picked unit))
              • Set p2 = (p1 offset by 50.00 towards (Facing of (Picked unit)) degrees)
              • Unit - Move (Picked unit) instantly to p2
              • Custom script: call DestroyLocation(udg_p1)
              • Custom script: call DestroyLocation(udg_p2)
            • 'ELSE' - Actions
              • Trigger - Turn off (This trigger)
      • Custom script: call DestroyGroup(udg_g)
This will cause to move every unit of your type to 'move' by 50.00 every 0.04 seconds regardless the movement type.
Feel free to play around with the values but keep in mind to activate this trigger as soon as one instance of your assigned unit type is created - i.e. the projectile.
Also do note that you have to specify the facing angle upon the creation of that unit.
 
Level 2
Joined
Jun 25, 2010
Messages
7
I brazilian so mi english is bad.
I use a diferent way, change the move type to Hover and then change the Height and the minimun height to the one you want, so he will fly but don't pass on impassable terrains and can be targered as a ground unit, get it?
 
Level 8
Joined
Mar 26, 2009
Messages
301
No guys, problem is projectile begins to rise up as it approaches the cliff.
It doesn't rise when projectile reaches.
This normally provides air units a smotth movement animation when passing through cliffs and stuff. But in this sitiuation, i need to get rid of that. To make things clear, I made a visual explaination of the problem:
ss_waypoints.jpg

You can see this happening, if you download the attachment of my previous post and shoot at the cliffs or shoot close to the cliffsides.
Hover type of movement doesn't help because of the reason I explained in first post (it acts similar to the foot units)
 
Level 8
Joined
Mar 26, 2009
Messages
301
i have tested the bug, but first thing is that if you shoot it to many times at once the bullet special effect just stays in one position that mean there is a leak in your map. anyway try lowering the cliff(this probably wont work but try it anyway), and/or move the ramp away from each other, if this helps my work here is done. Thx
Moving cliffs away most likely wont solve anything =) As for the bullet thing, I didn't finish triggers yet. Yes, It is not MUI now (it won't be a complete MUI when I finish it anyway) So If you shoot at rapid rate, trigger will focus on latest created projectile (other will remain frozen permanently)
 
Status
Not open for further replies.
Top