Since it concerns triggers i think it is a better idea to post it there.
Hey there again! I'm trying to make a passive ability that would teleport enemy away from the caster on attack and i need that to be MUI since there might be multiple caster.
here's what i've done:
i got two triggers VS2 start and VS2 effect. The start one checks if attacking unit have the skill at all, then whether the skill occur on this attack, then if attacking unit have the mana required. After that it sets attacking unit to be the caster and attacked unit to be the target with current vsIndex value for an arrays and finily runs the VS1 effect trigger and reduce caster's mana by the "manacost" amount.
Now to the effect trigger i use to make enemy dissapear when he actually take damage. So as the event Unit - (vsTaget[vsIndex]) recieves damage is added the actions is as follows:
i assume it leaks the position of unit which should be dealt with by storing unit's position in varaible and then destroying it, but i just cant get the hold of that idea so if smone would explain that to me or link me to a good tutorial about that one specificaly (not the whole "leaks removal" ones) that would be much appreciated.
But in general: am i doing it right? or is it still needs fixing? the first " buggy " thing i encountered from that trigger is that i cannot increase the vsIndex right after the effect trigger should be run like this:
and i'm a litle woried that this part could mess everything when 3 or more units would cast that skill simultaniously and the index would increase only after the first target would take damage thus making it possible to reset vsCaster and vsTarget to a new values discarding the first units effect leaving the first target in the same place.
The second problem is that the targeted unit gets thrown back a greater distance instead of what is required (i assume it multipies the base value by 2 or smth like that) with each consecutive hit. Could that be because i do not store the location in a variable or is it caused by smth else?
And finily is it really MUI? I started to experiment with indexing units a while ago so might do it wrong.
Thx for your time!
Hey there again! I'm trying to make a passive ability that would teleport enemy away from the caster on attack and i need that to be MUI since there might be multiple caster.
here's what i've done:
i got two triggers VS2 start and VS2 effect. The start one checks if attacking unit have the skill at all, then whether the skill occur on this attack, then if attacking unit have the mana required. After that it sets attacking unit to be the caster and attacked unit to be the target with current vsIndex value for an arrays and finily runs the VS1 effect trigger and reduce caster's mana by the "manacost" amount.
-
VS2 start
-

Events
-


Unit - A unit is attacked
-
-

Conditions
-


(Random integer number between 1 and 100) is less than 17
-


(Level of r6 vanishing strike lv2 for (Attacking unit)) is more than 0
-


(Mana of (Attacking unit)) is more or equals 15.00
-
-

Actions
-


Set vsCaster[vsIndex] = (Attacking unit)
-


Set vsTarget[vsIndex] = (Attacked unit)
-


Trigger - Add to VS1 effect <gen> the event (Unit - vsTarget[vsIndex] recieves damage)
-


Unit - Set mana of (vsCaster[vsIndex]) to ((Mana of (vsCaster[vsIndex])) - 15.00)
-
-
-
VS2 effect
-

Events
-

Conditions
-

Actions
-


Unit - Move vsTarget[vsIndex] instantly to ((Position of vsTarget[vsIndex]) offset by 400.00 towards (Facing of vsCaster[vsIndex]) degrees)
-


Set vsIndex = (vsIndex + 1)
-
-
But in general: am i doing it right? or is it still needs fixing? the first " buggy " thing i encountered from that trigger is that i cannot increase the vsIndex right after the effect trigger should be run like this:
-
Actions
-

Set vsCaster[vsIndex] = (Attacking unit)
-

Set vsTarget[vsIndex] = (Attacked unit)
-

Trigger - Add to VS1 effect <gen> the event (Unit - vsTarget[vsIndex] recieves damage)
-

Set vsIndex = (vsIndex +1)
-
The second problem is that the targeted unit gets thrown back a greater distance instead of what is required (i assume it multipies the base value by 2 or smth like that) with each consecutive hit. Could that be because i do not store the location in a variable or is it caused by smth else?
And finily is it really MUI? I started to experiment with indexing units a while ago so might do it wrong.
Thx for your time!
Last edited:




