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

complicate MUI trigger

Status
Not open for further replies.
Level 6
Joined
Apr 23, 2011
Messages
182
Hi i need help from an expert on MUI because i am trying to create MUI in a double loop kind of weird thing that i need for the AI. Soo i cant use start ability effect.

And well you will see^^ i leave you the 2 maps.

One GUI, that works perfect and has instructions.

The other my attemp to create it MUI.... You will see that is not working I have been working for hours and trying to follow the tutorials of MUI in the hive. I can create MUI spells but in this one got stuck.

The maps are really fast to try. Thanks
 

Attachments

  • fire ball casting.w3x
    29.5 KB · Views: 30
  • fire ball casting mui.w3x
    30.8 KB · Views: 27
Level 6
Joined
Apr 23, 2011
Messages
182
Okey i post the GUI version, then the MUI:

Loops every 0.2 seconds
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • Si: Condiciones
      • And - All (Conditions) are true
        • Condiciones
          • (target is alive) Igual a True
          • target No igual a Ninguna unidad
    • Entonces: Acciones
      • -------- creates target --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • And - All (Conditions) are true
            • Condiciones
              • target No igual a Ninguna unidad
              • (Number of units in (Units within 1000.00 of p matching ((Matching unit) Igual a target))) Igual a 1
              • (target is alive) Igual a True
              • (Number of units in (Units within 400.00 of p matching ((((Matching unit) is alive) Igual a True) and (((Matching unit) belongs to an enemy of Jugador 1 (rojo)) Igual a True)))) Igual a 0
        • Entonces: Acciones
          • -------- cast spell --------
          • Detonador - Turn off (This trigger)
          • Set ticks = velocidad
          • Set porcentaje = (ticks x 100.00)
          • Set porcentaje2 = (1000.00 / porcentaje)
          • Set animation_speed = (100.00 / ticks)
          • Unidad - Activar pausa u
          • Animación - Play u's Spell Channel animation
          • Animación - Change u's animation speed to animation_speed% of its original speed
          • Set p2 = (Position of target)
          • Unidad - Move u instantly to p, facing p2
          • Unidad - Create 1 dummy for Jugador 1 (rojo) at p facing Vista edificio predeterminada degrees
          • Set dummy = (Last created unit)
          • Unidad - Set life of (Last created unit) to 1.00
          • Custom script: call RemoveLocation (udg_p)
          • Set p = ((Position of u) offset by 75.00 towards 270.00 degrees)
          • Texto flotante - Create floating text that reads (String(ticks, 4, 2)) at p with Z offset 0.00, using font size 9.00, color (30.00%, 40.00%, 100.00%), and 0.00% transparency
          • Set text = (Last created floating text)
          • Texto flotante - Change (Last created floating text): Desactivar permanence
          • Texto flotante - Change the lifespan of (Last created floating text) to ticks seconds
          • Texto flotante - Set the velocity of (Last created floating text) to 25.00 towards 300.00 degrees
          • Detonador - Turn on loop casting <gen>
        • Otros: Acciones
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si: Condiciones
              • (Number of units in (Units within 400.00 of p matching ((((Matching unit) is alive) Igual a True) and (((Matching unit) belongs to an enemy of Jugador 1 (rojo)) Igual a True)))) Mayor que o igual a 1
            • Entonces: Acciones
              • -------- -----------------------HUIDA----------------- --------
              • Detonador - Turn off (This trigger)
              • Set degres = (Facing of u)
              • Set punto3 = ((Position of u) offset by -400.00 towards degres degrees)
              • Unidad - Activar pausa u
              • Unidad - Hide u
              • Unidad - Move u instantly to punto3
              • Efecto especial - Create a special effect at punto3 using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
              • Efecto especial - Destroy (Last created special effect)
              • Unidad - Create 1 hero dummy for Jugador 1 (rojo) at p facing punto3
              • Set dummy = (Last created unit)
              • Unidad - Activar pausa dummy
              • Animación - Change dummy's animation speed to 200.00% of its original speed
              • Animación - Change dummy's vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
              • Custom script: call SetUnitAnimationByIndex(udg_dummy, 2)
              • Detonador - Turn on loop runing <gen>
            • Otros: Acciones
              • Set target = (Random unit from (Units within 2000.00 of p matching ((((Matching unit) is alive) Igual a True) and (((Matching unit) belongs to an enemy of Jugador 1 (rojo)) Igual a True))))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si: Condiciones
                  • target No igual a Ninguna unidad
                • Entonces: Acciones
                  • Unidad - Order u to Atacar target
                • Otros: Acciones
      • Custom script: call RemoveLocation (udg_p2)
      • Custom script: call RemoveLocation (udg_p)
    • Otros: Acciones
      • -------- CREA TARGET --------
      • Set target = (Random unit from (Units within 2000.00 of p matching ((((Matching unit) is alive) Igual a True) and (((Matching unit) belongs to an enemy of Jugador 1 (rojo)) Igual a True))))
Loops Every 0.01 seconds
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • Si: Condiciones
      • porcentaje Igual a 0.00
    • Entonces: Acciones
      • Detonador - Turn off (This trigger)
      • Animación - Change u's animation speed to 100.00% of its original speed
      • Unidad - Desactivar pausa u
      • Animación - Reset u's animation
      • Unidad - Order u to Humano Rey de la Montaña: Rayo de tormenta target
      • Unidad - Remove dummy from the game
      • Set dummy = Ninguna unidad
      • Detonador - Turn on fires <gen>
    • Otros: Acciones
      • Set porcentaje = (porcentaje - 1.00)
      • Set ticks = (ticks - 0.01)
      • Unidad - Set life of dummy to ((Vida of dummy) + porcentaje2)
      • Texto flotante - Change text of text to (String(ticks, 4, 2)) using font size 9.00

Loops every 0.01 seconds
  • Set p = (Position of dummy)
  • Set p2 = ((Position of dummy) offset by 10.00 towards (Facing of dummy) degrees)
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • Si: Condiciones
      • (Distance between p and punto3) Menor que o igual a 30.00
    • Entonces: Acciones
      • Detonador - Turn off (This trigger)
      • Unidad - Desactivar pausa dummy
      • Unidad - Hide dummy
      • Unidad - Remove dummy from the game
      • Unidad - Unhide u
      • Unidad - Desactivar pausa u
      • Custom script: call RemoveLocation (udg_punto3)
      • Set dummy = Ninguna unidad
      • Detonador - Turn on fires <gen>
    • Otros: Acciones
      • Unidad - Move dummy instantly to p2, facing (Facing of dummy) degrees
  • Custom script: call RemoveLocation (udg_p2)
  • Custom script: call RemoveLocation (udg_p)

Now my fail of the MUI version :

This triggers Loops every 0.2 seconds
  • Set heroes = (Units owned by Jugador 1 (rojo) matching ((((Matching unit) is Un héroe) Igual a True) and (((Matching unit) is in ocupados) Igual a False)))
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • Si: Condiciones
      • And - All (Conditions) are true
        • Condiciones
          • (Number of units in heroes) Mayor que o igual a 1
          • (Number of units in ocupados) Menor que o igual a 2
    • Entonces: Acciones
      • Set index = (index + 1)
      • Set u[index] = (Random unit from heroes)
      • Grupo de unidad - Remove u[index] from heroes
      • Grupo de unidad - Add u[index] to ocupados
      • Partida - Display to (All players) for 5.00 seconds the text: (String((Number of units in ocupados)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • And - All (Conditions) are true
            • Condiciones
              • index Menor que o igual a 2
              • index Mayor que o igual a 1
        • Entonces: Acciones
          • Partida - Display to (All players) the text: va
          • For each (Integer index2) from 1 to index, do (Actions)
            • Bucle: Acciones
              • Set p[index2] = (Position of u[index2])
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si: Condiciones
                  • And - All (Conditions) are true
                    • Condiciones
                      • (target[index2] is alive) Igual a True
                      • target[index2] No igual a Ninguna unidad
                • Entonces: Acciones
                  • -------- lanza --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • Si: Condiciones
                      • And - All (Conditions) are true
                        • Condiciones
                          • target[index2] No igual a Ninguna unidad
                          • (Number of units in (Units within 1000.00 of p[index2] matching ((((Matching unit) is alive) Igual a True) and (((Matching unit) belongs to an enemy of Jugador 1 (rojo)) Igual a True)))) Mayor que o igual a 1
                          • (target[index2] is alive) Igual a True
                    • Entonces: Acciones
                      • -------- LANZA HECHIZO --------
                      • Set ticks[index2] = velocidad
                      • Set porcentaje[index2] = (ticks[index2] x 100.00)
                      • Set porcentaje2[index2] = (1000.00 / porcentaje[index2])
                      • Set animation_speed[index2] = (100.00 / ticks[index2])
                      • Set p2[index2] = (Position of target[index2])
                      • Unidad - Activar pausa u[index2]
                      • Animación - Play u[index2]'s Spell Channel animation
                      • Animación - Change u[index2]'s animation speed to animation_speed[index2]% of its original speed
                      • Unidad - Move u[index2] instantly to p[index2], facing p2[index2]
                      • Unidad - Create 1 dummy for Jugador 1 (rojo) at p[index2] facing p2[index2]
                      • Set dummy[index2] = (Last created unit)
                      • Unidad - Set life of dummy[index2] to 1.00
                      • Custom script: call RemoveLocation (udg_p[udg_index2])
                      • Set p[index2] = ((Position of u[index2]) offset by 70.00 towards 270.00 degrees)
                      • Texto flotante - Create floating text that reads (String(ticks[index2], 4, 2)) at p[index2] with Z offset 0.00, using font size 9.00, color (30.00%, 40.00%, 100.00%), and 0.00% transparency
                      • Set text[index2] = (Last created floating text)
                      • Texto flotante - Change (Last created floating text): Desactivar permanence
                      • Texto flotante - Change the lifespan of text[index2] to ticks[index2] seconds
                      • Texto flotante - Set the velocity of text[index2] to 25.00 towards 300.00 degrees
                      • -------- ¿¿¿¿¿¿¿¿ NUEVO MUI AQUI ???????? --------
                      • Detonador - Turn on loop casting <gen>
                    • Otros: Acciones
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • Si: Condiciones
                          • (Number of units in (Units within 400.00 of p[index2] matching ((((Matching unit) is alive) Igual a True) and (((Matching unit) belongs to an enemy of Jugador 1 (rojo)) Igual a True)))) Mayor que o igual a 50
                        • Entonces: Acciones
                          • -------- -----------------------HUIDA----------------- --------
                          • Detonador - Turn off (This trigger)
                          • Set degres[index2] = (Facing of u[index2])
                          • Set punto3[index2] = ((Position of u[index2]) offset by -400.00 towards degres[index2] degrees)
                          • Unidad - Activar pausa u[index2]
                          • Unidad - Hide u[index2]
                          • Unidad - Move u[index2] instantly to punto3[index2]
                          • Efecto especial - Create a special effect at punto3[index2] using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
                          • Efecto especial - Destroy (Last created special effect)
                          • Unidad - Create 1 hero dummy for Jugador 1 (rojo) at p[index2] facing punto3[index2]
                          • Set dummy[index2] = (Last created unit)
                          • Unidad - Activar pausa dummy[index2]
                          • Animación - Change dummy[index2]'s animation speed to 200.00% of its original speed
                          • Animación - Change dummy[index2]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 50.00% transparency
                          • Custom script: call SetUnitAnimationByIndex(udg_dummy[udg_index2], 2)
                          • -------- ¿¿¿¿¿¿¿¿ NUEVO MUI AQUI ???????? --------
                          • Detonador - Turn on loop runing <gen>
                        • Otros: Acciones
                          • Set target[index2] = (Random unit from (Units within 2000.00 of p[index2] matching ((((Matching unit) is alive) Igual a True) and (((Matching unit) belongs to an enemy of Jugador 1 (rojo)) Igual a True))))
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • Si: Condiciones
                              • target[index2] No igual a Ninguna unidad
                            • Entonces: Acciones
                              • Unidad - Order u[index2] to Atacar target[index2]
                            • Otros: Acciones
                  • Custom script: call RemoveLocation (udg_p2[udg_index2])
                • Otros: Acciones
                  • -------- CREA TARGET --------
                  • Set target[index2] = (Random unit from (Units within 2000.00 of p[index2] matching ((((Matching unit) is alive) Igual a True) and (((Matching unit) belongs to an enemy of Jugador 1 (rojo)) Igual a True))))
              • Custom script: call RemoveLocation (udg_p[udg_index2])
        • Otros: Acciones
    • Otros: Acciones

This trigger loops every 0.01 seconds
  • For each (Integer index2) from 1 to index, do (Actions)
    • Bucle: Acciones
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si: Condiciones
          • porcentaje[index2] Igual a 0.00
        • Entonces: Acciones
          • Animación - Change u[index2]'s animation speed to 100.00% of its original speed
          • Unidad - Desactivar pausa u[index2]
          • Animación - Reset u[index2]'s animation
          • Unidad - Order u[index2] to Humano Rey de la Montaña: Rayo de tormenta target[index2]
          • Unidad - Remove dummy[index2] from the game
          • Grupo de unidad - Remove u[index2] from ocupados
          • Set dummy[index2] = dummy[index]
          • Set u[index2] = dummy[index]
          • Set porcentaje[index2] = porcentaje[index]
          • Set ticks[index2] = ticks[index]
          • Set porcentaje2[index2] = porcentaje2[index]
          • Set text[index2] = text[index]
          • Set target[index2] = target[index]
          • Set p[index2] = p[index]
          • Set p2[index2] = p2[index]
          • Set index2 = (index2 - 1)
          • Set index = (index - 1)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si: Condiciones
              • index Igual a 0
            • Entonces: Acciones
              • Detonador - Turn off (This trigger)
            • Otros: Acciones
        • Otros: Acciones
          • Set porcentaje[index2] = (porcentaje[index2] - 1.00)
          • Set ticks[index2] = (ticks[index2] - 0.01)
          • Unidad - Set life of dummy[index2] to ((Vida of dummy[index2]) + porcentaje2[index2])
          • Texto flotante - Change text of text[index2] to (String(ticks[index2], 4, 2)) using font size 9.00
 
Level 6
Joined
Apr 23, 2011
Messages
182
?¿?¿?¿? why is that ???? btw i dont think that is the problem run many times my GUI map and all is fine.

My problem is with MUI triggers :)
 
Loop should be 0.03. It helps if you post the whole trigger events and everything. Your problem is most likely in your indexing you do it weird. Without me knowing if its dynamic or indexed arrays I can't tell. I need to know which is your cast trigger. Where do you index everything. Look at my tutorial things a GUIer should know. The chapter hot to index shows you how to properly do indexed arrays.
 
Level 6
Joined
Apr 23, 2011
Messages
182
Loop should be 0.03. It helps if you post the whole trigger events and everything. Your problem is most likely in your indexing you do it weird. Without me knowing if its dynamic or indexed arrays I can't tell. I need to know which is your cast trigger. Where do you index everything. Look at my tutorial things a GUIer should know. The chapter hot to index shows you how to properly do indexed arrays.

my cast trigger is the one that loops every 0.2 seconds. I know your tutorial. The problem is my cast trigger is not a spell. This makes it dificult. But i use almost the same system you are using in the tutorial.

I use 2 variable integrers.

Index and Index2.

The events are just Loops= main trigger 0.2 sec second trigger 0.01 sec. The rest is posted.

Maybe if you try the map you will see it better. My english is not good and my triggers are half in spanish ( Blizzard t.t)
 
Level 6
Joined
Apr 23, 2011
Messages
182
Making the AI unit cast spell with custom time and making him retreat or others. But doing this trought time loop. Because i dont know how to do that using spell.

Soo the AI unit will launch spells continuously.

Seriusly if you try the map you see better in the GUI version. Because is way dificult to explain even on my own language.

Malhorne i could change that if is really need but first i need to see that MUI thing will work. Because in GUI 0.01 is going really fine. And like deathismyfriend the problem is then index.
 
Level 6
Joined
Apr 23, 2011
Messages
182
Not everyone can dl maps. I seriously only do maps to help ppl about 1 out of 100. Maybe less

dl ? Soo you dont have the editor? um ok, strange.

But i manage my self after strugling a bit.


Malhorne thanks but if you are not playing the map on internet 0.01 is fine. I tried my self with MUI it works. You can even go under. The cpu does it when you launch 5 MUI spells at 0.03. But thanks anyway.
 
Status
Not open for further replies.
Top