• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] I wanna create an ability like force staff of Dota but with an exception

Status
Not open for further replies.
Level 24
Joined
Jun 26, 2020
Messages
1,852
As I said I wanna create an ability like force staff of Dota (don't have to explain me how to do the push, I know what to do) but I wanna add it an exception, if the unit hits a wall of at least a 2 of height then stops, but if is coming from up to down don't stop but do a fall, if the unit hits a wall of 1 of height then "climbs it" but at the same speed or a little slower.
 
Last edited:
Nobody has idea?

Well... Check the cliff-hights at the unit and at the "next point" and do what's supposed to happen at the given case...?

If you have two interger variables, heightAtUnit and heightAtNextPoint, this checks the cliff-height.
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set heightAtUnit = (Terrain cliff level at (Center of (Playable map area)))
      • Set heightAtNextPoint = (Terrain cliff level at (Center of (Playable map area)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • heightAtNextPoint Not equal to heightAtUnit
        • Then - Actions
          • -------- points at different heights, check what case it is and do what's supposed to happen --------
        • Else - Actions
          • -------- Both points at same height, carry on as normal --------
However, might be more complicated than this with lots of edge-cases. You will need to handle "what if there's water there?" and "Is there any passable area up/down the cliff?"
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
Well... Check the cliff-hights at the unit and at the "next point" and do what's supposed to happen at the given case...?

If you have two interger variables, heightAtUnit and heightAtNextPoint, this checks the cliff-height.
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Set heightAtUnit = (Terrain cliff level at (Center of (Playable map area)))
      • Set heightAtNextPoint = (Terrain cliff level at (Center of (Playable map area)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • heightAtNextPoint Not equal to heightAtUnit
        • Then - Actions
          • -------- points at different heights, check what case it is and do what's supposed to happen --------
        • Else - Actions
          • -------- Both points at same height, carry on as normal --------
However, might be more complicated than this with lots of edge-cases. You will need to handle "what if there's water there?" and "Is there any passable area up/down the cliff?"
Sorry to disappoint you, but I already figured it out, thanks
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
These are the triggers
  • Impulse boots
    • Events
      • Unit - A unit starts the effect of an abilty
    • Conditions
      • (Ability being cast) Equal to Impulse
    • Actions
      • Set IB_index = (IB_index + 1)
      • Set IB_caster[IB_index] = (Casting unit)
      • Set Temp_Loc = (Position of IB_caster[IB_index])
      • Set Temp_Loc2 = (Target point of ability being cast)
      • Set IB_angle[IB_index] = (Angle from Temp_Loc to Temp_Loc2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Distance between Temp_Loc and Temp_Loc2) Greater than 1200.00
        • Then - Actions
          • Set IB_point[IB_index] = (Temp_Loc offset by 1200.00 towards IB_angle[IB_index] degrees)
        • Else - Actions
          • Set IB_point[IB_index] = (Target point of ability being cast)
      • Unit - Turn collision for IB_caster[IB_integer] off
      • Unit Group - Add IB_caster[IB_index] to Impulse_boots_casters
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IB_index Equal to 1
        • Then - Actions
          • Trigger - Turn on Impulse boots movement <gen>
        • Else - Actions
      • Custom script: call RemoveLocation(udg_Temp_Loc)
      • Custom script: call RemoveLocation(udg_Temp_Loc2)
  • Impulse boots movement
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • For each (Integer IB_integer) from 1 to IB_index, do (Actions)
        • Loop - Actions
          • Set IB_temp_loc = (Position of IB_caster[IB_integer])
          • Set IB_temp_loc2 = (IB_temp_loc offset by 50.00 towards IB_angle[IB_integer] degrees)
          • Unit - Move IB_caster[IB_integer] instantly to IB_temp_loc2
          • Destructible - Pick every destructible within 150.00 of IB_temp_loc2 and do (If ((Destructible-type of (Picked destructible)) Equal Black Citadel - Tree) then do (Destructible - Kill (Picked destructible)) else do (Do nothing))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Random integer number between 1 and 5) Equal to 1
            • Then - Actions
              • Special Effect - Create a special effect attached to the chest of IB_caster[IB_integer] using Abilities\Spells\Human\Defend\DefendCaster.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
          • Set IB_temp_loc3 = (IB_temp_loc2 offset by 150.00 towards IB_angle[IB_integer] degrees)
          • Custom script: set x=GetLocationX(udg_IB_temp_loc3)
          • Custom script: set y=GetLocationY(udg_IB_temp_loc3)
          • Custom script: set udg_IB_temp_bool=IsTerrainPathable(GetLocationX(udg_IB_temp_loc3),GetLocationY(udg_IB_temp_loc3), PATHING_TYPE_FLOATABILITY)
          • Set IB_temp_int = 0
          • Destructible - Pick every destructible within 64.00 of IB_temp_loc3 and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Destructible-type of (Picked destructible)) Equal to Obstacle Impulse
                • Then - Actions
                  • Set IB_temp_int = 1
                • Else - Actions
          • Destructible - Pick every destructible within 160.00 of IB_temp_loc3 and do (Actions)
            • Loop - Actions
              • Set IB_temp_loc4 = (Position of (Picked destructible))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Distance between IB_temp_loc4 and IB_temp_loc2) Greater or equal to 160.00
                  • ((Height of (Picked destructible)) - (Terrain cliff level at IB_temp_loc2)) Greater or equal to 1
                • Then - Actions
                  • Set IB_temp_int = 1
                • Else - Actions
              • Custom script: call RemoveLocation(udg_IB_temp_loc4)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Distance between IB_temp_loc2 and IB_point[IB_integer]) Less or equal to 50.00
                  • ((Terrain cliff level at IB_temp_loc3) - (Terrain cliff level at IB_temp_loc2)) Greater or equal to 2
                  • (IB_temp_bool Igual a False) and ((Terrain cliff level at IB_temp_loc3) Equal to 0)
                  • IB_temp_int Equal to 1
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (IB_caster[IB_integer] has buff Intangibility ) Equal to False
                • Then - Actions
                  • Unit - Turn collision for IB_caster[IB_integer] On
                • Else - Actions
              • Custom script: call RemoveLocation(udg_IB_point[udg_IB_integer])
              • Unit Group - Remove IB_caster[IB_integer] from Impulse_boots_casters
              • Set IB_caster[IB_integer] = IB_caster[IB_index]
              • Set IB_angle[IB_integer] = IB_angle[IB_index]
              • Set IB_point[IB_integer] = IB_point[IB_index]
              • Set IB_index = (IB_index - 1)
              • Set IB_integer = (IB_integer - 1)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_IB_temp_loc)
          • Custom script: call RemoveLocation(udg_IB_temp_loc2)
          • Custom script: call RemoveLocation(udg_IB_temp_loc3)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • IB_index Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top