• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Indexing

Status
Not open for further replies.
Level 16
Joined
Jun 24, 2009
Messages
1,409
Long time ago i've made this spell. It wasn't MUI so I've decided to make it MUI with indexing. The spell itself is MUI but only one of the dummies moves. I know what's the problem but I don't know how to fix it.
The problem is at the dummy indexing.
These are the triggers.
  • Shadow Strike
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Strike
    • Actions
      • Set SSIndex = (SSIndex + 1)
      • Set SSCaster[SSIndex] = (Triggering unit)
      • Set SSTarget[SSIndex] = (Target unit of ability being cast)
      • Set SSPoint[SSIndex] = (Position of SSTarget[SSIndex])
      • Set SSDamage[SSIndex] = ((0.10 x (Real((Level of Shadow Strike for SSCaster[SSIndex])))) x (Real((Agility of SSCaster[SSIndex] (Include bonuses)))))
      • For each (Integer SSDummyInteger) from 1 to 5, do (Actions)
        • Loop - Actions
          • Set SSDummyIndex[SSIndex] = SSDummyInteger
          • Set SSPoint2[SSIndex] = (SSPoint[SSIndex] offset by 500.00 towards (72.00 x (Real(SSDummyInteger))) degrees)
          • Unit - Create 1 Shadow for (Owner of SSCaster[SSIndex]) at SSPoint2[SSIndex] facing SSPoint[SSIndex]
          • Set SSDummy[SSDummyIndex[SSIndex]] = (Last created unit)
          • Special Effect - Create a special effect at SSPoint2[SSIndex] using Metamorphosis.mdx
          • Special Effect - Destroy (Last created special effect)
          • Custom script: call RemoveLocation (udg_SSPoint2[udg_SSIndex])
          • Animation - Change (Last created unit)'s animation speed to 300.00% of its original speed
          • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Shadow Strike Loop <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Shadow Strike Loop <gen>
        • Else - Actions
      • Custom script: call RemoveLocation (udg_SSPoint[udg_SSIndex])
  • Shadow Strike Loop
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • For each (Integer SSInteger) from 1 to SSIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (SSTarget[SSInteger] has buff Shadow Strike 2) Equal to True
            • Then - Actions
              • Set SSPoint[SSInteger] = (Position of SSTarget[SSInteger])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Life of SSTarget[SSInteger]) Less than or equal to (SSDamage[SSInteger] x 2.00)
                • Then - Actions
                  • Special Effect - Create a special effect at SSPoint[SSInteger] using DarkLightningNova.mdx
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Kill SSTarget[SSInteger]
                  • For each (Integer SSInteger2) from 1 to 5, do (Actions)
                    • Loop - Actions
                      • Set SSDummyIndex[SSInteger] = SSInteger2
                      • Unit - Kill SSDummy[SSDummyIndex[SSInteger]]
                • Else - Actions
                  • For each (Integer SSInteger2) from 1 to 5, do (Actions)
                    • Loop - Actions
                      • Set SSDummyIndex[SSInteger2] = SSInteger
                      • Set SSPoint2[SSInteger] = (SSPoint[SSInteger] offset by 150.00 towards ((Facing of SSTarget[SSInteger]) + (72.00 x (Real(SSInteger2)))) degrees)
                      • Unit - Move SSDummy[SSDummyIndex[SSInteger]] instantly to SSPoint2[SSInteger], facing SSPoint[SSInteger]
                      • Animation - Play SSDummy[SSDummyIndex[SSInteger]]'s attack animation
                      • Custom script: call RemoveLocation (udg_SSPoint2[udg_SSInteger])
                  • Unit - Cause SSCaster[SSInteger] to damage SSTarget[SSInteger], dealing SSDamage[SSInteger] damage of attack type Chaos and damage type Sonic
                  • Special Effect - Create a special effect attached to the chest of SSTarget[SSInteger] using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
                  • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation (udg_SSPoint[udg_SSInteger])
            • Else - Actions
+1
how can i make it to destroy the dummies when it don't have the buff?
 
You can only bump every 48 hours btw.
I think the problem lies in the setup trigger.
You should put every action inside the For Each Integer Loop action. It will increase SS_Index by 1 every time for 5 times, so you can just set SS_Dummy[]'s index as SS_Index. Perhaps you can attach a test map, so I can do it for you.

To check buffs, use the Boolean condition:
Unit - Unit has Specific Buff
and add it inside your loop, so when it equals to false, you kill SS_Dummy[].
 
Create a real that increases by 0.20 every time your looping trigger runs (creating a 'fake' timer). The action should be:
Set real[Index] = real[index] + 0.20
Add a condition;
if the real is 'Greater than or Equal to' a specific number
AND if the unit has a Specific Buff
Then...
The purpose of this is to add a small timer before it checks if the buff is gone.
Make sure to set the real to 0.00 in your first trigger (so the timer resets itself for each new unit).
 
Status
Not open for further replies.
Top