• 🏆 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!

Force Staff - Question

Status
Not open for further replies.
Level 5
Joined
Nov 29, 2007
Messages
106
Hello, I need help with an item. It's Force Staff from DOTA.

Stats:
+10 Intelligence
+10 damage
+10% attack speed
Force (Active)
|
|
Force
Pushes any unit 600 units in the direction it is facing over a 0.3s duration.
Does not interrupt the target's actions.
Costs 25 mana, has a 20 second cooldown, and a 800 cast range.
Any ideas ? :)
 
Level 2
Joined
May 1, 2010
Messages
13
Well, my idea:

Have 2 Triggers:

  • ActivateForceStaff - Triggers if the item ability is used

    Here you store the angle of your hero and the target unit.
    We'll also need a maximum moving distance (e.g. 500).
    Last thing needed is the speed of the charging.
    Oh, and turn the units collison off!!

    ForceAngle - global
    ForceTarget - global
    ForceDistance - global
    ForceSpeed - global

    Then you activate a periodic trigger (all 0.03s) MoveForceStaffTarget

  • MoveForceStaffTarget - it will move our target, we need 2 locations:

    CurrentLoc - our units current location (really...^^)
    DestinatedLoc - the position the unit will step to, all 0.03s

    First we check if the ForceDistance is more than ForceSpeed. If so we have to move the target:

    We need this usefull function: PolarProjectionBJ(CurrentLoc, ForceSpeed, ForceAngle)
    to get the next position (DestinatedLoc) of the unit.

    After that you could check if the terrain at this point is walkable (or a cliff) and move it instantly to this point. (==> IsTerrainPathableBJ(DestinatedLoc, PATHING_TYPE_WALKABILITY) )

    Finaly you store the new remaining distance to ForceDistance (it is: ForceDistance = ForceDistance - ForceSpeed)

    If the ForceDistanc is below ForceSpeed you'll have to enable collision for the target!

I hope that helps, ask if i sth. isn't explained properly or if it's my english^^ ;)
 
Level 13
Joined
Oct 25, 2009
Messages
995
My idea is this xD
Events:
A unit start an effect of an ability
Condition:
Ability being cast Equal to Force Staff(push item)
Actions:
Set Target_Push_Unit = Target unit of ability being cast
Trigger - Turn on Pushing
Unit - Turn collision for Target_Push_Unit Off
Wait 0.45 Seconds
Trigger - Turn off Pushing
Unit - Turn collision for Target_Push_Unit On

Pushing:
Events:
Time - Every 0.01 seconds of game time
Condition:
None(xD,Condition does no use==)
Actions:
Move Target_Push_Unit instantly to ((Position of Target_Push_Unit) offset by 12.00 towards (Facing of Target_Push_Unit) degrees)
Special Effect - (Choose your Special Effect xD i lazy say=.=)
Special Effect - Destroy Last Create Special Effect
End =.=
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
My idea is this xD
Events:
A unit start an effect of an ability
Condition:
Ability being cast Equal to Force Staff(push item)
Actions:
Set Target_Push_Unit = Target unit of ability being cast
Trigger - Turn on Pushing
Unit - Turn collision for Target_Push_Unit Off
Wait 0.45 Seconds
Trigger - Turn off Pushing
Unit - Turn collision for Target_Push_Unit On

Pushing:
Events:
Time - Every 0.01 seconds of game time
Condition:
None(xD,Condition does no use==)
Actions:
Move Target_Push_Unit instantly to ((Position of Target_Push_Unit) offset by 12.00 towards (Facing of Target_Push_Unit) degrees)
Special Effect - (Choose your Special Effect xD i lazy say=.=)
Special Effect - Destroy Last Create Special Effect
End =.=

Leaks.
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
No, I mean I have the same method with you. but I used a lag-less trigger, which is 0.03s ~ 0.05s per move.
0.01s per move is just too... FAST and can cause bugs and heavy lags
The way to clean those leaks is by indexing and hashtabling but that method goes beyond my standard =(
 
Level 13
Joined
Oct 25, 2009
Messages
995
No, I mean I have the same method with you. but I used a lag-less trigger, which is 0.03s ~ 0.05s per move.
0.01s per move is just too... FAST and can cause bugs and heavy lags
The way to clean those leaks is by indexing and hashtabling but that method goes beyond my standard =(

Oh,i don't know use hashtable==
but hashtable can clean those leaks?
And the 0.03 ~ 0.05s won't make the game lag anymore?==
 
Level 6
Joined
Dec 9, 2007
Messages
208
And the 0.03 ~ 0.05s won't make the game lag anymore?==

Nope. If you use 0.01 sec it will happen 100 times in 1 sec, while 0.03 gives 33.3 times per sec and 0.05 gives 20 times.

From what I remember WC III have a maximum fps around 47, so 0.01 would be an overkill.
 
Level 15
Joined
Jul 9, 2008
Messages
1,552
My idea is this xD
Events:
A unit start an effect of an ability
Condition:
Ability being cast Equal to Force Staff(push item)
Actions:
Set Target_Push_Unit = Target unit of ability being cast
Trigger - Turn on Pushing
Unit - Turn collision for Target_Push_Unit Off
Wait 0.45 Seconds
Trigger - Turn off Pushing
Unit - Turn collision for Target_Push_Unit On

Pushing:
Events:
Time - Every 0.01 seconds of game time
Condition:
None(xD,Condition does no use==)
Actions:
Move Target_Push_Unit instantly to ((Position of Target_Push_Unit) offset by 12.00 towards (Facing of Target_Push_Unit) degrees)
Special Effect - (Choose your Special Effect xD i lazy say=.=)
Special Effect - Destroy Last Create Special Effect
End =.=

the spell his asking for doesent work like that there is no target point... because the ability is casted on a unit and the unit will move the direction he is facing.
 
Level 5
Joined
Nov 29, 2007
Messages
106
Here's the trigger, but this pushes unit back, how to change it to front of unit??
  • Events
    • Unit - A unit using an item
  • Conditions
    • Item beign manipulated = Item beign manipulated of type Force Staff
  • Actions
    • Set KBA_Caster = (Triggering unit)
    • Set KBA_TargetUnit = (Target unit of ability being cast)
    • Set KBA_StartingPosition = (Position of (Triggering unit))
    • Set KBA_Level = (Level of (Ability being cast) for (Triggering unit))
    • Set KBA_Speed = 9.00
    • Set KBA_DistancePerLevel = 150.00
    • Set KBA_SpecialEffects[1] = Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
    • Set KBA_SpecialEffects[2] = Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
    • Set KBA_DestroyTrees = Yes
    • Trigger - Run Cast A Knockback <gen> (checking conditions)
Cast A Knockback Trigger
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (KBA_TargetUnit is in KB_KnockbackedUnits) = Yes
      • Then - Actions
        • Unit Group - Remove KBA_TargetUnit from KB_KnockbackedUnits
        • Set KB_CountBuffs = (KB_CountBuffs - 1)
        • For each (Integer KB_GeneralIntegers[2]) from 1 to KB_TotalKnockUnits, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • KB_Units[KB_GeneralIntegers[1]] = KBA_TargetUnit
              • Then - Actions
                • Set KB_GeneralIntegers[1] = KB_GeneralIntegers[2]
                • Set KB_GeneralIntegers[2] = KB_TotalKnockUnits
              • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • KB_TotalKnockUnits More than KB_GeneralIntegers[1]
          • Then - Actions
            • Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
            • Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
            • Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
            • Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
            • Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
            • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
            • Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
            • Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
            • Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
            • Set KB_DestroyTrees[KB_GeneralIntegers[1]] = KB_DestroyTrees[KB_TotalKnockUnits]
            • Set KB_EffectCounter[KB_GeneralIntegers[1]] = KB_EffectCounter[KB_TotalKnockUnits]
            • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = KB_EffectCounter2[KB_TotalKnockUnits]
            • Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
          • Else - Actions
        • Set KB_Units[KB_TotalKnockUnits] = None Unit
        • Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • KB_CountBuffs = 0
          • Then - Actions
            • Set KB_TotalKnockUnits = 0
            • Trigger - Turn off Get Knockback <gen>
          • Else - Actions
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • KB_CountBuffs = 0
      • Then - Actions
        • Trigger - Turn on Get Knockback <gen>
      • Else - Actions
    • Set KB_CountBuffs = (KB_CountBuffs + 1)
    • Set KB_TotalKnockUnits = (KB_TotalKnockUnits + 1)
    • Set KB_Casters[KB_TotalKnockUnits] = KBA_Caster
    • Set KB_Levels[KB_TotalKnockUnits] = KBA_Level
    • Set KB_Units[KB_TotalKnockUnits] = KBA_TargetUnit
    • Set KB_StartPositions[KB_TotalKnockUnits] = KBA_StartingPosition
    • Set KB_TempPoint[KB_TotalKnockUnits] = (Position of KBA_TargetUnit)
    • Set KB_Angle[KB_TotalKnockUnits] = (Angle from KB_StartPositions[KB_TotalKnockUnits] to KB_TempPoint[KB_TotalKnockUnits])
    • Set KB_MaxDistance[KB_TotalKnockUnits] = (KBA_DistancePerLevel x (Real(KBA_Level)))
    • Set KB_ReachedDistance[KB_TotalKnockUnits] = 0.00
    • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = 0.00
    • Set KB_SpecificSpeed[KB_TotalKnockUnits] = KBA_Speed
    • Set KB_Effects_1[KB_TotalKnockUnits] = KBA_SpecialEffects[1]
    • Set KB_Effects_2[KB_TotalKnockUnits] = KBA_SpecialEffects[2]
    • Set KB_DestroyTrees[KB_TotalKnockUnits] = KBA_DestroyTrees
    • Set KB_EffectCounter[KB_GeneralIntegers[1]] = 0
    • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
    • Unit Group - Add KBA_TargetUnit to KB_KnockbackedUnits
    • Custom script: call RemoveLocation (udg_KBA_StartingPosition)
    • Custom script: call RemoveLocation (udg_KB_TempPoint [udg_KB_TotalKnockUnits] )
    • Custom script: call RemoveLocation (udg_KB_StartPositions [udg_KB_TotalKnockUnits] )
And Get A Knockback Trigger:
  • Events
    • Time - Every 0.02 seconds of game time
  • Akcje
    • For each (Integer KB_GeneralIntegers[1]) from 1 to KB_TotalKnockUnits, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (KB_Units[KB_GeneralIntegers[1]] is in KB_KnockbackedUnits) = Yes
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • KB_ReachedDistance[KB_GeneralIntegers[1]] More or Equal KB_MaxDistance[KB_GeneralIntegers[1]]
              • Then - Actions
                • Unit Group - Remove KB_Units[KB_GeneralIntegers[1]] from KB_KnockbackedUnits
                • Set KB_CountBuffs = (KB_CountBuffs - 1)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KB_TotalKnockUnits More than KB_GeneralIntegers[1]
                  • Then - Actions
                    • Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
                    • Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
                    • Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
                    • Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
                    • Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
                    • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
                    • Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
                    • Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
                    • Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
                    • Set KB_DestroyTrees[KB_GeneralIntegers[1]] = KB_DestroyTrees[KB_TotalKnockUnits]
                    • Set KB_EffectCounter[KB_GeneralIntegers[1]] = KB_EffectCounter[KB_TotalKnockUnits]
                    • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = KB_EffectCounter2[KB_TotalKnockUnits]
                    • Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
                  • Else - Actions
                • Set KB_Units[KB_TotalKnockUnits] = None Unit
                • Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KB_CountBuffs= 0
                  • Then - Actions
                    • Set KB_TotalKnockUnits = 0
                    • Trigger - Turn off (This trigger)
                  • Else - Actions
              • Else - Actions
                • Set KB_ReducedReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] / KB_MaxDistance[KB_GeneralIntegers[1]]) x KB_ReachedDistance[KB_GeneralIntegers[1]])
                • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = (KB_ReducedReal - (KB_ReduceSpeedReal[KB_GeneralIntegers[1]] x 0.10))
                • Set KB_TempReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] - KB_ReduceSpeedReal[KB_GeneralIntegers[1]]) x 2.00)
                • Set KB_TempPoint[1] = (Position of KB_Units[KB_GeneralIntegers[1]])
                • Set KB_TempPoint[2] = (KB_TempPoint[1] offset by KB_TempReal towards KB_Angle[KB_GeneralIntegers[1]] degrees)
                • Set KB_EffectCounter[KB_GeneralIntegers[1]] = (KB_EffectCounter[KB_GeneralIntegers[1]] + 1)
                • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = (KB_EffectCounter2[KB_GeneralIntegers[1]] + 1)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KB_DestroyTrees[KB_GeneralIntegers[1]] = Yes
                  • Then - Actions
                    • Destructible - Pick every destructible within 200.00 of KB_TempPoint[2] and do (Actions)
                      • Loop - Actions
                        • Destructible - Kill (Picked destructible)
                  • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KB_EffectCounter[KB_GeneralIntegers[1]] = 6
                  • Then - Actions
                    • Set KB_EffectCounter[KB_GeneralIntegers[1]] = 0
                    • Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_1[KB_GeneralIntegers[1]]
                    • Special Effect - Destroy (Last created special effect)
                  • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KB_EffectCounter2[KB_GeneralIntegers[1]] = 8
                  • Then - Actions
                    • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
                    • Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_2[KB_GeneralIntegers[1]]
                    • Special Effect - Destroy (Last created special effect)
                  • Else - Actions
                • Unit - Move KB_Units[KB_GeneralIntegers[1]] instantly to KB_TempPoint[2]
                • Custom script: call RemoveLocation (udg_KB_TempPoint[1])
                • Custom script: call RemoveLocation (udg_KB_TempPoint[2])
                • Set KB_ReachedDistance[KB_GeneralIntegers[1]] = (KB_ReachedDistance[KB_GeneralIntegers[1]] + KB_TempReal)
          • Else - Actions
 

Vunjo

Hosted Project: SC
Level 14
Joined
Jul 1, 2010
Messages
1,340
47? I thought it was 64. So basically, you should aim for a timer period of 1.5625 :D But because people like me have crap computers and get general FPS of 35 ish, 0.03125 seems optimal (32 FPS). Why? IDK LOL.

35 FPS is high. ^^ I played wc3 on 1 to 10 FPS for 4 years, and I get used to it :D
Anyway, every 0.05 or 0.10 would be the best timer, with no laggz..
 
Level 9
Joined
Jun 25, 2009
Messages
427
Here's the trigger, but this pushes unit back, how to change it to front of unit??
  • Events
    • Unit - A unit using an item
  • Conditions
    • Item beign manipulated = Item beign manipulated of type Force Staff
  • Actions
    • Set KBA_Caster = (Triggering unit)
    • Set KBA_TargetUnit = (Target unit of ability being cast)
    • Set KBA_StartingPosition = (Position of (Triggering unit))
    • Set KBA_Level = (Level of (Ability being cast) for (Triggering unit))
    • Set KBA_Speed = 9.00
    • Set KBA_DistancePerLevel = 150.00
    • Set KBA_SpecialEffects[1] = Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
    • Set KBA_SpecialEffects[2] = Abilities\Spells\Orc\FeralSpirit\feralspiritdone.mdl
    • Set KBA_DestroyTrees = Yes
    • Trigger - Run Cast A Knockback <gen> (checking conditions)
Cast A Knockback Trigger
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (KBA_TargetUnit is in KB_KnockbackedUnits) = Yes
      • Then - Actions
        • Unit Group - Remove KBA_TargetUnit from KB_KnockbackedUnits
        • Set KB_CountBuffs = (KB_CountBuffs - 1)
        • For each (Integer KB_GeneralIntegers[2]) from 1 to KB_TotalKnockUnits, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • KB_Units[KB_GeneralIntegers[1]] = KBA_TargetUnit
              • Then - Actions
                • Set KB_GeneralIntegers[1] = KB_GeneralIntegers[2]
                • Set KB_GeneralIntegers[2] = KB_TotalKnockUnits
              • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • KB_TotalKnockUnits More than KB_GeneralIntegers[1]
          • Then - Actions
            • Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
            • Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
            • Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
            • Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
            • Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
            • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
            • Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
            • Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
            • Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
            • Set KB_DestroyTrees[KB_GeneralIntegers[1]] = KB_DestroyTrees[KB_TotalKnockUnits]
            • Set KB_EffectCounter[KB_GeneralIntegers[1]] = KB_EffectCounter[KB_TotalKnockUnits]
            • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = KB_EffectCounter2[KB_TotalKnockUnits]
            • Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
          • Else - Actions
        • Set KB_Units[KB_TotalKnockUnits] = None Unit
        • Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • KB_CountBuffs = 0
          • Then - Actions
            • Set KB_TotalKnockUnits = 0
            • Trigger - Turn off Get Knockback <gen>
          • Else - Actions
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • KB_CountBuffs = 0
      • Then - Actions
        • Trigger - Turn on Get Knockback <gen>
      • Else - Actions
    • Set KB_CountBuffs = (KB_CountBuffs + 1)
    • Set KB_TotalKnockUnits = (KB_TotalKnockUnits + 1)
    • Set KB_Casters[KB_TotalKnockUnits] = KBA_Caster
    • Set KB_Levels[KB_TotalKnockUnits] = KBA_Level
    • Set KB_Units[KB_TotalKnockUnits] = KBA_TargetUnit
    • Set KB_StartPositions[KB_TotalKnockUnits] = KBA_StartingPosition
    • Set KB_TempPoint[KB_TotalKnockUnits] = (Position of KBA_TargetUnit)
    • Set KB_Angle[KB_TotalKnockUnits] = (Angle from KB_StartPositions[KB_TotalKnockUnits] to KB_TempPoint[KB_TotalKnockUnits])
    • Set KB_MaxDistance[KB_TotalKnockUnits] = (KBA_DistancePerLevel x (Real(KBA_Level)))
    • Set KB_ReachedDistance[KB_TotalKnockUnits] = 0.00
    • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = 0.00
    • Set KB_SpecificSpeed[KB_TotalKnockUnits] = KBA_Speed
    • Set KB_Effects_1[KB_TotalKnockUnits] = KBA_SpecialEffects[1]
    • Set KB_Effects_2[KB_TotalKnockUnits] = KBA_SpecialEffects[2]
    • Set KB_DestroyTrees[KB_TotalKnockUnits] = KBA_DestroyTrees
    • Set KB_EffectCounter[KB_GeneralIntegers[1]] = 0
    • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
    • Unit Group - Add KBA_TargetUnit to KB_KnockbackedUnits
    • Custom script: call RemoveLocation (udg_KBA_StartingPosition)
    • Custom script: call RemoveLocation (udg_KB_TempPoint [udg_KB_TotalKnockUnits] )
    • Custom script: call RemoveLocation (udg_KB_StartPositions [udg_KB_TotalKnockUnits] )
And Get A Knockback Trigger:
  • Events
    • Time - Every 0.02 seconds of game time
  • Akcje
    • For each (Integer KB_GeneralIntegers[1]) from 1 to KB_TotalKnockUnits, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (KB_Units[KB_GeneralIntegers[1]] is in KB_KnockbackedUnits) = Yes
          • Then - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • KB_ReachedDistance[KB_GeneralIntegers[1]] More or Equal KB_MaxDistance[KB_GeneralIntegers[1]]
              • Then - Actions
                • Unit Group - Remove KB_Units[KB_GeneralIntegers[1]] from KB_KnockbackedUnits
                • Set KB_CountBuffs = (KB_CountBuffs - 1)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KB_TotalKnockUnits More than KB_GeneralIntegers[1]
                  • Then - Actions
                    • Set KB_Levels[KB_GeneralIntegers[1]] = KB_Levels[KB_TotalKnockUnits]
                    • Set KB_Units[KB_GeneralIntegers[1]] = KB_Units[KB_TotalKnockUnits]
                    • Set KB_Angle[KB_GeneralIntegers[1]] = KB_Angle[KB_TotalKnockUnits]
                    • Set KB_MaxDistance[KB_GeneralIntegers[1]] = KB_MaxDistance[KB_TotalKnockUnits]
                    • Set KB_ReachedDistance[KB_GeneralIntegers[1]] = KB_ReachedDistance[KB_TotalKnockUnits]
                    • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = KB_ReduceSpeedReal[KB_TotalKnockUnits]
                    • Set KB_SpecificSpeed[KB_GeneralIntegers[1]] = KB_SpecificSpeed[KB_TotalKnockUnits]
                    • Set KB_Effects_1[KB_GeneralIntegers[1]] = KB_Effects_1[KB_TotalKnockUnits]
                    • Set KB_Effects_2[KB_GeneralIntegers[1]] = KB_Effects_2[KB_TotalKnockUnits]
                    • Set KB_DestroyTrees[KB_GeneralIntegers[1]] = KB_DestroyTrees[KB_TotalKnockUnits]
                    • Set KB_EffectCounter[KB_GeneralIntegers[1]] = KB_EffectCounter[KB_TotalKnockUnits]
                    • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = KB_EffectCounter2[KB_TotalKnockUnits]
                    • Set KB_GeneralIntegers[1] = (KB_GeneralIntegers[1] - 1)
                  • Else - Actions
                • Set KB_Units[KB_TotalKnockUnits] = None Unit
                • Set KB_TotalKnockUnits = (KB_TotalKnockUnits - 1)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KB_CountBuffs= 0
                  • Then - Actions
                    • Set KB_TotalKnockUnits = 0
                    • Trigger - Turn off (This trigger)
                  • Else - Actions
              • Else - Actions
                • Set KB_ReducedReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] / KB_MaxDistance[KB_GeneralIntegers[1]]) x KB_ReachedDistance[KB_GeneralIntegers[1]])
                • Set KB_ReduceSpeedReal[KB_GeneralIntegers[1]] = (KB_ReducedReal - (KB_ReduceSpeedReal[KB_GeneralIntegers[1]] x 0.10))
                • Set KB_TempReal = ((KB_SpecificSpeed[KB_GeneralIntegers[1]] - KB_ReduceSpeedReal[KB_GeneralIntegers[1]]) x 2.00)
                • Set KB_TempPoint[1] = (Position of KB_Units[KB_GeneralIntegers[1]])
                • Set KB_TempPoint[2] = (KB_TempPoint[1] offset by KB_TempReal towards KB_Angle[KB_GeneralIntegers[1]] degrees)
                • Set KB_EffectCounter[KB_GeneralIntegers[1]] = (KB_EffectCounter[KB_GeneralIntegers[1]] + 1)
                • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = (KB_EffectCounter2[KB_GeneralIntegers[1]] + 1)
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KB_DestroyTrees[KB_GeneralIntegers[1]] = Yes
                  • Then - Actions
                    • Destructible - Pick every destructible within 200.00 of KB_TempPoint[2] and do (Actions)
                      • Loop - Actions
                        • Destructible - Kill (Picked destructible)
                  • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KB_EffectCounter[KB_GeneralIntegers[1]] = 6
                  • Then - Actions
                    • Set KB_EffectCounter[KB_GeneralIntegers[1]] = 0
                    • Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_1[KB_GeneralIntegers[1]]
                    • Special Effect - Destroy (Last created special effect)
                  • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • KB_EffectCounter2[KB_GeneralIntegers[1]] = 8
                  • Then - Actions
                    • Set KB_EffectCounter2[KB_GeneralIntegers[1]] = 0
                    • Special Effect - Create a special effect at KB_TempPoint[1] using KB_Effects_2[KB_GeneralIntegers[1]]
                    • Special Effect - Destroy (Last created special effect)
                  • Else - Actions
                • Unit - Move KB_Units[KB_GeneralIntegers[1]] instantly to KB_TempPoint[2]
                • Custom script: call RemoveLocation (udg_KB_TempPoint[1])
                • Custom script: call RemoveLocation (udg_KB_TempPoint[2])
                • Set KB_ReachedDistance[KB_GeneralIntegers[1]] = (KB_ReachedDistance[KB_GeneralIntegers[1]] + KB_TempReal)
          • Else - Actions

dude, the trigger is SOOOOOOOOOOOOOOOOOO long and SOOOOOOOOOOOOOOOOOOOOOOO hard for you to understand. Even for me it's eyes pop-out like :D

My idea is this:

  • Force Staff
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Item Dispel (with cooldown)
    • Actions
      • Set Forcer = (Triggering unit)
      • Unit - Turn collision for (Triggering unit) Off
      • Set Force_Distance = 600.00
      • Trigger - Turn on Force Staff Loop <gen>
  • Force Staff Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Force_Distance Less than or equal to 0.00
        • Then - Actions
          • Unit - Turn collision for Forcer On
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • Set Force_Pos = (Position of Forcer)
          • Set Force_Pos_Off = (Force_Pos offset by 50.00 towards (Facing of Forcer) degrees)
          • Destructible - Pick every destructible within 150.00 of Force_Pos 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 Summer Tree Wall
                • Then - Actions
                  • Destructible - Kill (Picked destructible)
                • Else - Actions
          • Unit - Move Forcer instantly to Force_Pos_Off
          • Special Effect - Create a special effect attached to the origin of Forcer using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
          • Set Force_Sfx = (Last created special effect)
          • Special Effect - Destroy Force_Sfx
          • Set Force_Distance = (Force_Distance - 50.00)
          • Custom script: call RemoveLocation(udg_Force_Pos)
          • Custom script: call RemoveLocation(udg_Force_Pos_Off)
I might have missed something, but i will be back in few minutes and tested if this works correctly (;

EDIT: Checked, did it by myself, attaching a test map. Changed the triggers
Don't mind the map name, i use this map to help hivers, you can find some other things inside the map.
 

Attachments

  • Chain Link by Tiche3.w3x
    28.8 KB · Views: 106
Last edited:
Off Topic:
Check my approved Switch system (aka -switch or -so) and +rep for it :) (Newer version of Switch system is coming up) http://www.hiveworkshop.com/forums/s...-v1-2c-161670/

*Me* - Creator of map - SwoN (Secret war of Nature), which currently is 0.23 version, 0.24 version is at beta stage (82.5% done).
You are not allowed to ask for rep, even in your signature, please remove that!
 
Status
Not open for further replies.
Top