Cliff Level Problem

chukky-jr

Member
Reaction score
15
i want my jump spell doesn't work if the target point cliff level is higher than the casting unit cliff level, but the trigger doesn't work, anyone can fix this?

Trigger:
  • Jump
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Jump [|cffffcc00C|r]
    • Actions
      • Set JumpInteger = (Player number of (Owner of (Casting unit)))
      • Set JumpUnit[JumpInteger] = (Casting unit)
      • Set Jump_position[JumpInteger] = (Position of JumpUnit[JumpInteger])
      • Set JumpTarget[JumpInteger] = (Target point of ability being cast)
      • Set JumpAngle[JumpInteger] = (Facing of (Casting unit))
      • Set JumpStop[JumpInteger] = 200
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain cliff level at JumpTarget[JumpInteger]) Less than or equal to (Terrain cliff level at Jump_position[JumpInteger])
        • Then - Actions
          • Unit - Add Storm Crow Form to JumpUnit[JumpInteger]
          • Unit - Remove Storm Crow Form from JumpUnit[JumpInteger]
          • Unit - Turn collision for JumpUnit[JumpInteger] Off
          • Trigger - Turn on JumpMove <gen>
        • Else - Actions
      • Custom script: call RemoveLocation(udg_JumpTarget[udg_JumpInteger])


Trigger:
  • JumpMove
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • JumpStop[JumpInteger] Greater than 0
        • Then - Actions
          • Unit - Move JumpUnit[JumpInteger] instantly to JumpMove[JumpInteger]
          • Custom script: call RemoveLocation(udg_JumpMove[udg_JumpInteger])
          • Custom script: call RemoveLocation(udg_Jump_position[udg_JumpInteger])
          • Set Jump_position[JumpInteger] = (Position of JumpUnit[JumpInteger])
          • Set JumpMove[JumpInteger] = (Jump_position[JumpInteger] offset by 10.00 towards JumpAngle[JumpInteger] degrees)
          • Set JumpStop[JumpInteger] = (JumpStop[JumpInteger] - 10)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • JumpStop[JumpInteger] Equal to 180
            • Then - Actions
              • Animation - Change JumpUnit[JumpInteger] flying height to 50.00 at 1200.00
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • JumpStop[JumpInteger] Equal to 20
            • Then - Actions
              • Animation - Change JumpUnit[JumpInteger] flying height to 0.00 at 1200.00
            • Else - Actions
        • Else - Actions
          • Trigger - Turn off (This trigger)
          • Custom script: call RemoveLocation(udg_JumpMove[udg_JumpInteger])
          • Custom script: call RemoveLocation(udg_Jump_position[udg_JumpInteger])
          • Unit - Turn collision for JumpUnit[JumpInteger] On
 

Dirac

22710180
Reaction score
147
Well first of all you don't have to include the hotkey of the ability in it's name
Second you should use AceHart's jump parabola formula
Third, i can't find anywhere on your trigger where you try to stop the unit from jumping if the terrain is higher, you should use GetLocationZ(point_var_goes_here) to do it
Fourth, You should check the condition of the periodic trigger (JumpStop[JumpInteger] Greater than 0) only checks the last jump spell casted, not every instance
 

chukky-jr

Member
Reaction score
15
Well first of all you don't have to include the hotkey of the ability in it's name

i have to, or else people who use it won't know the hotkey, notice the hotkey is C while the spell name is "Jump"


well no, i want to invent thing on my own :cool:

Third, i can't find anywhere on your trigger where you try to stop the unit from jumping if the terrain is higher, you should use GetLocationZ(point_var_goes_here) to do it

Trigger:
  • Jump
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Jump [|cffffcc00C|r]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain cliff level at JumpTarget[JumpInteger]) Less than or equal to (Terrain cliff level at Jump_position[JumpInteger])
        • Then - Actions
          • Unit - Add Storm Crow Form to JumpUnit[JumpInteger]
          • Unit - Remove Storm Crow Form from JumpUnit[JumpInteger]
          • Unit - Turn collision for JumpUnit[JumpInteger] Off
          • Trigger - Turn on JumpMove <gen>
        • Else - Actions
          • Custom script: call RemoveLocation(udg_Jump_position[udg_JumpInteger])
          • Custom script: call RemoveLocation(udg_JumpMove[udg_JumpInteger])


i'll try the getlocationz
Fourth, You should check the condition of the periodic trigger (JumpStop[JumpInteger] Greater than 0) only checks the last jump spell casted, not every instance

don't get what you mean, the 2nd trigger runs ONLY the first trigger's condition all satisfied, the 2nd is initially off, every instance is needed since i want it to be MPI
 

Dirac

22710180
Reaction score
147
What i mean is that it's not even MPI, it's kinda a MUI-try-hard. If you want to do it MUI (but very very inneficient) then
Loop for integer a from 1 to JumpInteger
if JumpStop[Integer A] Greater than 0 then...

..
see my point?

And no, you DON'T have to write the hotkey in it's name, since you can't see it ingame. There's another value for the name displayed in-game
 

chukky-jr

Member
Reaction score
15
What i mean is that it's not even MPI, it's kinda a MUI-try-hard. If you want to do it MUI (but very very inneficient) then
Loop for integer a from 1 to JumpInteger
if JumpStop[Integer A] Greater than 0 then...

..
see my point?

got it, i'm just too lazy to rewrite that part now...

And no, you DON'T have to write the hotkey in it's name, since you can't see it ingame. There's another value for the name displayed in-game
well i did it out of blue since copy-pasting an existing value is easy, (btw that is Text-Tooltip-Normal for the ingame effect)

i rewrite my trigger a bit, but it still not working? and the effect is the same when i use Environment - Cliff level at () , the Jump works if you are in the higher level of terrain you can jump down, but you can't jump on flat terrain (same level of cliff)

Trigger:
  • Jump
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Jump [|cffffcc00C|r]
    • Actions
      • Set JumpInteger = (Player number of (Owner of (Casting unit)))
      • Set JumpUnit[JumpInteger] = (Casting unit)
      • Set Jump_position[JumpInteger] = (Position of JumpUnit[JumpInteger])
      • Set JumpTarget[JumpInteger] = (Target point of ability being cast)
      • Set JumpAngle[JumpInteger] = (Facing of (Casting unit))
      • Set JumpStop[JumpInteger] = 200
      • Custom script: set udg_JumpTerrain1[udg_JumpInteger] = GetLocationZ(udg_JumpTarget[udg_JumpInteger])
      • Custom script: set udg_JumpTerrain2[udg_JumpInteger] = GetLocationZ(udg_Jump_position[udg_JumpInteger])
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Integer(JumpTerrain1[JumpInteger])) Less than or equal to (Integer(JumpTerrain2[JumpInteger]))
        • Then - Actions
          • Unit - Add Storm Crow Form to JumpUnit[JumpInteger]
          • Unit - Remove Storm Crow Form from JumpUnit[JumpInteger]
          • Unit - Turn collision for JumpUnit[JumpInteger] Off
          • Trigger - Turn on JumpMove <gen>
        • Else - Actions
          • Custom script: call RemoveLocation(udg_Jump_position[udg_JumpInteger])
          • Custom script: call RemoveLocation(udg_JumpMove[udg_JumpInteger])
      • Custom script: call RemoveLocation(udg_JumpTarget[udg_JumpInteger])
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
612
Doesn't this condition work?
Trigger:
  • (Terrain cliff level at CastPoint) Greater than or equal to (Terrain cliff level at TargetPoint)
 

chukky-jr

Member
Reaction score
15
Doesn't this condition work?
Trigger:
  • (Terrain cliff level at CastPoint) Greater than or equal to (Terrain cliff level at TargetPoint)

it does, but the outcome is weird, i can Jump to lower cliff level, but can't Jump to place where the cliff level is the same (flat grounds). so i ask if there is a workaround

did a few test and apparently, equal cliff level is registered as Greater, but not so sure, can anyone confirm this?
 

chukky-jr

Member
Reaction score
15
can anyone help me? sorry for the quick bump, but i'm quite sure people don't reply because the above statement, though i tested that equal cliff level is registered as greater, it still doesn't work for the trigger
 

Dirac

22710180
Reaction score
147
custom script set udg_YourReal1=GetLocationZ(caster location)
custom script set udg_YourReal2=GetLocationZ(target location)
if YourReal1 less than or equal to YourReal2 then
 

chukky-jr

Member
Reaction score
15
custom script set udg_YourReal1=GetLocationZ(caster location)
custom script set udg_YourReal2=GetLocationZ(target location)
if YourReal1 less than or equal to YourReal2 then

Trigger:
  • Jump
    • Custom script: set udg_JumpTerrain1[udg_JumpInteger] = GetLocationZ(udg_JumpTarget[udg_JumpInteger])
    • Custom script: set udg_JumpTerrain2[udg_JumpInteger] = GetLocationZ(udg_Jump_position[udg_JumpInteger])
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Integer(JumpTerrain1[JumpInteger])) Less than or equal to (Integer(JumpTerrain2[JumpInteger]))

already did that dude, reverting it back and forth doesn't help at all, it seems the WE register 1 cliff lower as 1 level lower, while 1 cliff level higher AND equal cliff level as 1 cliff level higher
 

Dirac

22710180
Reaction score
147
GetCliffLevel isnt the same thing as GetLocationZ, also, i made a mistake, it's GREATER THAN OR EQUAL TO not what i posted

Cliff level returns an integer (1,2,3,4,5) i think
GetLocationZ returns the exact height of the target location, as in (128.00 or 256.00)
 

chukky-jr

Member
Reaction score
15
still doesn't work

btw i did a few research with the Z position , i set A B C as real, A as position of caster, B as target point, C = A-B, i got A = 15.xx, B= 7.xx, but then i got C = -105.xx (or more than -100), anyone knows why that is?
 

chukky-jr

Member
Reaction score
15
sorry for another bump

btw my ability is based on Cloud of Fog (i believe it is used by a flying unit, not sure which one), would that be a problem?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top