• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] ability problem

Status
Not open for further replies.
Level 13
Joined
Jan 30, 2012
Messages
1,298
i've learned single Kamehameha from Valkemiere's family kamehameha, but i encounter a problem. when to unit using kamehameha: one will stucked/paused, and one will do kamehameha finely. I'm sure there is somethin'. so please for your help, i will thankful for it. for someone who want to check/test it this the file.
i forgot to add player blue so add it by yourself :grin:

edited:
Sound and effect belongs to Valkemiere
Goku model belongs to orgrim
Cell model belongs to.. i'm forgot :grin:


http://www.hiveworkshop.com/forums/pastebin_data/ys19bs/_files/Kamehameha%20DL.w3x
 
Last edited:
Level 13
Joined
Jan 30, 2012
Messages
1,298
here you go :thumbs_up:

  • Kamehameha
  • Events
    • - A unit start the effect of an ability
  • Conditions
    • - Ability being cast equal to Kamehameha
  • Action
    • Set Int[1] = 0
    • Set Caster[1] = Casting Unit
    • Set Point[1] = Position of Caster
    • Set Point[2] = Target Point of Ability being cast
    • Set Angle[1] = Angle from Point[1] to Point[2]
    • Unit - Pause Caster
    • Animation - Play Caster's spell slam Animation
    • Animation - Change Caster[1]'s animation speed to 15.00% of its original speed
    • Wait 0.10 seconds
    • Sound - Play super_kame_charge2 <gen>
    • Sound - Set pitch of (Last played sound) to 0.80
    • -------- ----------------------------------- --------
    • Unit - Create 1 DustWave for (Owner of Caster[1]) at Point[1] facing Default building facing degrees
    • Animation - Change (Last created unit)'s animation speed to 300.00% of its original speed
    • Animation - Change (Last created unit)'s size to (500.00%, 500.00%, 500.00%) of its original size
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
    • -------- ----------------------------------- --------
    • Unit - Create 1 Almagest for (Owner of Caster[1]) at (Point[1] offset by 80.00 towards (Angle[1] - 80.00) degrees) facing Default building facing degrees
    • Animation - Change (Last created unit)'s size to (45.00%, 45.00%, 45.00%) of its original size
    • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
    • Unit Group - Add (Last created unit) to Group[1]
    • -------- ----------------------------------- --------
    • Unit - Create 1 DummyBibang for (Owner of Caster[1]) at (Point[1] offset by 80.00 towards (Angle[1] - 90.00) degrees) facing Default building facing degrees
    • Animation - Change (Last created unit)'s animation speed to 20.00% of its original speed
    • Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
    • Unit Group - Add (Last created unit) to Group[1]
    • Set Group[2] = (Units within 2500.00 of Point[1] matching (((Matching unit) is A Hero) Equal to True))
    • Unit Group - Pick every unit in Group[2] and do (Actions)
      • Loop - Actions
        • Camera - Shake the camera for (Owner of (Picked unit)) with magnitude 5.00
        • Camera - Sway the camera source for (Owner of (Picked unit)) with magnitude 10.00 and velocity 3.00
    • Custom script: call DestroyGroup(udg_Group[2])
    • Wait 1.50 seconds
    • -------- ----------------------------------- --------
    • Unit - Create 1 FreezingRingas for (Owner of Caster[1]) at Point[1] facing Default building facing degrees
    • Unit - Add a 0.03 second Generic expiration timer to (Last created unit)
    • Animation - Change (Last created unit)'s animation speed to 30.00% of its original speed
    • Unit - Create 1 FreezingRingas for (Owner of Caster[1]) at Point[1] facing Default building facing degrees
    • Unit - Add a 0.03 second Generic expiration timer to (Last created unit)
    • Animation - Change (Last created unit)'s animation speed to 30.00% of its original speed
    • -------- ----------------------------------- --------
    • Wait 1.00 seconds
    • Animation - Play Caster[1]'s spell throw animation
    • Sound - Play kamehameha_fire2 <gen>
    • Sound - Set pitch of (Last played sound) to 0.80
    • Set Point[3] = (Point[1] offset by 80.00 towards Angle[1] degrees)
    • Unit Group - Pick every unit in Group[1] and do (Actions)
      • Loop - Actions
        • Unit - Move (Picked unit) instantly to Point[3]
    • -------- ----------------------------------- --------
    • Unit - Create 1 Thunder for (Owner of Caster[1]) at Point[3] facing Default building facing degrees
    • Unit - Add a 0.03 second Generic expiration timer to (Last created unit)
    • Animation - Change (Last created unit)'s animation speed to 30.00% of its original speed
    • Unit - Create 1 Thunder for (Owner of Caster[1]) at Point[3] facing Angle[1] degrees
    • Unit - Add a 0.03 second Generic expiration timer to (Last created unit)
    • Animation - Change (Last created unit)'s animation speed to 30.00% of its original speed
    • -------- ----------------------------------- --------
    • Unit - Create 1 valkkame for (Owner of Caster[1]) at Point[3] facing Angle[1] degrees
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
    • Unit - Create 1 KmeRlease for (Owner of Caster[1]) at Point[3] facing Angle[1] degrees
    • Unit - Add a 0.03 second Generic expiration timer to (Last created unit)
    • Animation - Change (Last created unit)'s animation speed to 30.00% of its original speed
    • Unit - Create 1 Howl 2 for (Owner of Caster[1]) at Point[3] facing Angle[1] degrees
    • Unit - Add a 0.03 second Generic expiration timer to (Last created unit)
    • Animation - Change (Last created unit)'s animation speed to 30.00% of its original speed
    • Unit - Create 1 Howl 2 for (Owner of Caster[1]) at Point[3] facing Angle[1] degrees
    • Unit - Add a 0.03 second Generic expiration timer to (Last created unit)
    • Animation - Change (Last created unit)'s animation speed to 30.00% of its original speed
    • -------- ----------------------------------- --------
    • Unit - Create 1 KameBall for (Owner of Caster[1]) at Point[3] facing Angle[1] degrees
    • Set Caster[2] = (Last created unit)
    • Animation - Change (Last created unit)'s animation speed to 300.00% of its original speed
    • Animation - Change (Last created unit)'s size to (1500.00%, 1500.00%, 1500.00%) of its original size
    • Animation - Change (Last created unit)'s animation speed to 0.00% of its original speed
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
    • Set Int[1] = 1
    • Trigger - Turn on Kamehameha 1 <gen>
  • Kamehameha Loop
  • Events
    • - Time - Every 0.03 seconds of game time
  • Conditions
  • Action
  • Set Int[1] = (Int[1] + 1)
  • Set Point[4] = (Position of Caster[2])
  • Set Point[5] = (Point[4] offset by 35.00 towards Angle[1] degrees)
  • Unit - Move Caster[2] instantly to Point[5]
  • Unit - Create 1 KameBall for (Owner of Caster[1]) at Point[4] facing Default building facing degrees
  • Destructible - Pick every destructible within 250.00 of Point[4] and do (Actions)
    • Loop - Actions
      • Destructible - Kill (Picked destructible)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Int[1] Equal to 17
    • Then - Actions
      • Unit - Create 1 purge for (Owner of Caster[1]) at Point[4] facing Angle[1] degrees
      • Unit - Add a 0.03 second Generic expiration timer to (Last created unit)
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Int[1] Equal to 22
        • Then - Actions
          • Unit - Create 1 Howl for (Owner of Caster[1]) at Point[4] facing Angle[1] degrees
          • Unit - Add a 0.03 second Generic expiration timer to (Last created unit)
          • Set Int[1] = 0
        • Else - Actions
  • Unit Group - Pick every unit in (Units within 250.00 of Point[4] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster[1])) Equal to True) and ((((Matching unit) is A structure) Equal to False) and do (Actions)
    • Loop - Actions
      • Unit - Kill Caster[2]
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • ((Caster[2] is dead) Equal to True) or ((Caster[1] has buff Stunned (Pause)) Equal to True)
    • Then - Actions
      • Animation - Change Caster[1]'s animation speed to 100.00% of its original speed
      • Unit Group - Pick every unit in Group[1] and do (Actions)
        • Loop - Actions
          • Unit Group - Remove (Picked unit) from Group[1]
      • Trigger - Turn off (This trigger)
      • Unit - Unpause Caster[1]
      • Animation - Play Caster[1]'s stand animation
      • Unit Group - Pick every unit in (Units owned by (Owner of Caster[1]) of type KameBall) and do (Unit - Remove (Picked unit) from the game)
      • Set Group[2] = (Units within 2500.00 of Point[1] matching (((Matching unit) is A Hero) Equal to True))
      • Unit Group - Pick every unit in Group[2] and do (Actions)
        • Loop - Actions
          • Camera - Stop swaying/shaking the camera for (Owner of (Picked unit))
      • Sound - Play redeemer_explosionsound <gen>
      • Sound - Set pitch of (Last played sound) to 0.80
      • Sound - Play db_flying2 <gen>
      • Sound - Set pitch of (Last played sound) to 0.80
      • Sound - Play telekinesis_charge <gen>
      • Sound - Set pitch of (Last played sound) to 0.80
      • Unit - Create 1 explosion for (Owner of Caster[1]) at Point[4] facing Default building facing degrees
      • Unit - Add a 0.03 second Generic expiration timer to (Last created unit)
      • Set Group[3] = (Units within 700.00 of Point[4] matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster[1])) Equal to True) and (((Matching unit) is A structure) Equal to False))))
      • Unit Group - Pick every unit in Group[3] and do (Actions)
        • Loop - Actions
          • Unit - Cause Caster[1] to damage (Picked unit), dealing (100.00 x (Real((Intelligence of Caster[1] (Exclude bonuses))))) damage of attack type Spells and damage type Force
      • Custom script: call DestroyGroup(udg_Group[1])
      • Custom script: call DestroyGroup(udg_Group[2])
      • Custom script: call DestroyGroup(udg_Group[3])
      • Custom script: call RemoveLocation(udg_Point[1])
      • Custom script: call RemoveLocation(udg_Point[2])
      • Custom script: call RemoveLocation(udg_Point[3])
      • Custom script: call RemoveLocation(udg_Point[4])
      • Custom script: call RemoveLocation(udg_Point[5])
    • Else - Actions
      • Custom script: call RemoveLocation(udg_Point[4])
      • Custom script: call RemoveLocation(udg_Point[5])
 
Last edited:
Level 28
Joined
Sep 26, 2009
Messages
2,520
If more than 1 unit casts this "Kamehameha" spell at the same time, then the spell will bug simply because the spell is not MUI (MUI = Multi-instanceability, which means that you trigger the spell in such fashion, that more than 1 unit will be able to cast it successfully at the same time).
In your spell let's say Kael is the caster of this spell. The trigger will set him as "Caster[1]". After 1 second Uther starts casting this spell as well. Now the trigger sets that Caster[1] is Uther, not Kael.
The rest of the trigger will (twice) refer to Uther, since he is Caster[1] at that time, leaving Kael with no action at all.

What to do? You will need to index each unit - so when Kael starts casting this ability, he will be set as for example Caster[1] and when Uther starts casting this ability X seconds later, he will be refered as to Caster[2], and so on.
To understand indexing better, look at tutorials -> Trigger sections.
You can also look at thread made by Deathismyfriend - http://www.hiveworkshop.com/forums/tutorial-submission-283/things-gui-user-should-know-233242/ look at Section2 -> Chapter 12 (How to Index) to get basic idea of how indexing works.

also you will need to index Int[] and probably change this spell into different "phases" and use 1 global loop trigger so the spell executes for each caster correctly.

=====
There are quite a lot of things that don't make any sense in your trigger though.

1. Try to avoid "wait" actions, in most case they are used incorrectly, making the spell non-MUI
2. In your first trigger that "Wait: 0,1 second" is inaccurate. Whenever you set Wait to lower value than 0,27, the Wait will be random - from 0,1 to 0,3

3. You have many leaks - dynamic group leaks, sound leaks and some point leaks
Look at http://www.hiveworkshop.com/forums/triggers-scripts-269/things-leak-35124/

4. This may be wrong or correct, depending on what you are trying to achieve.
a)
You crate Almagest and DummyBibang units, give them limited life and add them to Group[1], then after 2,5 seconds you move all units in Group[1] to Point[3]
Moving those units is useless, because they will die after 1,5 seconds, and after 1 additional secnod you move them - you're basically moving dead units.
But this way is correct if what those units (I guess they represent some graphical effect) have long "death" animation and you want to move them just when they play this death animation.

b)
You create many different units (which I assume are all graphical effect dummy units) and then you use this action:
Add a 0.03 second Generic expiration timer to (Last created unit)
- you set their life to 0,03 seconds.
This is most likely wrong, since 0,03-0,05 is really short interval, in fact this interval is used when moving units to give you (= your eyes) the idea that something "moves fluently" - in other words, you will most likely just see a blink of a unit with this life span.
If you want to see the death animation of that unit, why don't you just create the unit and then kill it immediately? It will play death animation as well.

5.
This is not really something wrong, but it may help you in the long run:
In your first trigger, after you pick all units in Group[1] and move them, your next action is "Create Thunder for owner of caster", then you do 2 actions for that unit and then you duplicate all 3 lines again.
You can use the action "For each loop (your integer) from 1 to 2 do actions". This will create those 2 units. The good thing about this is that if you were to made changes to those 3 lines about the Thunder unit, you don't need to do that manually for each unit.
Loops especially come handy when you create more than 2 units in specific order.
The same can be applied to your "Howl" unit and its actions

6.
The last part of your first trigger - the part about KameBall.
You change its animation speed to 300%, then increase its size and then you change animation speed to 0%.
This makes no sense, since the execution of those actions is really fast, the unit will spawn immediately with 0% animation speed - you will not see that 300% animation speed.

7.
I don't see you use Point[1], [2] and [3] in your second trigger, then there is also no reason to have them in the first place - remove those location at the end of your first trigger.

8.
This is just in case - In your second trigger, right after the start you pick every destructible and kill it - however that way you will also destroy all pathing blockers in that area

9.
In your second trigger you pick every unit within 250 of Caster[2] and then inside the loop you kill that Caster[2] - in other words for every unit that is within 250 you kill Caster[2]. Furthermore, the next action you do is check if Caster[2] is dead or Caster[1] is stunned.

Instead you could do it this way:
Set group = units within 250 or Caster[2]
And then go through If/Then/Else
If
- Number of units in group is greater than 0
or
- Caster[1] is stunned
Then
kill Cater[2]
and the rest of your actions in the ITE

10.
The whole action:
"Unit Group - Pick every unit in (Units owned by (Owner of Caster[1]) of type KameBall) and do (Unit - Remove (Picked unit) from the game)"
permanently leaks.
Never use the "Pick every unit of type" action. Instead use Pick every unit in region matching condition and as a condition use "unit-type of (matching unit) equal to *your unit type*"
Also the action is not really needed, instead it can cause more problems?
If more units of the same player cast Kamehameha and one finishes it, then all KameBalls will disappear.
You already kill Caster[2] which is the correct KameBall. If you don't want to see its death animation, or decay animation, then simply change in object editor its "Art - Death Time" to 0 and "Combat - Death type" to "can't raise, does not decay"

11.
Caster[1] starts the effect of the ability, then is paused; in second trigger after KameBall "hits" someone you unpause Caster[1]. Also order Caster[1] to stop, else he will continue casting this spell.
 
Level 13
Joined
Jan 30, 2012
Messages
1,298
Nichilus, thanks.. i still need much to learn

defskull said:
Have you ever noticed maps like that don't support -sh (Same Hero) mode ?
Because those spells are not MUI :)

no, i never noticed

defskull said:
Think about it
.

yeah i will

deathismyfriend said:
@TO
can u use hidden tags for ur triggers since they are stretching the page ? thanks

sure..

i still not understand the MUI things, what make it so different with GUI?
anyway thanks for the feedback
 
MUI means multi unit instanceable
This means that multiple units can cast a spell at the same time and it wont bug up.

GUI is graphic User interface
GUI is the trigger editor.

There is more on MUI in my tutorial. There is also links to other helpful tutorials.
To make something MUI u need to either index the spell ( there is a chapter in my tutorial on how to index.) or u have to use hashtables. I personally prefer indexing.
Here is my tutorial http://www.hiveworkshop.com/forums/tutorial-submission-283/things-gui-user-should-know-233242/

Edit: also thanks for changing the trigger in ur old post to hidden. It makes it easier to quote and edit posts like i just did here lol.
 
Level 13
Joined
Jan 30, 2012
Messages
1,298
something i forgot to ask you.. MUI is not MUI if the trigger using wait action, am i right?
so if you have suggestion, how can i replaced the wait action?
if i'm wrong? what action that makes MUI to non-MUI or non-MUI to MUI, this is what i'm not understand.. i've learned this problem is not explained in your tutorial, i hope you understand why i ask you about this, and one more thing, i more thinking to ask you here than your tut, you know your tut has 7 pages and it is hard for me to rep you.. hope you understand, thanks
 
Level 30
Joined
Nov 29, 2012
Messages
6,637
something i forgot to ask you.. MUI is not MUI if the trigger using wait action, am i right?
so if you have suggestion, how can i replaced the wait action?
if i'm wrong? what action that makes MUI to non-MUI or non-MUI to MUI, this is what i'm not understand.. i've learned this problem is not explained in your tutorial, i hope you understand why i ask you about this, and one more thing, i more thinking to ask you here than your tut, you know your tut has 7 pages and it is hard for me to rep you.. hope you understand, thanks

Well, you can try making a timer. But I think even you have wait it can still be an MUI spell.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
The only way a trigger becomes MUI with waits is when you use local player or local unit. "Triggering unit" is local unit.

This is MUI
  • Triggers
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Unit - Change color of (Triggering unit) to Green
      • Unit - Add Devotion Aura (Neutral Hostile) to (Triggering unit)
      • Wait 5.00 seconds
      • Unit - Change color of (Triggering unit) to (Color of (Owner of (Triggering unit)))
      • Unit - Remove Devotion Aura (Neutral Hostile) from (Triggering unit)
Each unit that casts Animate Dead will have its color changed to green and have Devotion aura add; 5 seconds later it will have color changed back and devotion aura will be removed.
Note how I refer only to (triggering unit) - that is because it is local unit and will thus ensure the trigger to be MUI

This is not MUI
  • Triggers
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Unit - Change color of (Casting unit) to Green
      • Wait 5.00 seconds
      • Unit - Change color of (Casting unit) to (Color of (Owner of (Casting unit)))
Casting unit (and practically all other types like Damage Source, Target unit of ability being cast, etc.; except (triggering unit) of course) are not local units, meaning that they refer to only 1 unit - in other words, if unit starts casting this ability, it will be (casting unit), however if during that 5 second wait another unit - let's call it UnitB - casts a spell, then UnitB will be now casting unit. So after 5 second the trigger would try to change color of UnitB, instead of unit who cast Animate Dead 5 seconds eariler.

  • Triggers
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animate Dead
    • Actions
      • Set Unit_var = (Triggering unit)
      • Unit - Change color of Unit_var to Green
      • Wait 5.00 seconds
      • Unit - Change color of Unit_var to (Color of (Owner of Unit_var))
This is also not MUI, because the variable Unit_var stores only 1 unit (= it can only remember 1 unit). If UnitA casts animate dead, Unit_var will be UnitA, however if UnitB casts animate dead, Unit_var will get overwritten and will now refer to UnitB instead.


This is why you are supposed to index units. That way you will set
Unit_var[1] = UnitA
Unit_var[2] = UnitB
and that way each Unit_var[x] stores correct unit and no bug will be ensured.

Read both these tutorials, they should explain and solve your problem
http://www.hiveworkshop.com/forums/trigger-gui-editor-tutorials-279/mui-triggers-waits-218354/
http://www.hiveworkshop.com/forums/...279/mui-spells-using-artificial-waits-223315/
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
what about point/location? are they supposed to be indexed too? and also dummy? how about it?
It depends on how you use them.

If the location is dynamic, but bound to caster (i.e. position of Caster; or position of caster off set by X) and you only need that location for stuff you create immediately (= without any delay), then you don't need to index it.
To such location most map makers refer to as temporal points - i.e. points that we set up, immediately create something there and also immediately delete, to prevent leaks. Something like this
  • Untitled Trigger 001
    • Actions
      • Set TempPoint = (Position of (Triggering unit))
      • Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_TempPoint)
      • Custom script: set udg_TempPoint = null
There are no delays and we don't need that point anymore once we created special effect there.

However if you had a spell where you for example target ground and in 360 range from that point all units will be damaged periodically, then you will need to index this point.
That is because you will need that same point for as long as the spell lasts, the point will be static and you would not be able to call it later if you didn't save it into array.

--------------
About dummies - same as with locations. In your spell all those dummy units you create that don't do anything but die after X seconds, you don't need to index those. However KameBalls are in the game for some times and you move them and kill them later; for that you will need to index them/save them into array.
 
Level 13
Joined
Jan 30, 2012
Messages
1,298
Now is this MUI? :vw_wtf:

Naruto Rasengan
  • Rasengan
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rasengan
    • Actions
      • Set Index = (Index + 1)
      • -------- ------------------------------------- --------
      • Set Caster[Index] = (Triggering unit)
      • Set Target[Index] = (Target unit of ability being cast)
      • -------- ------------------------------------- --------
      • Unit - Pause Caster[Index]
      • Animation - Play Caster[Index]'s stand ready animation
      • Special Effect - Create a special effect attached to the hand left of Caster[Index] using Abilities\Spells\Other\Charm\CharmTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the hand left of Caster[Index] using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
      • Set Effect[Index] = (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Rasengan 1 <gen>
        • Else - Actions
  • Rasengan 1
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TempIndex) from 1 to Index, do (Actions)
        • Loop - Actions
          • Set Point = (Position of Caster[TempIndex])
          • Set Point1 = (Position of Target[TempIndex])
          • Set Point2 = (Point offset by 35.00 towards (Angle from Point to (Position of Target[TempIndex])) degrees)
          • Unit - Move Caster[TempIndex] instantly to Point2
          • Unit - Turn collision for Caster[TempIndex] Off
          • Special Effect - Create a special effect at Point using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set Distance_KB = (Distance between Point and Point1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Distance_KB Less than or equal to 150.00
            • Then - Actions
              • Special Effect - Destroy Effect[TempIndex]
              • Set Group = (Units within 500.00 of (Position of Target[TempIndex]) matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster[TempIndex])) Equal to True) and (((Matching unit) is A structure) Not equal to True))))
              • Unit Group - Pick every unit in Group and do (Actions)
                • Loop - Actions
                  • Unit - Cause Caster[TempIndex] to damage Target[TempIndex], dealing (150.00 x (Real((Level of Rasengan for Caster[TempIndex])))) damage of attack type Spells and damage type Normal
              • Custom script: call DestroyGroup(udg_Group)
              • Unit - Unpause Caster[TempIndex]
              • Unit - Turn collision for Caster[TempIndex] On
              • Unit - Order Caster[TempIndex] to Stop
              • Custom script: call RemoveLocation(udg_Point)
              • Custom script: call RemoveLocation(udg_Point1)
              • Custom script: call RemoveLocation(udg_Point2)
              • Set Caster[TempIndex] = Caster[Index]
              • Set Target[TempIndex] = Target[Index]
              • Set Caster[Index] = No unit
              • Set Target[Index] = No unit
              • Set Index = (Index - 1)
              • Set TempIndex = (TempIndex - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Level 13
Joined
Jan 30, 2012
Messages
1,298
It looks like it is. U leak a location when u set point2 tho. U leak a location when setting ur group also. Replace both of the position of with point1. Also move the removeLocation custom script out of the then block or u leak. And move the index check that turns off ur trigger out of the integer loop.
like this?

  • Rasengan
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Rasengan
    • Actions
      • Set Index = (Index + 1)
      • -------- ------------------------------------- --------
      • Set Caster[Index] = (Triggering unit)
      • Set Target[Index] = (Target unit of ability being cast)
      • -------- ------------------------------------- --------
      • Unit - Pause Caster[Index]
      • Animation - Play Caster[Index]'s stand ready animation
      • Special Effect - Create a special effect attached to the hand left of Caster[Index] using Abilities\Spells\Other\Charm\CharmTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the hand left of Caster[Index] using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
      • Set Effect[Index] = (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Rasengan 1 <gen>
        • Else - Actions
  • Rasengan 1
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TempIndex) from 1 to Index, do (Actions)
        • Loop - Actions
          • Set Point = (Position of Caster[TempIndex])
          • Set Point1 = (Position of Target[TempIndex])
          • Set Point2 = (Point offset by 35.00 towards (Angle from Point to Point1) degrees)
          • Unit - Move Caster[TempIndex] instantly to Point2
          • Unit - Turn collision for Caster[TempIndex] Off
          • Special Effect - Create a special effect at Point using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set Distance_KB = (Distance between Point and Point1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Distance_KB Less than or equal to 150.00
            • Then - Actions
              • Special Effect - Destroy Effect[TempIndex]
              • Set Group = (Units within 500.00 of Point1 matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster[TempIndex])) Equal to True) and (((Matching unit) is A structure) Not equal to True))))
              • Unit Group - Pick every unit in Group and do (Actions)
                • Loop - Actions
                  • Unit - Cause Caster[TempIndex] to damage Picked Unit, dealing (150.00 x (Real((Level of Rasengan for Caster[TempIndex])))) damage of attack type Spells and damage type Normal
              • Custom script: call DestroyGroup(udg_Group)
              • Unit - Unpause Caster[TempIndex]
              • Unit - Turn collision for Caster[TempIndex] On
              • Unit - Order Caster[TempIndex] to Stop
              • Set Caster[TempIndex] = Caster[Index]
              • Set Target[TempIndex] = Target[Index]
              • Set Caster[Index] = No unit
              • Set Target[Index] = No unit
              • Set Index = (Index - 1)
              • Set TempIndex = (TempIndex - 1)
            • Else - Actions
              • Custom script: call RemoveLocation(udg_Point)
              • Custom script: call RemoveLocation(udg_Point1)
              • Custom script: call RemoveLocation(udg_Point2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Index Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
change it like this.

  • Rasengan 1
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer TempIndex) from 1 to Index, do (Actions)
        • Loop - Actions
          • Set Point = (Position of Caster[TempIndex])
          • Set Point1 = (Position of Target[TempIndex])
          • Set Point2 = (Point offset by 35.00 towards (Angle from Point to Point1) degrees)
          • Unit - Move Caster[TempIndex] instantly to Point2
          • Unit - Turn collision for Caster[TempIndex] Off
          • Special Effect - Create a special effect at Point using Abilities\Spells\Human\HolyBolt\HolyBoltSpecialArt.mdl
          • Special Effect - Destroy (Last created special effect)
          • Set Distance_KB = (Distance between Point and Point1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Distance_KB Less than or equal to 150.00
            • Then - Actions
              • Special Effect - Destroy Effect[TempIndex]
              • Set Group = (Units within 500.00 of Point1 matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster[TempIndex])) Equal to True) and (((Matching unit) is A structure) Not equal to True))))
              • Unit Group - Pick every unit in Group and do (Actions)
                • Loop - Actions
                  • Unit - Cause Caster[TempIndex] to damage Target[TempIndex], dealing (150.00 x (Real((Level of Rasengan for Caster[TempIndex])))) damage of attack type Spells and damage type Normal
              • Custom script: call DestroyGroup(udg_Group)
              • Unit - Unpause Caster[TempIndex]
              • Unit - Turn collision for Caster[TempIndex] On
              • Unit - Order Caster[TempIndex] to Stop
              • Set Caster[TempIndex] = Caster[Index]
              • Set Target[TempIndex] = Target[Index]
              • Set Caster[Index] = No unit
              • Set Target[Index] = No unit
              • Set Index = (Index - 1)
              • Set TempIndex = (TempIndex - 1)
            • Else - Actions
          • Custom script: call RemoveLocation(udg_Point)
          • Custom script: call RemoveLocation(udg_Point1)
          • Custom script: call RemoveLocation(udg_Point2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Index Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
everything else looks good.
 
Level 13
Joined
Jan 30, 2012
Messages
1,298
oh, sure.. one another problem, when the unit cast ability which in the trigger one i give the caster special effect

  • Rasengan
  • Events
  • Unit - A unit Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Rasengan
  • Actions
  • Set Index = (Index + 1)
  • -------- ------------------------------------- --------
  • Set Caster[Index] = (Triggering unit)
  • Set Target[Index] = (Target unit of ability being cast)
  • -------- ------------------------------------- --------
  • Unit - Pause Caster[Index]
  • Animation - Play Caster[Index]'s stand ready animation
  • Special Effect - Create a special effect attached to the hand left of Caster[Index] using Abilities\Spells\Other\Charm\CharmTarget.mdl
  • Special Effect - Destroy (Last created special effect)
  • Special Effect - Create a special effect attached to the hand left of Caster[Index] using Abilities\Spells\Undead\AbsorbMana\AbsorbManaBirthMissile.mdl
  • Set Effect[Index] = (Last created special effect)
and in trigger two i destroy that special effect

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Distance_KB Less than or equal to 150.00
    • Then - Actions
      • Special Effect - Destroy Effect[TempIndex]
      • Set Group = (Units within 500.00 of Point1 matching ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster[TempIndex])) Equal to True) and (((Matching unit) is A structure) Not equal to True))))
      • Unit Group - Pick every unit in Group and do (Actions)
        • Loop - Actions
          • Unit - Cause Caster[TempIndex] to damage (Picked unit), dealing (150.00 x (Real((Level of Rasengan for Caster[TempIndex])))) damage of attack type Spells and damage type Normal
      • Custom script: call DestroyGroup(udg_Group)
      • Unit - Unpause Caster[TempIndex]
      • Unit - Turn collision for Caster[TempIndex] On
      • Unit - Order Caster[TempIndex] to Stop
      • Set Caster[TempIndex] = Caster[Index]
      • Set Target[TempIndex] = Target[Index]
      • Set Caster[Index] = No unit
      • Set Target[Index] = No unit
      • Set Index = (Index - 1)
      • Set TempIndex = (TempIndex - 1)
    • Else - Actions
but when two unit cast, one unit will keep the Effect, the other not.. how i fix it ?
 
Status
Not open for further replies.
Top