Bueno, tu solución provoca leaks, pero tienes que atacar el problema de manera diferente. Tu quieres limitar las torres construidas, entonces tienes que llevar contando cuantas torres van construyendose.
Así que un detonador así, debería servir más
[gui]Torrre construida
Acontecimientos
Unidad - A unit Termina construcción
Condiciones
(Unit-type of (Constructed structure)) Igual a (==) Torre de Observación
Acciones
Set CuantasTorres[(Player number of (Triggering player))] = (CuantasTorres[(Player number of (Triggering player))] + 1)
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
CuantasTorres[(Player number of (Triggering player))] Igual a (==) MaximoDeTorres[(Player number of (Triggering player))]
Entonces: Acciones
Jugador - Limit training of Torre de Observación to 0 for (Triggering player)
Otros: Acciones
[/gui]
[gui]Torrre destruida
Acontecimientos
Unidad - A unit Termina construcción
Condiciones
(Unit-type of (Constructed structure)) Igual a (==) Torre de Observación
Acciones
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
CuantasTorres[(Player number of (Triggering player))] Igual a (==) MaximoDeTorres[(Player number of (Triggering player))]
Entonces: Acciones
Jugador - Limit training of Torre de Observación to -1 for (Triggering player)
Otros: Acciones
Set CuantasTorres[(Player number of (Triggering player))] = (CuantasTorres[(Player number of (Triggering player))] - 1)
[/gui]
[gui]Baluarte
Acontecimientos
Unidad - A unit Termina una actualización
Condiciones
(Unit-type of (Triggering unit)) Igual a (==) Baluarte
Acciones
-------- Usamos este IF aquà para reactivar las torres en caso de ser necesario --------
Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
Si: Condiciones
CuantasTorres[(Player number of (Triggering player))] Igual a (==) MaximoDeTorres[(Player number of (Triggering player))]
Entonces: Acciones
Jugador - Limit training of Torre de Observación to -1 for (Triggering player)
Otros: Acciones
Set MaximoDeTorres[(Player number of (Triggering player))] = (MaximoDeTorres[(Player number of (Triggering player))] + 1)
[/gui]
Ambas variables usadas son de Tipo Número entero con Formación 12
Y en MaximoDeTorres le coloqué un valor inicial de 3, de la siguiente forma
