I am trying to make my own KnockBack system and i have already make a simple trigger, but there is some where fatal mistake and i can't found it. Can somebody help me? There are the triggers:
Trigger:
- KnockBack
- Events
- Time - Every 0.02 seconds of game time
- Conditions
- Actions
- Unit Group - Pick every unit in KB_Group_KBedUnits and do (Actions)
- Loop - Actions
- For each (Integer A) from 0 to KB_NumberOfUnit, do (Actions)
- Loop - Actions
- Set KB_PositionOfUnit[(Integer A)] = (Position of KB_Unit[(Integer A)])
- Unit - Create 1 KBUnit for Player 1 (Red) at KB_PositionOfUnit[(Integer A)] facing KB_Angle[(Integer A)] degrees
- Unit - Turn collision for (Last created unit) Off
- Unit - Hide (Last created unit)
- Unit - Pause (Last created unit)
- Unit - Move KB_Unit[(Integer A)] instantly to ((Position of (Last created unit)) offset by KB_EachLength[(Integer A)] towards KB_Angle[(Integer A)] degrees)
- Unit - Remove (Last created unit) from the game
- Set KB_ActualKB[(Integer A)] = (KB_ActualKB[(Integer A)] + 1)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- KB_ActualKB[(Integer A)] Equal to KB_NumberOfKBs[(Integer A)]
- Then - Actions
- Unit Group - Remove KB_Unit[(Integer A)] from KB_Group_KBedUnits
- Else - Actions
- If - Conditions
- Loop - Actions
- For each (Integer A) from 0 to KB_NumberOfUnit, do (Actions)
- Loop - Actions
- Unit Group - Pick every unit in KB_Group_KBedUnits and do (Actions)
- Events
Trigger:
- KnockBack 1
- Events
- Unit - A unit Is attacked
- Conditions
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Unit-type of (Attacking unit)) Equal to Footman
- ((Triggering unit) is in KB_Group_KBedUnits) Equal to False
- Then - Actions
- Unit Group - Add (Attacked unit) to KB_Group_KBedUnits
- Set KB_Unit[KB_NumberOfUnit] = (Attacked unit)
- Set KB_PositionOfUnit[KB_NumberOfUnit] = (Position of (Attacked unit))
- Set KB_Angle[KB_NumberOfUnit] = (Facing of (Attacking unit))
- Set KB_WholeLenght[KB_NumberOfUnit] = 500.00
- Set KB_NumberOfKBs[KB_NumberOfUnit] = 10
- Set KB_EachLength[KB_NumberOfUnit] = (KB_WholeLenght[KB_NumberOfUnit] / (Real(KB_NumberOfKBs[KB_NumberOfUnit])))
- Set KB_NumberOfUnit = (KB_NumberOfUnit + 1)
- Else - Actions
- For each (Integer A) from 0 to KB_NumberOfUnit, do (Actions)
- Loop - Actions
- Set KB_WholeLenght[(Integer A)] = (KB_WholeLenght[(Integer A)] + 500.00)
- Set KB_NumberOfKBs[(Integer A)] = (KB_NumberOfKBs[(Integer A)] + 10)
- Set KB_EachLength[(Integer A)] = (KB_WholeLenght[(Integer A)] / (Real(KB_NumberOfKBs[(Integer A)])))
- Loop - Actions
- For each (Integer A) from 0 to KB_NumberOfUnit, do (Actions)
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
Trigger:
- Initialization
- Events
- Map initialization
- Conditions
- Actions
- Set KB_NumberOfUnit = 0
- Events