- Joined
- Dec 27, 2010
- Messages
- 15
Hey
Im making this map where a Slayer is created by placing a specific item on a player owned circle of power (Which can be built anywhere) and casting the "Summon Slayer" ability.
I have this trigger which checks if the item is the right type (Ice Shard) and then acts accordingly. However there are a few problems.
Major Issue:
-The trigger always lags for a few seconds when a Slayer is summoned successfully
Minor Issues: (Trivial but would be nice to fix)
-It can only be used by one player at a time (Only takes a second to run)
-Memory leaks (Only runs about 6 times per game)
-Uses unnecessary variables?
So I don't really mind about the minor stuff, but its very messy and I'm not really sure how to go about cleaning it up. If anyone could help out with the lag whenever it runs successfully, that'd be great. Here it is:

Im making this map where a Slayer is created by placing a specific item on a player owned circle of power (Which can be built anywhere) and casting the "Summon Slayer" ability.
I have this trigger which checks if the item is the right type (Ice Shard) and then acts accordingly. However there are a few problems.
Major Issue:
-The trigger always lags for a few seconds when a Slayer is summoned successfully
Minor Issues: (Trivial but would be nice to fix)
-It can only be used by one player at a time (Only takes a second to run)
-Memory leaks (Only runs about 6 times per game)
-Uses unnecessary variables?
So I don't really mind about the minor stuff, but its very messy and I'm not really sure how to go about cleaning it up. If anyone could help out with the lag whenever it runs successfully, that'd be great. Here it is:
-
Slayer Summoning
-

Events
-


Unit - A unit Begins casting an ability
-
-

Conditions
-


(Ability being cast) Equal to Summon Slayer
-
-

Actions
-


Trigger - Turn off (This trigger)
-


Set CastingUnitSS = (Casting unit)
-


Item - Pick every item in (Region centered at (Position of CastingUnitSS) with size (128.00, 128.00)) and do (Actions)
-



Loop - Actions
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Item-type of (Picked item)) Equal to Ice Shard
-
-





Then - Actions
-






Unit - Remove Summon Slayer from CastingUnitSS
-






Set BooleanIceShardYN[((Player number of (Owner of CastingUnitSS)) - 1)] = True
-






Set IceShard[((Player number of (Owner of CastingUnitSS)) - 1)] = (Picked item)
-
-





Else - Actions
-






Set BooleanIceShardYN[((Player number of (Owner of CastingUnitSS)) - 1)] = False
-
-
-
-
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




BooleanIceShardYN[((Player number of (Owner of CastingUnitSS)) - 1)] Equal to True
-
-



Then - Actions
-




Item - Remove IceShard[((Player number of (Owner of CastingUnitSS)) - 1)]
-




Special Effect - Create a special effect at (Position of CastingUnitSS) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
-




Unit - Create 1 Slayer for (Owner of CastingUnitSS) at (Position of CastingUnitSS) facing 270.00 degrees
-




Game - Display to (All players) the text: ((Name of (Owner of CastingUnitSS)) + has summoned a |cffffcc00Slayer.|r)
-
-



Else - Actions
-




Game - Display to (Player group((Owner of CastingUnitSS))) the text: |c00ff0000No effect...
-
-
-


Trigger - Turn on (This trigger)
-
-






