Jump trigger

KvickaN

TH.net Regular
Reaction score
24
Can someone make this work? I want the triggering unit to be thrown up in the air for a little moment.

I took this from jumpmove.w3x

It worked fine in the test map but not here.

Original:

Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set Plyr_FH = (Current flying height of Footman 0000 <gen>)
        Set Plyr_Gravity = 0.30
        Set Plyr_Jumping = False
        Set Plyr_JP = 20.00
        Set Plyr_JS = 0.00

Code:
Jump
    Events
        Time - Every 0.01 seconds of game time
    Conditions
        Plyr_Jumping Equal to True
    Actions
        Set Plyr_JS = (Plyr_JS - Plyr_Gravity)
        Unit - Move Footman 0000 <gen> instantly to tempPoint, facing moveAngle degrees
        Animation - Change Footman 0000 <gen> flying height to ((Current flying height of Footman 0000 <gen>) + Plyr_JS) at 0.00
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Current flying height of Footman 0000 <gen>) Less than or equal to 5.00
            Then - Actions
                Animation - Change Footman 0000 <gen> flying height to Plyr_FH at 0.00
                Set Plyr_Jumping = False
            Else - Actions

Code:
pushup
    Events
        Unit - A unit Begins casting an ability
    Conditions
    Actions
        Set Plyr_Jmp_to = (Target point of ability being cast)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Plyr_Jumping Equal to False
            Then - Actions
                Set Plyr_JS = Plyr_JP
                Set Plyr_Jumping = True
                Set moveAngle = (Angle from (Position of (Triggering unit)) to Plyr_Jmp_to)
                Set moveX = ((X of Plyr_Jmp_to) - (X of (Position of Footman 0000 <gen>)))
                Set moveY = ((Y of Plyr_Jmp_to) - (Y of (Position of Footman 0000 <gen>)))
                Set Plyr_XMoveDist = (moveX / 44.00)
                Set Plyr_YMoveDist = (moveY / 44.00)
            Else - Actions
                Do nothing

Mine:

Code:
Melee Initialization
    Events
        Map initialization
    Conditions
    Actions
        Set Plyr_FH = (Current flying height of (Triggering unit))
        Set Plyr_Gravity = 0.30
        Set Plyr_Jumping = False
        Set Plyr_JP = 20.00
        Set Plyr_JS = 0.00

Code:
Jump
    Events
        Time - Every 0.01 seconds of game time
    Conditions
        Plyr_Jumping Equal to True
    Actions
        Set Plyr_JS = (Plyr_JS - Plyr_Gravity)
        Unit - Move (Triggering unit) instantly to tempPoint, facing moveAngle degrees
        Animation - Change (Triggering unit) flying height to ((Current flying height of (Triggering unit)) + Plyr_JS) at 0.00
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Current flying height of (Triggering unit)) Less than or equal to 5.00
            Then - Actions
                Animation - Change (Triggering unit) flying height to Plyr_FH at 0.00
                Set Plyr_Jumping = False
            Else - Actions

Code:
pushup
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Set Plyr_Jmp_to = (Target point of ability being cast)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Plyr_Jumping Equal to False
            Then - Actions
                Set Plyr_JS = Plyr_JP
                Set Plyr_Jumping = True
                Set moveAngle = (Angle from (Position of (Triggering unit)) to Plyr_Jmp_to)
                Set moveX = ((X of Plyr_Jmp_to) - (X of (Position of (Triggering unit))))
                Set moveY = ((Y of Plyr_Jmp_to) - (Y of (Position of (Triggering unit))))
                Set Plyr_XMoveDist = (moveX / 44.00)
                Set Plyr_YMoveDist = (moveY / 44.00)
            Else - Actions
                Do nothing

I attached the map where i got the trigger from and mine.
 

Sim

Forum Administrator
Staff member
Reaction score
534
And where did you take that jumpmove from?

It uses generic units and the such.

Definitely not the way to go.
 

ShadowTek

New Member
Reaction score
23
Code:
 Events
        Map initialization
    Conditions
    Actions
        Set Plyr_FH = (Current flying height of (Triggering unit))
Triggering unit? :nuts:
 

NapaHero

Back from the dead...
Reaction score
43
There's no triggering unit in there. The Jump trigger uses preplaced units.
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Was that made by 13th? That map was more of a proof of concept as he said, it's to show that units can jump rather then to make them actually jump with a fool proof code, you'd still need to change somethings in that, he only made it to prove it and all.
 

KvickaN

TH.net Regular
Reaction score
24
Damn... I've searched and this was the best I found...

Any ideas how to make my damn child jump up in the air for 3 seconds then land on same spot?! got damn it, driven me nuts all day, lol.
 

w00t22

CSS L4D DoD? Steam ID = w00t22
Reaction score
43
yea make an abilty based off instant cast and when he casts it add crow form just make the spell uncastable - 99999 mana, set flying height to 500 or somthing then wait then set flying height to normal and remove abilty heres code
JASS:
function Trig_Jump_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == &#039;A00U&#039;
endfunction

function Trig_Jump_Actions takes nothing returns nothing
    local unit jumper = GetTriggerUnit()
    call SetUnitInvulnerable( jumper, true )
    call UnitAddAbilityBJ( &#039;A00T&#039;, jumper )
    call SetUnitFlyHeightBJ( jumper, 500, 700.00 )
    call TriggerSleepAction( 0.6 )
    call SetUnitFlyHeightBJ( jumper, 0.00, 700.00 )
    call TriggerSleepAction( 0.4 )
    call UnitRemoveAbilityBJ( &#039;A00T&#039;, jumper )
    call SetUnitInvulnerable( jumper, false )
    set jumper = null
endfunction

//===========================================================================
function InitTrig_Jump_Troll takes nothing returns nothing
    set gg_trg_Jump_Troll = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Jump_Troll, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Jump_Troll, Condition( function Trig_Jump_Conditions ) )
    call TriggerAddAction( gg_trg_Jump_Troll, function Trig_Jump_Actions )
endfunction


base the spell of beserk or somthing with instant cast and 'A00T' is a custom crow form ability just change the model form to your unit and its all good
 

Choppa

www.warcraft-gamers.po.gs
Reaction score
59
Damn... I've searched and this was the best I found...

Any ideas how to make my damn child jump up in the air for 3 seconds then land on same spot?! got damn it, driven me nuts all day, lol.

With 13th code you could easily make that into an ability that jumps, his one make the unit jump to a certain area with a smooth parabola too, so you can easily make it jump in the air.
 

KvickaN

TH.net Regular
Reaction score
24
Hmm I'll take that allthough I think i finally got it :D

Code:
Jumpp
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Jump 
    Actions
        Unit - Make (Triggering unit) Invulnerable
        Unit - Add Crow Form to (Triggering unit)
        Animation - Change (Triggering unit) flying height to 270.00 at 135.00
        Unit - Remove Crow Form from (Triggering unit)
        Wait 5.00 seconds
        Unit - Make (Triggering unit) Vulnerable
        Animation - Change (Triggering unit) flying height to 0.00 at 200.00
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top