sentrywiz
S
sentrywiz
I wonder, what is a simple yet effective trigger for those "skillshot" missile spells. Assuming I already have the spell based on Shockwave for example.
I've been triggering them but they always seem kind of slow and even though I clear the leaks I can see, they make the game laggy in the long run, like after 10 or so minutes. That means there are leaks I am not cleaning properly.
So can you make an example of yours for a GUI trigger that would handle skillshot spells, I want to learn a better way to do it. Also, is it better to create one trigger that would move all dummy units or make each spell in two triggers?
Here is my example of how I make the trigger if you want to compare.
This is from my "Weapons Arena" map. Also take note that after 5 or so
minutes, the game gets laggy in-game.
I've been triggering them but they always seem kind of slow and even though I clear the leaks I can see, they make the game laggy in the long run, like after 10 or so minutes. That means there are leaks I am not cleaning properly.
So can you make an example of yours for a GUI trigger that would handle skillshot spells, I want to learn a better way to do it. Also, is it better to create one trigger that would move all dummy units or make each spell in two triggers?
Here is my example of how I make the trigger if you want to compare.
This is from my "Weapons Arena" map. Also take note that after 5 or so
minutes, the game gets laggy in-game.
-
Staff Launch
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Attack (Staff)
-
Actions
- Set staff_caster = (Casting unit)
- Set loc_start = (Position of staff_caster)
- Set loc_end = (Target point of ability being cast)
- Unit - Create 1 Staff Dummy for (Owner of staff_caster) at loc_start facing (Facing of staff_caster) degrees
- Set the_ball = (Last created unit)
- Unit Group - Add the_ball to staff_group
- Set total_staff_balls = (total_staff_balls + 1)
- Trigger - Turn on Move Ball <gen>
- Custom script: call RemoveLocation ( udg_loc_start )
- Custom script: call RemoveLocation ( udg_loc_end )
-
Events
-
Move Ball
-
Events
- Time - Every 0.04 seconds of game time
- Conditions
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in staff_group) Equal to 0
-
Then - Actions
- Trigger - Turn off (This trigger)
-
Else - Actions
-
Unit Group - Pick every unit in staff_group and do (Actions)
-
Loop - Actions
- Set moving_ball = (Picked unit)
- Set index_staff = (Player number of (Owner of moving_ball))
- Set loc_move = (Position of moving_ball)
- Set staff_hit = (Units within 110.00 of loc_move matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an enemy of (Owner of moving_ball)) Equal to True)))
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- staff_range_ctr[index_staff] Less than (Integer(ITEM_Staff_Range[index_staff]))
- (moving_ball is in forbidden_group) Not equal to True
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Number of units in staff_hit) Greater than 0
-
Then - Actions
- Set ball_hit_target = (Random unit from staff_hit)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Mastery_Melee[(Player number of (Owner of ball_hit_target))] Equal to True
-
Then - Actions
- Unit - Cause staff_caster to damage ball_hit_target, dealing 45.00 damage of attack type Normal and damage type Universal
- Floating Text - Create floating text that reads -45 above ball_hit_target with Z offset 0.00, using font size 8.00, color (100.00%, 5.00%, 0.00%), and 40.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
- Special Effect - Create a special effect attached to the origin of ball_hit_target using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
- Special Effect - Destroy (Last created special effect)
- Set Player_MagicKSpree[index_staff] = (Player_MagicKSpree[index_staff] + 45)
-
Else - Actions
- Unit - Cause staff_caster to damage ball_hit_target, dealing 50.00 damage of attack type Normal and damage type Universal
- Floating Text - Create floating text that reads -50 above ball_hit_target with Z offset 0.00, using font size 8.00, color (100.00%, 5.00%, 0.00%), and 40.00% transparency
- Floating Text - Set the velocity of (Last created floating text) to 75.00 towards 90.00 degrees
- Floating Text - Change (Last created floating text): Disable permanence
- Floating Text - Change the lifespan of (Last created floating text) to 1.00 seconds
- Special Effect - Create a special effect attached to the origin of ball_hit_target using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
- Special Effect - Destroy (Last created special effect)
- Set Player_MagicKSpree[index_staff] = (Player_MagicKSpree[index_staff] + 50)
-
If - Conditions
- Unit Group - Remove moving_ball from staff_group
- Set staff_range_ctr[index_staff] = 0
- Set total_staff_balls = (total_staff_balls - 1)
- Unit - Remove moving_ball from the game
-
Else - Actions
- Set loc_move2 = (loc_move offset by 35.00 towards (Facing of moving_ball) degrees)
- Set staff_range_ctr[index_staff] = (staff_range_ctr[index_staff] + 35)
- Unit - Move moving_ball instantly to loc_move2
- Custom script: call RemoveLocation ( udg_loc_move2 )
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
- Unit Group - Remove moving_ball from forbidden_group
- Set staff_range_ctr[index_staff] = 0
- Set total_staff_balls = (total_staff_balls - 1)
- Unit - Remove moving_ball from the game
- Unit Group - Remove moving_ball from staff_group
-
If - Conditions
- Custom script: call RemoveLocation ( udg_loc_move )
- Custom script: call DestroyGroup ( udg_staff_hit )
-
Loop - Actions
-
Unit Group - Pick every unit in staff_group and do (Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events