Bueno, en forma simple, existen dos métodos, el fácil y el avanzado.
El método fácil se basa en el uso del nivel del creep, para ello, todos los animales deben tener nivel 0, o algún otro nivel que no usen los creeps normales. Algunas desventajas de este sistema son:
1. Pueden aparecer de cualquier conjunto gráfico, lo cual podría no verse bien.
2. No incluiría animales que no tuvieran ese nivel.
Este método se construye así:
[GUI] Crear unidad simple
Acontecimientos
Tiempo - Every 30.00 seconds of game time
Condiciones
Acciones
Set Unit_Point = (Random point in (Playable map area))
Unidad - Create 1 (Random level 0 creep unit-type) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
[/GUI]
También es posible construirlo así para evitar que se repita el punto:
[GUI]Crear unidad simple punto
Acontecimientos
Tiempo - Every 30.00 seconds of game time
Condiciones
Acciones
Set Unit_Point = ((Random point in (Playable map area)) offset by (Random real number between 0.00 and 700.00) towards (Random angle) degrees)
Unidad - Create 1 (Random level 0 creep unit-type) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
[/GUI]
El método avanzado consiste de 2 detonadores. Uno al inicio del juego que guarda en una variable a tus unidades y otro que las crea. Alguna de sus desventajas son:
1. Debes guardar a cada unidad, lo cual puede ser tedioso si son muchas.
2. Utiliza más memoria y más espacio
Este método se construye así:
Detonador 1:
[GUI] set unidades
Acontecimientos
Map initialization
Condiciones
Acciones
Set Unidades[1] == tu unidad
Set Unidades[2] == tu unidad
Set Unidades[3] == tu unidad
Set Unidades[4] == tu unidad
Set Unidades[5] == tu unidad
Set Unidades[6] == tu unidad
Set Unidades[7] == tu unidad
Set Unidades[8] == tu unidad
Set Unidades[9] == tu unidad
Set Unidades[10] == tu unidad
[/GUI]
- Detonador 2:
[GUI]Crear unidad
Acontecimientos
Tiempo - Every 30.00 seconds of game time
Condiciones
Acciones
Set Unit_Point = (Random point in (Playable map area))
Set Unit_Point = ((Random point in (Playable map area)) offset by (Random real number between 0.00 and 700.00) towards (Random angle) degrees)
Set Chance_example = (Random integer number between 1 and 100)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
Chance_example Menor que o igual a 10
Entonces: Acciones
Unidad - Create 1 (Unit-type of Unidades[1]) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
Chance_example Mayor que 10
Chance_example Menor que o igual a 20
Entonces: Acciones
Unidad - Create 1 (Unit-type of Unidades[2]) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
Chance_example Mayor que 20
Chance_example Menor que o igual a 30
Entonces: Acciones
Unidad - Create 1 (Unit-type of Unidades[3]) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
Chance_example Mayor que 30
Chance_example Menor que o igual a 40
Entonces: Acciones
Unidad - Create 1 (Unit-type of Unidades[4]) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
Chance_example Mayor que 40
Chance_example Menor que o igual a 50
Entonces: Acciones
Unidad - Create 1 (Unit-type of Unidades[5]) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
Chance_example Mayor que 50
Chance_example Menor que o igual a 60
Entonces: Acciones
Unidad - Create 1 (Unit-type of Unidades[6]) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
Chance_example Mayor que 60
Chance_example Menor que o igual a 70
Entonces: Acciones
Unidad - Create 1 (Unit-type of Unidades[7]) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
Chance_example Mayor que 70
Chance_example Menor que o igual a 80
Entonces: Acciones
Unidad - Create 1 (Unit-type of Unidades[8]) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
Chance_example Mayor que 80
Chance_example Menor que o igual a 90
Entonces: Acciones
Unidad - Create 1 (Unit-type of Unidades[9]) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
Otros: Acciones
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
Chance_example Mayor que 90
Chance_example Menor que o igual a 100
Entonces: Acciones
Unidad - Create 1 (Unit-type of Unidades[10]) for Neutral pasivo at Unit_Point facing Vista edificio predeterminada degrees
Custom script: call RemoveLocation(udg_Unit_Point)
Otros: Acciones
[/GUI]
Debes tomar en cuenta además que este método requiere otra variable. Recuerda que sólo puedes usar un set variable para colocar el punto, el que más te acomode.
Sea cual sea el detonador que uses, tendrás algo negativo en él. Estos detonadores ya son MUI en todo caso. Espero que esto se haya sido de ayuda, salu2
Paillan