Foro especializado en Warcraft III y su editor
 
BuscarEntrar al ChatboxPortal del foroÍndiceSpellsRegistrarseConectarseGrupos de Usuarios
Eventos Actuales
¡ Bienvenido Invitado!

Editar Perfil

Tus temas
Tus Mensajes ()

Enlaces rápidos








Comparte | .
 

 Portales y dolor de cabeza

Ver el tema anterior Ver el tema siguiente Ir abajo 
AutorMensaje
paillan
Héroe
avatar


Barra de Salud : Su salud está al 100% - Este usuario no ha recibido infracciones

Mensajes Mensajes : 1103
Reputación Reputación : 147
Monedas de oro : 1008
Monedas de Platino : 0

Inventario :
Espada de la Oscuridad Armadura Lunar Avanzada


Mensaje(#) Tema: Portales y dolor de cabeza Vie Feb 09, 2018 3:19 pm

Hola muchachos!
Ire directo al grano. Estoy haciendo un mapa donde un héroe tiene un hechizo que le permite crear un portal. Una vez que crea 2 estos se conectan y permite moverse entre ambos. Hasta ahí funciona bien.
El problema es que si se crea un nuevo portal, este debe reemplazar al más antiguo, para lo cual importe Unit indexer sin saber como usarlo con tal objetivo.
Intento además que el spell pueda ser usado por al menos 6 jugadores (de momento).
Sin más que decir les dejo el deto para que le echen una mirada:

[gui]
Portal cast
   Events
       Unit - A unit Starts the effect of an ability
   Conditions
       (Ability being cast) Equal to (==) Portal
   Actions
        Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
           If - Conditions
               (Number of units in Portal_Group[(Player number of (Owner of (Triggering unit)))]) Equal to (==) 0
           Then - Actions
               Set Portal_Group[(Player number of (Owner of (Triggering unit)))] = Portal_Group[(Player number of (Owner of (Triggering unit)))]
               Unit - Create 1 Dummy Portal for (Owner of (Triggering unit)) at Portal_Point[Portal_MUI] facing Default building facing (270.0) degrees
               Set PORTAL[Portal_MUI] = (Last created unit)
               Set Portal_Point[Portal_MUI] = (Position of PORTAL[Portal_MUI])
               Unit Group - Add PORTAL[Portal_MUI] to Portal_Group[(Player number of (Owner of (Triggering unit)))]
               Unit - Add Portal (unidad dummy) to PORTAL[Portal_MUI]
               Unit - Add Habilidad Puerta to PORTAL[Portal_MUI]
               Set Portal_MUI = (Portal_MUI + 1)
           Else - Actions
                Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                   If - Conditions
                       (Number of units in Portal_Group[(Player number of (Owner of (Triggering unit)))]) Equal to (==) 1
                   Then - Actions
                       Unit - Create 1 Dummy Portal for (Owner of (Triggering unit)) at Portal_Point[Portal_MUI] facing Default building facing (270.0) degrees
                       Set PORTAL[Portal_MUI] = (Last created unit)
                       Set Portal_Point[Portal_MUI] = (Position of PORTAL[Portal_MUI])
                       Unit Group - Add PORTAL[Portal_MUI] to Portal_Group[(Player number of (Owner of (Triggering unit)))]
                       Unit - Add Portal (unidad dummy) to PORTAL[Portal_MUI]
                       Unit - Add Habilidad Puerta to PORTAL[Portal_MUI]
                        Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                           If - Conditions
                               (Owner of PORTAL[(Portal_MUI - 1)]) Equal to (==) (Owner of PORTAL[Portal_MUI])
                           Then - Actions
                               Neutral Building - Set PORTAL[Portal_MUI] destination to Portal_Point[(Portal_MUI - 1)]
                               Neutral Building - Set PORTAL[(Portal_MUI - 1)] destination to Portal_Point[Portal_MUI]
                               Neutral Building - Enable PORTAL[Portal_MUI]
                               Neutral Building - Enable PORTAL[(Portal_MUI - 1)]
                               Lightning - Create a Spirit Link lightning effect from source Portal_Point[Portal_MUI] to target Portal_Point[(Portal_MUI - 1)]
                               Set Portal_Lightning[(Player number of (Owner of PORTAL[Portal_MUI]))] = (Last created lightning effect)
                               Lightning - Change color of Portal_Lightning[(Player number of (Owner of PORTAL[Portal_MUI]))] to (0.43 0.14 0.51) with 1.00 alpha
                           Else - Actions
                               Unit Group - Pick every unit in Portal_Group[(Player number of (Owner of PORTAL[Portal_MUI]))] and do (Actions)
                                   Loop - Actions
                                        Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                           If - Conditions
                                               (Picked unit) Not equal to (!=) PORTAL[Portal_MUI]
                                           Then - Actions
                                               Set Portal_Point[(Custom value of (Picked unit))] = (Position of (Picked unit))
                                               Neutral Building - Set PORTAL[Portal_MUI] destination to Portal_Point[(Custom value of (Picked unit))]
                                               Neutral Building - Set (Picked unit) destination to Portal_Point[Portal_MUI]
                                               Lightning - Create a Spirit Link lightning effect from source Portal_Point[Portal_MUI] to target Portal_Point[(Custom value of (Picked unit))]
                                               Set Portal_Lightning[(Player number of (Owner of PORTAL[Portal_MUI]))] = (Last created lightning effect)
                                               Lightning - Change color of Portal_Lightning[(Player number of (Owner of PORTAL[Portal_MUI]))] to (0.43 0.14 0.51) with 1.00 alpha
                                           Else - Actions
                       Set Portal_MUI = (Portal_MUI + 1)
                   Else - Actions
                        Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                           If - Conditions
                               (Number of units in Portal_Group[(Player number of (Owner of (Triggering unit)))]) Equal to (==) 2
                           Then - Actions
                               Unit Group - Pick every unit in Portal_Group[(Player number of (Owner of (Triggering unit)))] and do (Actions)
                                   Loop - Actions
                                        Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                           If - Conditions
                                               (Custom value of (Picked unit)) Less than (<) (Custom value of (Picked unit))
                                           Then - Actions
                                           Else - Actions
                               Unit - Create 1 Dummy Portal for (Owner of (Triggering unit)) at Portal_Point[Portal_MUI] facing Default building facing (270.0) degrees
                               Set PORTAL[Portal_MUI] = (Last created unit)
                               Set Portal_Point[Portal_MUI] = (Position of PORTAL[Portal_MUI])
                               Unit Group - Add PORTAL[Portal_MUI] to Portal_Group[(Player number of (Owner of (Triggering unit)))]
                               Unit - Add Portal (unidad dummy) to PORTAL[Portal_MUI]
                               Unit - Add Habilidad Puerta to PORTAL[Portal_MUI]
                                Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                   If - Conditions
                                       (Owner of PORTAL[(Portal_MUI - 1)]) Equal to (==) (Owner of PORTAL[Portal_MUI])
                                   Then - Actions
                                       Neutral Building - Set PORTAL[Portal_MUI] destination to Portal_Point[(Portal_MUI - 1)]
                                       Neutral Building - Set PORTAL[(Portal_MUI - 1)] destination to Portal_Point[Portal_MUI]
                                       Neutral Building - Enable PORTAL[Portal_MUI]
                                       Neutral Building - Enable PORTAL[(Portal_MUI - 1)]
                                       Lightning - Create a Spirit Link lightning effect from source Portal_Point[Portal_MUI] to target Portal_Point[(Portal_MUI - 1)]
                                       Set Portal_Lightning[(Player number of (Owner of PORTAL[Portal_MUI]))] = (Last created lightning effect)
                                       Lightning - Change color of Portal_Lightning[(Player number of (Owner of PORTAL[Portal_MUI]))] to (0.43 0.14 0.51) with 1.00 alpha
                                   Else - Actions
                                       Unit Group - Pick every unit in Portal_Group[(Player number of (Owner of PORTAL[Portal_MUI]))] and do (Actions)
                                           Loop - Actions
                                                Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                                   If - Conditions
                                                       (Picked unit) Not equal to (!=) PORTAL[Portal_MUI]
                                                   Then - Actions
                                                       Set Portal_Point[(Custom value of (Picked unit))] = (Position of (Picked unit))
                                                       Neutral Building - Set PORTAL[Portal_MUI] destination to Portal_Point[(Custom value of (Picked unit))]
                                                       Neutral Building - Set (Picked unit) destination to Portal_Point[Portal_MUI]
                                                       Lightning - Create a Spirit Link lightning effect from source Portal_Point[Portal_MUI] to target Portal_Point[(Custom value of (Picked unit))]
                                                       Set Portal_Lightning[(Player number of (Owner of PORTAL[Portal_MUI]))] = (Last created lightning effect)
                                                       Lightning - Change color of Portal_Lightning[(Player number of (Owner of PORTAL[Portal_MUI]))] to (0.43 0.14 0.51) with 1.00 alpha
                                                   Else - Actions
                               Set Portal_MUI = (Portal_MUI + 1)
                           Else - Actions
[/gui]


Haz click a una de las imagenes y entra a un trip

Volver arriba Ir abajo
Marcos_M

avatar


Barra de Salud : Su salud está al 100% - Este usuario no ha recibido infracciones

Mensajes Mensajes : 3062
Reputación Reputación : 511
Monedas de oro : 9495
Monedas de Platino : 0

Inventario :



Mensaje(#) Tema: Re: Portales y dolor de cabeza Vie Feb 09, 2018 3:57 pm

Vas a desechar el grupo de unidad, la variable Portal_MUI y todo lo que es detectar cuando entra un tercero. Hacé esto:

Variable entera de array, asegurate de que tenga tamaño 12 para que no haya errores con el valor inicial
Variable de unidad de array que ya tienes

Al crear el portal seteas las variables:
[gui]
Set CantidadPortales[(Player number of (Triggering player))] = (CantidadPortales[(Player number of (Triggering player))] + 1)
Set Portal_MPI[((Player number of (Triggering player)) + (12 x CantidadPortales[(Player number of (Triggering player))]))] = (Last created unit)
[/gui]

Cuando la cantidad de portales sea igual a 3, vamos a hacer un reemplazo total:
Todas las variables con array [((Player number of (Triggering player)) + (12 x 3))] van a ir a [((Player number of (Triggering player)) + (12 x 2))]
Todas las variables con array [((Player number of (Triggering player)) + (12 x 2))] van a [((Player number of (Triggering player)) + (12 x 1))]
USA VARIABLES AUXILIARES PARA NO PERDER LOS VALORES
Y reduces la variable de cantidad de portales en 1
Volver arriba Ir abajo
paillan
Héroe
avatar


Barra de Salud : Su salud está al 100% - Este usuario no ha recibido infracciones

Mensajes Mensajes : 1103
Reputación Reputación : 147
Monedas de oro : 1008
Monedas de Platino : 0

Inventario :
Espada de la Oscuridad Armadura Lunar Avanzada


Mensaje(#) Tema: Re: Portales y dolor de cabeza Vie Feb 09, 2018 5:01 pm

Más o menos así?

[gui]
Portal cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to (==) Portal
Actions
Set Portal_Point[(Custom value of (Triggering unit))] = (Target point of ability being cast)
Unit - Create 1 Dummy Portal for (Owner of (Triggering unit)) at Portal_Point[(Custom value of (Triggering unit))] facing Default building facing (270.0) degrees
Set Cantidad_de_Portales[(Player number of (Triggering player))] = (Cantidad_de_Portales[(Player number of (Triggering player))] + 1)
Set Portal_MPI[((Player number of (Triggering player)) + (12 x Cantidad_de_Portales[(Player number of (Triggering player))]))] = (Last created unit)
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Cantidad_de_Portales[(Player number of (Triggering player))] Equal to (==) 3
Then - Actions
Custom script: set bj_wantDestroyGroup = true
Unit Group - Pick every unit in (Units in (Playable map area) matching ((Matching unit) Equal to (==) Portal_MPI[((Player number of (Triggering player)) + (12 x 1))])) and do (Actions)
Loop - Actions
Unit - Remove (Picked unit) from the game
Set Portal_MPI[((Player number of (Triggering player)) + (12 x 3))] = Portal_MPI[((Player number of (Triggering player)) + (12 x 2))]
Set Portal_MPI[((Player number of (Triggering player)) + (12 x 3))] = Portal_MPI[((Player number of (Triggering player)) + (12 x 1))]
Else - Actions
[/gui]


Haz click a una de las imagenes y entra a un trip

Volver arriba Ir abajo
Contenido patrocinado




Mensaje(#) Tema: Re: Portales y dolor de cabeza

Volver arriba Ir abajo
 

Portales y dolor de cabeza

Ver el tema anterior Ver el tema siguiente Volver arriba 
Página 1 de 1.

Permisos de este foro:No puedes responder a temas en este foro.
Warcraft III - WorldEditor :: Zona de Aprendizaje(Dudas) :: GUI (Detonadores)-