• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Jumping Moving

Status
Not open for further replies.
Level 8
Joined
Aug 4, 2008
Messages
279
Guys, i made a Jump spell, all works, but i need to know, how to pause the unit while jump, to the owner of the unit dont move it.
I tried the trigger pause caster, but the caster stopped, please help me!

I tried to change the owner and retain the color to, but the trigger fail when it return to his real owner.Help me!
 
Level 2
Joined
Mar 30, 2009
Messages
30
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 20, do (Actions)
        • Loop - Actions
          • Wait 0.10 seconds
          • Selection - Clear selection for Player 1 (Red)
you can use any event you like. ofc you have to condition it .
and it could be good to order unit to stop if your trigger doesn't require moving.


what this does is that for 2 seconds every 0.1 second clears selection for specified player, result is that player can't select any unit for 2 seconds which means he can't order it to do anything.

The Sorrow
 
Level 6
Joined
Mar 20, 2008
Messages
208
Try pausing it before all the actions begin

It would help if you posted the trigger as well.
 
Level 13
Joined
Feb 28, 2007
Messages
477
SetUnitX(UNIT,REAL)
SetUnitY(UNIT,REAL)

Pause the unit, and use those two functions with some trigonometry. Or you can just use points (slower, but not much of a matter if it's just a jump).

Ex in custom script:
(set loc to be the location of the unit, and set Jumper to be the unit)
(set loc2 to be the next interval (very small step) to move to - if you use polar offset, referance loc instead of the location, since that would leak)
Call SetUnitX(udg_Jumper,GetLocationX(udg_loc2))
Call SetUnitY(udg_Jumper,GetLocationY(udg_loc2))
Call RemoveLocation(udg_loc)
Call RemoveLocation(udg_loc2)
(still custom script) Set udg_Jumper = null

There are more optimized and complicated ways of doing this, but that will give you a good result. Make sure the periodic interval is 0.02 for a better result (50fps). If you use JASS, the best interval is 0.0167 seconds, because that is 60fps (max framerate of the game) meaning it's 100% smooth.
 
If you want max efficiency and simplicity I suggest using a jump system.

Jump Library - Clan Mapz Forums

This is how easy it is to use.

  • Demo
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Jump (Neutral Hostile 1)
    • Actions
      • Set JumpUnit = (Casting unit)
      • Set JumpSpeed = 10.00
      • Set JumpLocation = (Target point of ability being cast)
      • Special Effect - Create a special effect attached to the origin of JumpUnit using Abilities\Spells\Orc\Devour\DevourEffectArt.mdl
      • Custom script: call UnitJumpLoc(udg_JumpUnit, udg_JumpSpeed, udg_JumpLocation)
      • Custom script: call RemoveLocation(udg_JumpLocation)
 
Status
Not open for further replies.
Top