• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Freeze units - unable to move[quite easy]?!

Status
Not open for further replies.
Level 3
Joined
Jun 20, 2008
Messages
43
Hello :xxd:

Okay a fast question, how I can avoid that my units move?
I want let my units playing an animation and they aren't allowed to move :wgrin:
So how I could do it, you sure have ideas, i don't get it yet lol =/
It is possible, but I don't get the idea how to make it, a fast suggestion would be nice :infl_thumbs_up:
 
Level 3
Joined
Jun 20, 2008
Messages
43
  • Event - Unit becomes Issued Order targeting an object
  • Condition - Triggering unit = Soldier 0006
  • Unit pause on Soldier 0006
  • Wait 10.00 Seconds
  • Unit pause off Soldier 0006
Quite easy trigger, but doesn't work =(
My soldier is stucked in the pause after 10 seconds..
Plzz help
____

[Edit] lol seems to work now, gonna post here again if something doesn't work with that
 
Last edited:
Level 14
Joined
Nov 20, 2005
Messages
1,156
Making someone aware of the consequences of someone is not complaining. Not doing so would be being a bitch.

Cancelling orders issues instantly replicates the effect, except for removing the order card stuff (unfortunately you can't add ward classification by triggers).
 
Level 3
Joined
Jun 20, 2008
Messages
43
Well, I knew that I could use Root, but I searched Redscores solution.
Okay guys, thanks ! The whole problem is solved and now we can play all in the sandbox together :xxd:
 
Level 14
Joined
Nov 20, 2005
Messages
1,156
And my way is the only way which is non-complicated, and with least bugs. If you use Roots or a Stun it could be interfered by removing the buff or something.

You being crap at JASS doesn't make your way the way with the least bugs. It has bugs to do with buffs, as I said.

Since the guy's obviously incapable / unwilling to work out a better solution, I guess I'll have to give it to him on a plate...bah, no one ever learns this way.

JASS:
library FreezeUnitLib initializer Init
    globals
        private group g
        private trigger t
    endglobals
    
    private function CondEx takes nothing returns boolean
        if IsUnitInGroup(GetTriggerUnit(), g) then
            call DisableTrigger(t)
            call PauseUnit(GetTriggerUnit(), true)
            call IssueImmediateOrder(GetTriggerUnit(), "stop")
            call PauseUnit(GetTriggerUnit(), false)
            call EnableTrigger(t)
        endif
        return false
    endfunction
    
    function IsUnitFrozen takes unit u returns boolean
        return IsUnitInGroup(u, g)
    endfunction
    
    function FreezeUnit takes unit u, boolean freeze returns nothing
        if freeze then
            call DisableTrigger(t)
            call PauseUnit(u, true)
            call IssueImmediateOrder(u, "stop")
            call PauseUnit(u, false)
            call EnableTrigger(t)
            call GroupAddUnit(g, u)
        else
            call GroupRemoveUnit(g, u)
        endif
    endfunction
    
    private function Init takes nothing returns nothing
        set t = CreateTrigger()
        set g = CreateGroup()
        call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_TARGET_ORDER )
        call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_POINT_ORDER )
        call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_ISSUED_ORDER )
        call TriggerAddCondition(t, Condition(function CondEx))
    endfunction

endlibrary
 
Level 14
Joined
Nov 20, 2005
Messages
1,156
Thats no solution, because if the player orders the unit the order is resetted, so is the animation, so this is useless for his needs.

He wants to make a unit non-orderable and moveable and to play animations during that.

Go test, come back, and say sorry to me, and everyone else on this forum who has to put up with your misinformation.
 
Status
Not open for further replies.
Top