- Joined
- Jun 26, 2019
- Messages
- 318
Hello. I have problem with the last created unit trigger, and also with the last special effect created. If 2 players casting same ability at same time, it will cause the first unit created and special effect created to becomes not be the last unit created and special effect created anymore because of other player used the same ability at same time or almost same time, you know. I am thinking custom of value, you know, number of player casting the ability? How do you make variables to work like number of player casting ability to match for the last unit created and last special effect created?
How do I make it work with number of player like this?
Example:
(Trigger Player 1)
Event:
Unit begins casting an ability
if
Condition:
Ability being cast equal to Kaboom
Ability being cast equal to Player 1
then
Action:
Create unit with Player 1
Variables with Player 1
Create special effect with Player 1
Variables with Player 1
Triggering Unit with Player 1
(Trigger Player 2)
Event:
Unit begins casting an ability
if
Condition:
Ability being cast equal to Kaboom
Ability being cast equal to Player 2
then
Action:
Create unit with Player 2
Variables with Player 2
Create special effect with Player 2
Variables with Player 2
Triggering Unit with Player 2
(Trigger Player 3)
Event:
Unit begins casting an ability
if
Condition:
Ability being cast equal to Kaboom
Ability being cast equal to Player 3
then
Action:
Create unit with Player 3
Variables with Player 3
Create special effect with Player 3
Variables with Player 3
Triggering Unit with Player 3
-----------------------------------------------------------
-
Cast Capsize2
-
Events
-
Unit - A unit Begins casting an ability
-
-
Conditions
-
(Ability being cast) Equal to Kaboom! (Goblin Sapper)
-
-
Actions
-
Set VariableSet AS_TempPoint[10] = (Position of (Triggering unit))
-
Unit - Create 1 for Neutral Passive at AS_TempPoint[10] facing (Position of (Triggering unit))
-
Set VariableSet ExplosionEffect = (Last created unit)
-
Wait 1.00 seconds
-
Unit - Remove ExplosionEffect from the game
-
Special Effect - Create a special effect at AS_TempPoint[10] using Environment\LargeBuildingFire\LargeBuildingFire1.mdl
-
Set VariableSet SpecialEffect = (Last created special effect)
-
Wait 2.00 seconds
-
Special Effect - Destroy SpecialEffect
-
-
How do I make it work with number of player like this?
Example:
(Trigger Player 1)
Event:
Unit begins casting an ability
if
Condition:
Ability being cast equal to Kaboom
Ability being cast equal to Player 1
then
Action:
Create unit with Player 1
Variables with Player 1
Create special effect with Player 1
Variables with Player 1
Triggering Unit with Player 1
(Trigger Player 2)
Event:
Unit begins casting an ability
if
Condition:
Ability being cast equal to Kaboom
Ability being cast equal to Player 2
then
Action:
Create unit with Player 2
Variables with Player 2
Create special effect with Player 2
Variables with Player 2
Triggering Unit with Player 2
(Trigger Player 3)
Event:
Unit begins casting an ability
if
Condition:
Ability being cast equal to Kaboom
Ability being cast equal to Player 3
then
Action:
Create unit with Player 3
Variables with Player 3
Create special effect with Player 3
Variables with Player 3
Triggering Unit with Player 3
-----------------------------------------------------------