Hello everyone.
If I understand correctly, this is the place to make a post when you need help to fix a trigger that has already been started and is almost functional.
I need help to fix some problems with a trigger for a spell.
Overall I'm working on a MOBA map and one of the heroes is illusion based, his passive gives him a chance to create an illusion when he attacks an enemy, his ultimate works as "Mirror Image", his first active allows him to teleport to an enemy and have a chance to create an illusion, finally his second active (the one that is causing problems) allows him to cast a "Fan of knives" and make the illusions near him cast it too.
I modified the animation of the "Fan of Knives" projectile by the "Black Arrow" projectile so that it is more visible (there are two animations to modify).
Concerning the objective of the spell itself:
Level 1: Only the hero casts "Fan of Knives".
Level 2: The hero and a nearby illusion (area of 800 and this is the case for all levels) cast "Fan of Knives".
Level 3: The hero and two illusions cast "Fan of Knives".
Level 4: The hero and three illusions cast "Fan of Knives
Here is the trigger I have created for the moment:
_________________________________________________________________________________________________________________________________________________________________________
Deluge des ombres Configuration
Event
Unit - A unit Initie starts the effect of an ability
Conditions
(Ability being cast) Egal à Déluge des ombres
Actions
Set DDO_caster = (Triggering unit)
Set DDO_caster_loc = (Position of DDO_caster)
Set DDO_groupe = (Units within 800.00 of DDO_caster_loc matching ((((Matching unit) is an illusion) Egal à TRUE) and ((Owner of (Matching unit)) Egal à (Owner of DDO_caster))))
Unit group - Pick every unit in DDO_groupe and do (Actions)
Loop - Actions
If ((Level of Déluge des ombres for DDO_caster) Equal to 1) then do (Do nothing) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Déluge des ombres for DDO_caster) Equal to 2
(Number of units in DDO_groupe) Less than or equal to ((Level of Déluge des ombres for DDO_caster) - 1)
Then - Actions
Unit - Create 1 Dummy DDO for (Owner of DDO_caster) at (Position of (Random unit from DDO_groupe)) facing Orientation bàtiment par défaut degrees
Set DDO_dummy = (Last created unit)
Unit - Add a 1.00 second Générique expiration timer to DDO_dummy
Unit - Add Déluge des ombres Dummy to DDO_dummy
Unit - Set level of Déluge des ombres Dummy for DDO_dummy to 2
Unit - Order DDO_dummy to Garde elfe de la nuit - Tourbillon de lames
Else - Actions
If ((Number of units in DDO_groupe) Greater than ((Level of Déluge des ombres for DDO_caster) - 1)) then do (Unit group - Remove (Picked unit) from DDO_groupe) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Déluge des ombres for DDO_caster) Equal to 3
(Number of units in DDO_groupe) Less than or equal to ((Level of Déluge des ombres for DDO_caster) - 1)
Then - Actions
Unit - Create 1 Dummy DDO for (Owner of DDO_caster) at (Position of (Random unit from DDO_groupe)) facing Orientation bàtiment par défaut degrees
Set DDO_dummy = (Last created unit)
Unit - Add a 1.00 second Générique expiration timer to DDO_dummy
Unit - Add Déluge des ombres Dummy to DDO_dummy
Unit - Set level of Déluge des ombres Dummy for DDO_dummy to 3
Unit - Order DDO_dummy to Garde elfe de la nuit - Tourbillon de lames
Else - Actions
If ((Number of units in DDO_groupe) Greater than ((Level of Déluge des ombres for DDO_caster) - 1)) then do (Unit group - Remove (Picked unit) from DDO_groupe) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Déluge des ombres for DDO_caster) Equal to 4
(Number of units in DDO_groupe) Less than or equal to ((Level of Déluge des ombres for DDO_caster) - 1)
Then - Actions
Unit - Create 1 Dummy DDO for (Owner of DDO_caster) at (Position of (Random unit from DDO_groupe)) facing Orientation bàtiment par défaut degrees
Set DDO_dummy = (Last created unit)
Unit - Add a 1.00 second Générique expiration timer to DDO_dummy
Unit - Add Déluge des ombres Dummy to DDO_dummy
Unit - Set level of Déluge des ombres Dummy for DDO_dummy to 4
Unit - Order DDO_dummy to Garde elfe de la nuit - Tourbillon de lames
Then - Actions
If ((Number of units in DDO_groupe) Greater than ((Level of Déluge des ombres for DDO_caster) - 1)) then do (Unit group - Remove (Picked unit) from DDO_groupe) else do (Do nothing)
_________________________________________________________________________________________________________________________________________________________________________
Problem with the spell:
The first problem was that if the number of illusions was not equal to the level of spell-1 "(Number of units in DDO_group) Less than or equal to ((Level of Deluge of Shadows for DDO_caster) - 1)", nothing happened and just the hero cast "Fan of Knives". Basically if two illusions were to cast "Fan of Knives" and there were 3 illusions on the field it didn't work, there had to be two illusions and that was it. I managed to fix the problem with "If ((Number of units in DDO_group) Greater than ((Level of Shadow Flood for DDO_caster) - 1)) then do (Group unit - Remove (Picked unit) from DDO_group) else do (Do nothing)", I don't know if it's the right solution but it works and it allows to remove from the group the excess illusions.
After this fix, the second problem was that the number of illusions casting "Fan of Knives" was random from levels three and four of the spell. When there was only one illusion that could cast the spell everything worked fine, but when two or three were needed the number of illusions casting the spell was random. So for level 3 of the spell there was sometimes only one illusion that cast the spell instead of two, and for level 4 sometimes two or one illusion instead of three. So the objective was almost achieved, the spell did not seem to work properly randomly.
I then thought that the problem was with "(Position of (Random unit from DDO_groupe))" and so replaced "Random Unit" with "Picked Unit". However this time the problem was not the same, but there was still a problem. For level 3 and 4 of the spell the number of illusions that cast "Fan of Knives" was still one more than it should be. So at level 3 it was three illusions that cast the spell, and at level 4 four illusions. I don't know why it worked for level 2. I tried changing some of the values from "(Number of units in DDO_group) Less than or equal to ((Level of Shadow casting for DDO_caster) - 1)" to a fixed value like 2 or 3 but it still didn't work.
So I went back to step two of the problem and now I'm turning to you in the hope that you can help me solve it.
Thanks in advance to all those who will help me to solve the problem.
Kind regards.
PS: I'm working only on GUI
If I understand correctly, this is the place to make a post when you need help to fix a trigger that has already been started and is almost functional.
I need help to fix some problems with a trigger for a spell.
Overall I'm working on a MOBA map and one of the heroes is illusion based, his passive gives him a chance to create an illusion when he attacks an enemy, his ultimate works as "Mirror Image", his first active allows him to teleport to an enemy and have a chance to create an illusion, finally his second active (the one that is causing problems) allows him to cast a "Fan of knives" and make the illusions near him cast it too.
I modified the animation of the "Fan of Knives" projectile by the "Black Arrow" projectile so that it is more visible (there are two animations to modify).
Concerning the objective of the spell itself:
Level 1: Only the hero casts "Fan of Knives".
Level 2: The hero and a nearby illusion (area of 800 and this is the case for all levels) cast "Fan of Knives".
Level 3: The hero and two illusions cast "Fan of Knives".
Level 4: The hero and three illusions cast "Fan of Knives
Here is the trigger I have created for the moment:
-
Deluge des ombres Configuration
-
Evénements
-
Unité - A unit Initie l'effet d'une compétence
-
-
Conditions
-
(Ability being cast) Egal à Déluge des ombres
-
-
Actions
-
Set DDO_caster = (Triggering unit)
-
Set DDO_caster_loc = (Position of DDO_caster)
-
Set DDO_groupe = (Units within 800.00 of DDO_caster_loc matching ((((Matching unit) is an illusion) Egal à TRUE) and ((Owner of (Matching unit)) Egal à (Owner of DDO_caster))))
-
Groupe unité - Pick every unit in DDO_groupe and do (Actions)
-
Boucle - Actions
-
If ((Level of Déluge des ombres for DDO_caster) Egal à 1) then do (Do nothing) else do (Do nothing)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si - Conditions
-
(Level of Déluge des ombres for DDO_caster) Egal à 2
-
(Number of units in DDO_groupe) Inférieur ou égal à ((Level of Déluge des ombres for DDO_caster) - 1)
-
-
Alors - Actions
-
Unité - Create 1 Dummy DDO for (Owner of DDO_caster) at (Position of (Random unit from DDO_groupe)) facing Orientation bâtiment par défaut degrees
-
Set DDO_dummy = (Last created unit)
-
Unité - Add a 1.00 second Générique expiration timer to DDO_dummy
-
Unité - Add Déluge des ombres Dummy to DDO_dummy
-
Unité - Set level of Déluge des ombres Dummy for DDO_dummy to 2
-
Unité - Order DDO_dummy to Garde elfe de la nuit - Tourbillon de lames
-
-
Sinon - Actions
-
If ((Number of units in DDO_groupe) Supérieur à ((Level of Déluge des ombres for DDO_caster) - 1)) then do (Groupe unité - Remove (Picked unit) from DDO_groupe) else do (Do nothing)
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si - Conditions
-
(Level of Déluge des ombres for DDO_caster) Egal à 3
-
(Number of units in DDO_groupe) Inférieur ou égal à ((Level of Déluge des ombres for DDO_caster) - 1)
-
-
Alors - Actions
-
Unité - Create 1 Dummy DDO for (Owner of DDO_caster) at (Position of (Random unit from DDO_groupe)) facing Orientation bâtiment par défaut degrees
-
Set DDO_dummy = (Last created unit)
-
Unité - Add a 1.00 second Générique expiration timer to DDO_dummy
-
Unité - Add Déluge des ombres Dummy to DDO_dummy
-
Unité - Set level of Déluge des ombres Dummy for DDO_dummy to 3
-
Unité - Order DDO_dummy to Garde elfe de la nuit - Tourbillon de lames
-
-
Sinon - Actions
-
If ((Number of units in DDO_groupe) Supérieur à ((Level of Déluge des ombres for DDO_caster) - 1)) then do (Groupe unité - Remove (Picked unit) from DDO_groupe) else do (Do nothing)
-
-
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Si - Conditions
-
(Level of Déluge des ombres for DDO_caster) Egal à 4
-
(Number of units in DDO_groupe) Inférieur ou égal à ((Level of Déluge des ombres for DDO_caster) - 1)
-
-
Alors - Actions
-
Unité - Create 1 Dummy DDO for (Owner of DDO_caster) at (Position of (Random unit from DDO_groupe)) facing Orientation bâtiment par défaut degrees
-
Set DDO_dummy = (Last created unit)
-
Unité - Add a 1.00 second Générique expiration timer to DDO_dummy
-
Unité - Add Déluge des ombres Dummy to DDO_dummy
-
Unité - Set level of Déluge des ombres Dummy for DDO_dummy to 4
-
Unité - Order DDO_dummy to Garde elfe de la nuit - Tourbillon de lames
-
-
Sinon - Actions
-
If ((Number of units in DDO_groupe) Supérieur à ((Level of Déluge des ombres for DDO_caster) - 1)) then do (Groupe unité - Remove (Picked unit) from DDO_groupe) else do (Do nothing)
-
-
-
-
-
-
_________________________________________________________________________________________________________________________________________________________________________
Deluge des ombres Configuration
Event
Unit - A unit Initie starts the effect of an ability
Conditions
(Ability being cast) Egal à Déluge des ombres
Actions
Set DDO_caster = (Triggering unit)
Set DDO_caster_loc = (Position of DDO_caster)
Set DDO_groupe = (Units within 800.00 of DDO_caster_loc matching ((((Matching unit) is an illusion) Egal à TRUE) and ((Owner of (Matching unit)) Egal à (Owner of DDO_caster))))
Unit group - Pick every unit in DDO_groupe and do (Actions)
Loop - Actions
If ((Level of Déluge des ombres for DDO_caster) Equal to 1) then do (Do nothing) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Déluge des ombres for DDO_caster) Equal to 2
(Number of units in DDO_groupe) Less than or equal to ((Level of Déluge des ombres for DDO_caster) - 1)
Then - Actions
Unit - Create 1 Dummy DDO for (Owner of DDO_caster) at (Position of (Random unit from DDO_groupe)) facing Orientation bàtiment par défaut degrees
Set DDO_dummy = (Last created unit)
Unit - Add a 1.00 second Générique expiration timer to DDO_dummy
Unit - Add Déluge des ombres Dummy to DDO_dummy
Unit - Set level of Déluge des ombres Dummy for DDO_dummy to 2
Unit - Order DDO_dummy to Garde elfe de la nuit - Tourbillon de lames
Else - Actions
If ((Number of units in DDO_groupe) Greater than ((Level of Déluge des ombres for DDO_caster) - 1)) then do (Unit group - Remove (Picked unit) from DDO_groupe) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Déluge des ombres for DDO_caster) Equal to 3
(Number of units in DDO_groupe) Less than or equal to ((Level of Déluge des ombres for DDO_caster) - 1)
Then - Actions
Unit - Create 1 Dummy DDO for (Owner of DDO_caster) at (Position of (Random unit from DDO_groupe)) facing Orientation bàtiment par défaut degrees
Set DDO_dummy = (Last created unit)
Unit - Add a 1.00 second Générique expiration timer to DDO_dummy
Unit - Add Déluge des ombres Dummy to DDO_dummy
Unit - Set level of Déluge des ombres Dummy for DDO_dummy to 3
Unit - Order DDO_dummy to Garde elfe de la nuit - Tourbillon de lames
Else - Actions
If ((Number of units in DDO_groupe) Greater than ((Level of Déluge des ombres for DDO_caster) - 1)) then do (Unit group - Remove (Picked unit) from DDO_groupe) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Déluge des ombres for DDO_caster) Equal to 4
(Number of units in DDO_groupe) Less than or equal to ((Level of Déluge des ombres for DDO_caster) - 1)
Then - Actions
Unit - Create 1 Dummy DDO for (Owner of DDO_caster) at (Position of (Random unit from DDO_groupe)) facing Orientation bàtiment par défaut degrees
Set DDO_dummy = (Last created unit)
Unit - Add a 1.00 second Générique expiration timer to DDO_dummy
Unit - Add Déluge des ombres Dummy to DDO_dummy
Unit - Set level of Déluge des ombres Dummy for DDO_dummy to 4
Unit - Order DDO_dummy to Garde elfe de la nuit - Tourbillon de lames
Then - Actions
If ((Number of units in DDO_groupe) Greater than ((Level of Déluge des ombres for DDO_caster) - 1)) then do (Unit group - Remove (Picked unit) from DDO_groupe) else do (Do nothing)
_________________________________________________________________________________________________________________________________________________________________________
Problem with the spell:
The first problem was that if the number of illusions was not equal to the level of spell-1 "(Number of units in DDO_group) Less than or equal to ((Level of Deluge of Shadows for DDO_caster) - 1)", nothing happened and just the hero cast "Fan of Knives". Basically if two illusions were to cast "Fan of Knives" and there were 3 illusions on the field it didn't work, there had to be two illusions and that was it. I managed to fix the problem with "If ((Number of units in DDO_group) Greater than ((Level of Shadow Flood for DDO_caster) - 1)) then do (Group unit - Remove (Picked unit) from DDO_group) else do (Do nothing)", I don't know if it's the right solution but it works and it allows to remove from the group the excess illusions.
After this fix, the second problem was that the number of illusions casting "Fan of Knives" was random from levels three and four of the spell. When there was only one illusion that could cast the spell everything worked fine, but when two or three were needed the number of illusions casting the spell was random. So for level 3 of the spell there was sometimes only one illusion that cast the spell instead of two, and for level 4 sometimes two or one illusion instead of three. So the objective was almost achieved, the spell did not seem to work properly randomly.
I then thought that the problem was with "(Position of (Random unit from DDO_groupe))" and so replaced "Random Unit" with "Picked Unit". However this time the problem was not the same, but there was still a problem. For level 3 and 4 of the spell the number of illusions that cast "Fan of Knives" was still one more than it should be. So at level 3 it was three illusions that cast the spell, and at level 4 four illusions. I don't know why it worked for level 2. I tried changing some of the values from "(Number of units in DDO_group) Less than or equal to ((Level of Shadow casting for DDO_caster) - 1)" to a fixed value like 2 or 3 but it still didn't work.
So I went back to step two of the problem and now I'm turning to you in the hope that you can help me solve it.
Thanks in advance to all those who will help me to solve the problem.
Kind regards.
PS: I'm working only on GUI
Attachments
Last edited: