Trigger Help

eloytoro

New Member
Reaction score
4
My idea was to create an ability that creates illusions around the hero when you use it, but the hero is around the illusions created, so the enemy cant spot which is... but its not working, its supposed that lots of mirror image effects around the caster appear when the ability is triggered, instead only appears 1 and the trigger stops right there, so no illusions are created nor the hero appears
Code:
Duplicate
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Duplicate 
    Actions
        Set DuplicateCaster = (Casting unit)
        Set DuplicateCentralPoint = (Position of DuplicateCaster)
        Unit - Hide DuplicateCaster
        For each (Integer A) from 1 to 18, do (Actions)
            Loop - Actions
                Set DuplicateAngle = (DuplicateAngle + 20.00)
                Unit - Create 1 Dummy for (Owner of DuplicateCaster) at (DuplicateCentralPoint offset by 300.00 towards (DuplicateAngle + 6.00) degrees) facing Default building facing degrees
                Set DuplicateDummy[1] = (Last created unit)
                Special Effect - Create a special effect at (Position of DuplicateDummy[1]) using Abilities\Spells\Orc\MirrorImage\MirrorImageCaster.mdl
                For each (Integer A) from 1 to (Level of Duplicate  for DuplicateCaster), do (Actions)
                    Loop - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                DuplicateAngle Equal to ((Real((Integer A))) x (360.00 / (((Real((Level of Duplicate  for DuplicateCaster))) x 2.00) + 1.00)))
                            Then - Actions
                                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    If - Conditions
                                        DuplicateTrueFalse Equal to False
                                    Then - Actions
                                        Unit - Unhide DuplicateCaster
                                        Unit - Move DuplicateCaster instantly to (Position of DuplicateDummy[1])
                                        Set DuplicateTrueFalse = True
                                    Else - Actions
                                        Unit - Create 1 Dummy for (Owner of DuplicateCaster) at (Position of DuplicateCaster) facing Default building facing degrees
                                        Set DuplicateDummy[2] = (Last created unit)
                                        Hero - Create Wand of Illusion Dummy and give it to (Last created unit)
                                        Hero - Order (Last created unit) to use (Last created item) on DuplicateCaster
                                        Unit - Remove DuplicateDummy[2] from the game
                                        Unit Group - Pick every unit in (Units within 350.00 of (Position of DuplicateCaster) matching (((Matching unit) is an illusion) Equal to True)) and do (Actions)
                                            Loop - Actions
                                                Unit - Move (Picked unit) instantly to (Position of DuplicateDummy[1])
                            Else - Actions
                                Do nothing
                Unit - Remove DuplicateDummy[1] from the game
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Two Integer Loops inside each other, bad idea. Use Integer A for the first loop, integer B for the second.

Also it leaks:
Special Effect - Create a special effect at (Position of DuplicateDummy[1])
Why do that? When the poisition of Duplicate dummy[1] already is where the point variable you set is...
More leaks:
Unit - Create 1 Dummy for (Owner of DuplicateCaster) at (Position of DuplicateCaster)
(DuplicateCentralPoint offset by 300.00 towards (DuplicateAngle + 6.00) degrees)

Code:
Else - Actions
                                Do nothing
                Unit - Remove DuplicateDummy[1] from the game
The do nothing, remove it, wc3 does nothing if it is empty.
The last part "unit - remove ...." add a "unit - expiration timer" instead.

Also, the first loop, for each integer 1-18, to me, it looks a bit too big, when it is not needed... How about For each integer 1-10? And raise by +36? Of course, I should mention I have no idea how the spell it supposed to look but...
Edit; if it works, cool, if it still bugs up, show us the new trigger. Also, forgot the part where you hide it. Why? When you create 18 units .... within 0.00 seconds, then you want to unhide the hero again, why not just leave it visible for the whole 0.00 seconds? Which leaves me to this point, no units were shown? Maybe because you remove them 0.00 seconds after you create them. Well...
 

eloytoro

New Member
Reaction score
4
Two Integer Loops inside each other, bad idea. Use Integer A for the first loop, integer B for the second.

Also it leaks:
Special Effect - Create a special effect at (Position of DuplicateDummy[1])
Why do that? When the poisition of Duplicate dummy[1] already is where the point variable you set is...
More leaks:
Unit - Create 1 Dummy for (Owner of DuplicateCaster) at (Position of DuplicateCaster)

Code:
Else - Actions
                                Do nothing
                Unit - Remove DuplicateDummy[1] from the game
The do nothing, remove it, wc3 does nothing if it is empty.
The last part "unit - remove ...." add a "unit - expiration timer" instead.

Also, the first loop, for each integer 1-18, to me, it looks a bit too big, when it is not needed... How about For each integer 1-10? And raise by +36? Of course, I should mention I have no idea how the spell it supposed to look but...
Edit; if it works, cool, if it still bugs up, show us the new trigger. Also, forgot the part where you hide it. Why? When you create 18 units .... within 0.00 seconds, then you want to unhide the hero again, why not just leave it visible for the whole 0.00 seconds? Which leaves me to this point, no units were shown? Maybe because you remove them 0.00 seconds after you create them. Well...
Very useful, thnx now the special effect creation and hero unhide problem is solved, but still, no illusions are created
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
As said, everything happens within 0.00 seconds...
Code:
Set DuplicateDummy[2] = (Last created unit)
Hero - Create Wand of Illusion Dummy and give it to (Last created unit)
Hero - Order (Last created unit) to use (Last created item) on DuplicateCaster
Unit - Remove DuplicateDummy[2] from the game
Doubt the dummy unit casts that illusion. Add "Unit - expiration timer" instead to all dummies.

Code:
 Unit Group - Pick every unit in (Units within 350.00 of (Position of DuplicateCaster) matching (((Matching unit) is an illusion) Equal to True)) and do (Actions)
                                            Loop - Actions
                                                Unit - Move (Picked unit) instantly to (Position of DuplicateDummy[1
More leaks.
And your trigger is a mess? Why use two loops? All you want is to create illusions around the caster? or?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top