Can someone tell me why this spell isn't working im a noobie
The spell is meant to freeze all units in the target area for a short time.
The problem is that when i cast it on lots of enemy units the game lags for a long time but when i cast it on like one unit its fine. The lag only occurs once the spell is finished.
The spell is meant to freeze all units in the target area for a short time.
Trigger:
- Time Field
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- (Ability being cast) Equal to Time Field
- Actions
- Set TimeFieldCaster = (Triggering unit)
- Set TimeFieldLoc = (Target point of ability being cast)
- Unit - Create 1 Time Field Dummy for (Owner of (Triggering unit)) at TimeFieldLoc facing Default building facing degrees
- Set TimeFieldDummy = (Last created unit)
- Animation - Change TimeFieldDummy flying height to 100.00 at 0.00
- Custom script: set bj_wantDestroyGroup=true
- Unit Group - Pick every unit in (Units within 400.00 of TimeFieldLoc matching (((Matching unit) Not equal to (Casting unit)) and (((Matching unit) is alive) Equal to True))) and do (Actions)
- Loop - Actions
- Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
- Unit - Pause (Picked unit)
- Animation - Change (Picked unit)'s vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
- Loop - Actions
- Trigger - Turn on Time FieldUnits <gen>
- Wait (3.00 + (Real((Level of Time Field for (Triggering unit))))) seconds
- Trigger - Turn off Time FieldUnits <gen>
- Unit - Remove TimeFieldDummy from the game
- Set TimeFieldUnits = (Units within 400.00 of TimeFieldLoc)
- Custom script: set bj_wantDestroyGroup = true
- Unit Group - Pick every unit in TimeFieldUnits and do (Actions)
- Loop - Actions
- Animation - Change (Picked unit)'s animation speed to 100.00% of its original speed
- Unit - Unpause (Picked unit)
- Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
- Loop - Actions
- Custom script: call RemoveLocation(udg_TimeFieldLoc)
- Custom script: call DestroyGroup (udg_TimeFieldUnits)
- Events
Trigger:
- Time FieldUnits
- Events
- Time - Every 0.25 seconds of game time
- Conditions
- Actions
- Custom script: set bj_wantDestroyGroup = true
- Unit Group - Pick every unit in (Units within 400.00 of TimeFieldLoc matching ((Matching unit) Not equal to TimeFieldCaster)) and do (Actions)
- Loop - Actions
- Animation - Change (Picked unit)'s animation speed to 0.00% of its original speed
- Unit - Pause (Picked unit)
- Animation - Change (Picked unit)'s vertex coloring to (100.00%, 0.00%, 0.00%) with 0.00% transparency
- Loop - Actions
- Events
The problem is that when i cast it on lots of enemy units the game lags for a long time but when i cast it on like one unit its fine. The lag only occurs once the spell is finished.