colinjames12
Member
- Reaction score
- 0
Can somebody tell me how to reduce the lag in this trigger. It always generates lag after I use it and I'm not sure why. I have lots of trigger similar to that kind of periodic event and they don't lag. I'm not sure about this one because it always start to lag after I use it. The spell is based on shockwave ability and the units in the periodic event are dummy units. The periodic event is initially turned off and only turns on for 0.38 sec based on the howling gale trigger.
Trigger:
- howling gale
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Howling Gale
- Actions
- Set howlingunit = (Triggering unit)
- Set howlingpoint = (Position of howlingunit)
- Set howlingtargetpoint = (Target point of ability being cast)
- Set howlingpoint_Copy = (howlingpoint offset by 325.00 towards (Angle from howlingpoint to howlingtargetpoint) degrees)
- Sound - Play howling_gale <gen> at 100.00% volume, attached to (Triggering unit)
- Sound - Play GyrocopterImpactHit1 <gen> at 100.00% volume, attached to (Triggering unit)
- Unit - Pause (Triggering unit)
- Animation - Play (Triggering unit)'s spell animation
- Trigger - Turn on howling gale Copy <gen>
- Wait 0.38 seconds
- Trigger - Turn off howling gale Copy <gen>
- Sound - Play GyrocopterImpactHit2 <gen> at 100.00% volume, attached to (Triggering unit)
- Custom script: call RemoveLocation(udg_howlingpoint_Copy)
- Set howlingpoint_Copy = (howlingpoint offset by 325.00 towards (Angle from howlingtargetpoint to howlingpoint) degrees)
- Animation - Play (Triggering unit)'s spell animation
- Trigger - Turn on howling gale Copy <gen>
- Wait 0.38 seconds
- Trigger - Turn off howling gale Copy <gen>
- Unit - Unpause (Triggering unit)
- Custom script: call RemoveLocation(udg_howlingtargetpoint)
- Custom script: call RemoveLocation(udg_howlingpoint)
- Custom script: call RemoveLocation(udg_howlingpoint_Copy)
- Custom script: call DestroyGroup (udg_howlinggroup)
- Events
Trigger:
- howling gale Copy
- Events
- Time - Every 0.05 seconds of game time
- Conditions
- Actions
- Unit - Create 1 Howling Gale 2 for (Owner of howlingunit) at howlingtargetpoint facing Default building facing degrees
- Unit - Kill (Last created unit)
- Set howlingtargetpoint_Copy = (howlingpoint_Copy offset by (Random real number between 250.00 and 400.00) towards (Random real number between 0.00 and 360.00) degrees)
- Unit - Create 1 Howling Gale for (Owner of howlingunit) at howlingtargetpoint_Copy facing Default building facing degrees
- Unit - Kill (Last created unit)
- Custom script: call RemoveLocation(udg_howlingtargetpoint_Copy)
- Set howlingtargetpoint_Copy = (howlingpoint_Copy offset by (Random real number between 75.00 and 250.00) towards (Random real number between 0.00 and 360.00) degrees)
- Unit - Create 1 Howling Gale 2 for (Owner of howlingunit) at howlingtargetpoint_Copy facing Default building facing degrees
- Unit - Kill (Last created unit)
- Custom script: call RemoveLocation(udg_howlingtargetpoint_Copy)
- Set howlinggroup = (Units within 450.00 of howlingpoint_Copy matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an ally of (Owner of howlingunit)) Equal to False) and ((((Matching unit) i
- Unit Group - Pick every unit in howlinggroup and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of Howling Gale for howlingunit) Equal to 1
- Then - Actions
- Unit - Cause howlingunit to damage (Picked unit), dealing (1.50 x ((Real((Strength of howlingunit (Include bonuses)))) + (Real((Agility of howlingunit (Include bonuses)))))) damage of attack type Chaos and damage type Normal
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of Howling Gale for howlingunit) Equal to 2
- Then - Actions
- Unit - Cause howlingunit to damage (Picked unit), dealing (2.25 x ((Real((Strength of howlingunit (Include bonuses)))) + (Real((Agility of howlingunit (Include bonuses)))))) damage of attack type Chaos and damage type Normal
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of Howling Gale for howlingunit) Equal to 3
- Then - Actions
- Unit - Cause howlingunit to damage (Picked unit), dealing (3.00 x ((Real((Strength of howlingunit (Include bonuses)))) + (Real((Agility of howlingunit (Include bonuses)))))) damage of attack type Chaos and damage type Normal
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Custom script: call DestroyGroup (udg_howlinggroup)
- Events