• 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.

Help with MuI

Status
Not open for further replies.
Level 2
Joined
Jan 28, 2008
Messages
23
I started to do my first MuI and i have problems with triggering.
It,s smthing like kamehameha.
 

Attachments

  • Kamehameha.w3x
    25.7 KB · Views: 43
Level 2
Joined
Jan 28, 2008
Messages
23
  • Kamehameha CAST
    • Wydarzenia
      • Jednostka - A unit Zaczyna ukierunkowywać zdolność
    • Warunki
      • (Ability being cast) RĂłwna się Kamehameha
    • Akcje
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • JeĹ›li - Warunki
          • KH_Times[0] RĂłwna się 0
        • To - Akcje
          • Wyzwalacz - Turn on Kamehameha Move <gen>
        • Albo - Akcje
      • Set KH_Times[0] = (KH_Times[0] + 1)
      • Set KH_Times[1] = (KH_Times[1] + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • JeĹ›li - Warunki
          • KH_Times[0] Większe niĹĽ KH_M_S
        • To - Akcje
          • Set KH_I[KH_Times[0]] = KH_Times[0]
          • Set KH_M_S = KH_Times[0]
        • Albo - Akcje
      • Set TempInt = KH_I[KH_Times[0]]
      • Set KH_L = (KH_L + 1)
      • Set KH_Skip = (KH_Skip + 1)
      • Set Caster[TempInt] = (Casting unit)
      • Set Target_Point[0] = (Target point of ability being cast)
      • Set Angle[0] = (Facing of Caster[TempInt])
      • Set Start_Point[0] = ((Position of Caster[TempInt]) offset by 150.00 towards Angle[0] degrees)
      • Animacja - Play Caster[TempInt]'s morph animation
      • Animacja - Play Caster[TempInt]'s spell throw animation
      • Jednostka - Make Caster[TempInt] face Target_Point[0] over 0.00 seconds
      • Jednostka - Create 1 DummyCore1 for (Owner of Caster[TempInt]) at Start_Point[0] facing Target_Point[0]
      • Set Dummy[TempInt] = (Last created unit)
      • Jednostka - Create 1 DummyMissle for (Owner of Caster[TempInt]) at Start_Point[0] facing Target_Point[0]
      • Set Dummy2[TempInt] = (Last created unit)
      • Jednostka - Add a 5.00 second OgĂłlny expiration timer to Dummy[TempInt]
      • Jednostka - Add a 5.00 second OgĂłlny expiration timer to Dummy2[TempInt]
      • Custom script: call RemoveLocation (udg_Start_Point[0])
  • Kamehameha Move
    • Wydarzenia
      • Czas - Every 0.03 seconds of game time
    • Warunki
    • Akcje
      • For each (Integer KH_Loop) from 1 to KH_Times[0], do (Actions)
        • Pętla - Akcje
          • Set TempInt = KH_I[KH_Loop]
          • Set Dummy_Point[0] = (Position of Dummy[TempInt])
          • Set Dummy_Move[0] = (Dummy_Point[0] offset by 30.00 towards Angle[0] degrees)
          • Set Missle_Point[0] = (Position of Dummy2[TempInt])
          • Jednostka - Move Dummy[TempInt] instantly to Dummy_Move[0]
          • Jednostka - Move Dummy2[TempInt] instantly to Dummy_Move[0]
          • Jednostka - Create 1 DummyCore1 for (Owner of Caster[TempInt]) at Dummy_Point[0] facing Target_Point[0]
          • Grupa jednostek - Add (Last created unit) to Core1G[KH_L]
          • Jednostka - Create 1 DummyCore2 for (Owner of Caster[TempInt]) at Dummy_Point[0] facing Target_Point[0]
          • Grupa jednostek - Add (Last created unit) to CoreG[KH_Skip]
          • Set UnitGroup[0] = (Units within 200.00 of (Position of Dummy2[TempInt]) matching ((((Matching unit) is Budynek) RĂłwna się NIE) and ((((Matching unit) is alive) RĂłwna się TAK) and ((((Matching unit) belongs to an enemy of (Owner of Caster[TempInt])) RĂłwna się TAK) and (((
          • Grupa jednostek - Pick every unit in UnitGroup[0] and do (Actions)
            • Pętla - Akcje
              • Jednostka - Kill Dummy2[TempInt]
              • Jednostka - Cause Caster[TempInt] to damage (Picked unit), dealing (200.00 x (Real((Level of Kamehameha for Caster[TempInt])))) damage of attack type Zaklęcia and damage type Normalny
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • JeĹ›li - Warunki
              • (Dummy[TempInt] is dead) RĂłwna się TAK
            • To - Akcje
              • Jednostka - Remove Dummy[TempInt] from the game
              • Jednostka - Remove Dummy2[TempInt] from the game
              • Jednostka - Create 1 DummyExplosion for (Owner of Caster[TempInt]) at Missle_Point[0] facing DomyĹ›lna orientacja budynku degrees
              • Jednostka - Add a 1.00 second OgĂłlny expiration timer to (Last created unit)
              • Jednostka - Create 1 DummyExplosion1 for (Owner of Caster[TempInt]) at Missle_Point[0] facing DomyĹ›lna orientacja budynku degrees
              • Jednostka - Add a 1.00 second OgĂłlny expiration timer to (Last created unit)
              • Jednostka - Create 1 DummyExplosion3 for (Owner of Caster[TempInt]) at Missle_Point[0] facing DomyĹ›lna orientacja budynku degrees
              • Jednostka - Add a 1.00 second OgĂłlny expiration timer to (Last created unit)
              • Grupa jednostek - Pick every unit in Core1G[KH_L] and do (Jednostka - Remove (Picked unit) from the game)
              • Grupa jednostek - Pick every unit in CoreG[KH_Skip] and do (Jednostka - Remove (Picked unit) from the game)
              • Custom script: set bj_wantDestroyGroup = true
              • Custom script: call RemoveLocation (udg_Dummy_Point[0])
              • Custom script: call RemoveLocation (udg_Dummy_Move[0])
              • Custom script: call RemoveLocation (udg_Target_Point[0])
              • Custom script: call DestroyGroup (udg_UnitGroup[0])
              • Custom script: call DestroyGroup (udg_Core1G[KH_L])
              • Custom script: call DestroyGroup (udg_CoreG[KH_Skip])
            • Albo - Akcje
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • JeĹ›li - Warunki
              • (Dummy2[TempInt] is dead) RĂłwna się TAK
            • To - Akcje
              • Set KH_I[KH_Loop] = KH_I[KH_Times[0]]
              • Set KH_I[KH_Times[0]] = TempInt
              • Set KH_Times[0] = (KH_Times[0] - 1)
              • Set KH_Loop = (KH_Loop - 1)
              • Set KH_L = (KH_L - 1)
              • Set KH_Skip = (KH_Skip - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • JeĹ›li - Warunki
                  • KH_Times[TempInt] RĂłwna się 0
                • To - Akcje
                  • Wyzwalacz - Turn off (This trigger)
                  • Skip remaining actions
                • Albo - Akcje
            • Albo - Akcje
I am from poland so i have polish editor...
 
Lepiej trzymaj się standardów i zamiast zmiennych array używaj non array podczas sortowania indexów.

Translation:

To be fair (everything in english):
Most variables used shouldn't be array types, just stick to standard ones
(Triggerping player)/(Triggering unit) faster than (Owner of (...))/(Casting unit)
Leak removal wans't done correctly
_Skip & _L aren't needed at all. If you are using two additional unit groups, use the instance idex for them
You can not play two animations at a time, second one must be queued (Dodaj je do kolejki)
Index 'Angle' parameter as well, it can help you hget rid of Target_Point in loop trigger
I would recommebr to use real array variable for timing duration instead of checking unit's expiration timer - it's inaccurate

Elaborate the spell idea, meaning tell us what you want to do. I'm syre trigger formula can still be improved.

  • Kamehameha CAST
    • Events
      • Unit - A unit Starts effect of ability
    • Conditions
      • (Ability being cast) Equal to Kamehameha
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KH_IndexSize Equal to 0
        • Then - Acitons
          • Trigger - Turn on Kamehameha Move <gen>
        • Else - Actions
      • Set KH_IndexSize = KH_IndexSize + 1
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • KH_IndexSize Greater than KH_M_S
        • Then - Actions
          • Set KH_I[KH_IndexSize] = KH_IndexSize
          • Set KH_M_S = KH_IndexSize
        • Else - Actions
      • Set TempInt = KH_I[KH_IndexSize]
      • Set Caster[TempInt] = (Triggering unit)
      • Set Target_Point = (Target point of ability being cast)
      • Set Angle[TempInt] = (Facing of Caster[TempInt])
      • Set Start_Point = ((Position of Caster[TempInt]) offset by 150.00 towards Angle degrees)
      • Animation - Play Caster[TempInt]'s morph animation
      • Animation - Queue Caster[TempInt]'s spell throw animation
      • Unit - Make Caster[TempInt] face Target_Point over 0.00 seconds
      • Unit - Create 1 DummyCore1 for (Triggering player) at Start_Point facing Target_Point
      • Set Dummy[TempInt] = (Last created unit)
      • Unit - Create 1 DummyMissle for (Triggering player) at Start_Point facing Target_Point
      • Set Dummy2[TempInt] = (Last created unit)
      • Set Duration[TempInt] = 5.00
      • Custom script: call RemoveLocation (udg_Start_Point)
      • Custom script: call RemoveLocation (udg_Target_Point)
  • Kamehameha Move
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer KH_Loop) from 1 to KH_IndexSize, do (Actions)
        • Loop - Actions
          • Set TempInt = KH_I[KH_Loop]
          • Set Duration[TempInt] = Duration[TempInt] - 0.03
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Duration[TempInt] Less or equal to 0.00
            • Then - Actions
              • Unit - Remove Dummy[TempInt] from the game
              • Unit - Remove Dummy2[TempInt] from the game
              • Unit - Create 1 DummyExplosion for (Owner of Caster[TempInt]) at Missle_Point facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Create 1 DummyExplosion1 for (Owner of Caster[TempInt]) at Missle_Point facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit - Create 1 DummyExplosion3 for (Owner of Caster[TempInt]) at Missle_Point facing Default building facing degrees
              • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
              • Unit Group - Pick every unit in Core1G[TempInt] and do (Unit - Remove (Picked unit) from the game)
              • Unit Group - Pick every unit in CoreG[TempInt] and do (Unit - Remove (Picked unit) from the game)
              • Custom script: call DestroyGroup (udg_Core1G[udg_TempInt])
              • Custom script: call DestroyGroup (udg_CoreG[udg_TempInt])
              • Set Dummy[TempInt] = No unit
              • Set Dummy2[TempInt] = No unit
              • Set Caster[TempInt] = No unit
              • Set KH_I[KH_Loop] = KH_I[KH_IndexSize]
              • Set KH_I[KH_IndexSize] = TempInt
              • Set KH_IndexSize = (IndexSize - 1)
              • Set KH_Loop = (KH_Loop - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • KH_IndexSize Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
          • Else - Actions
            • Set Dummy_Point = (Position of Dummy[TempInt])
            • Set Dummy_Move = (Dummy_Point offset by 30.00 towards Angle[TempInt] degrees)
            • Set Missle_Point = (Position of Dummy2[TempInt])
            • Unit - Move Dummy[TempInt] instantly to Dummy_Move
            • Unit - Move Dummy2[TempInt] instantly to Dummy_Move
            • Unit - Create 1 DummyCore1 for (Owner of Caster[TempInt]) at Dummy_Point facing Angle[TempInt]
            • Unit Group - Add (Last created unit) to Core1G[TempInt]
            • Unit - Create 1 DummyCore2 for (Owner of Caster[TempInt]) at Dummy_Point facing Angle[TempInt]
            • Unit Group - Add (Last created unit) to CoreG[TempInt]
            • Custom script: set bj_wantDestroyGroup = true
            • Unit Group - Pick every unit in (Units within 200.00 of Missle_Point matching ((((Matching unit) is Building) Equal to False) and ((((Matching unit) is alive) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of Caster[TempInt])) Equal to True) and ((( and do Actions
              • Loop - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Picked unit) Not equal to No unit
                  • Then - Actions
                    • Set Duration[TempInt] = 0.00
                    • Unit - Cause Caster[TempInt] to damage (Picked unit), dealing (200.00 x (Real((Level of Kamehameha for Caster[TempInt])))) damage of attack type Spells and damage type Normal
                    • Else - Actions
            • Custom script: call RemoveLocation (udg_Dummy_Point)
            • Custom script: call RemoveLocation (udg_Dummy_Move)
 
Last edited:
Level 2
Joined
Jan 28, 2008
Messages
23
Got another problem, after some casts dumies arent removing any suggestions?
Polish:
Mam inny problem, po kilku czarach dummmies nie są usuwane jakieś pomysły?
Screen
333gd.png
[/URL][/IMG]
 
Mowie, użyj real vairable jako "odmierzanie czasu".
  • Set Duration[TempInt] = 30.00
Za każdym razem jak wali loop, zmiejszaj tę wartość o wartość periodic dla loopa, tutaj 0.03. Kiedy Duration[] hitnie 0.00, kończ instacje, a nie jak teraz - kończysz kiedy dummy jest martwy.
Co nie jest bug free bo dummy może "zniknąć" przez jedną z Twoich poprzednich akcji.

Popatrz jeszcze raz na moje triggery, zedytowałem je.
 
Level 2
Joined
Jan 28, 2008
Messages
23
Nadal nie pomogło masz tu moją mapę i spróbuj na przykład rzucić czar z 2 bohaterów.
 

Attachments

  • Kamehameha.w3x
    26.8 KB · Views: 33
Status
Not open for further replies.
Top