Ver tema anterior :: Ver siguiente tema |
Autor |
Mensaje |
Yagoh Mapeador
Registrado: 07 Sep 2007 Mensajes: 344 Ubicación: Delante del ordenador.
|
Publicado: Mie Ene 27, 2010 10:02 pm Título del mensaje: Ayuda con contador de enemigos |
|
|
Estoy intentando hacer un contador que vaya contando los enemigos que van apareciendo por el mapa y luego que los indique en pantalla. Pero no consigo hacerlo funcionar bien, ya que solo detecta los enemigos que estan durante la partida, y yo quiero que vaya encontrando los que aparecen mediante spawnnofog. De momento lo tengo así:
Código: | //Variables de enemigos
int demonios;
int imp;
int demon;
int zombie;
int shotguy;
int hellknight;
int baronofhell;
int revenant;
int caco;
int archvile;
int cyber;
int zombiem4;
script 101 open {
imp = thingcount(T_IMP,0);
demon = thingcount(T_DEMON,0);
zombie = thingcount(T_ZOMBIE,0);
shotguy = thingcount(T_SHOTGUY,0);
hellknight = thingcount(T_HELLKNIGHT,0);
baronofhell = thingcount(T_BARON,0);
revenant = thingcount(T_REVENANT,0);
caco = thingcount(T_cACODEMON,0);
archvile = thingcount(T_VILE,0);
cyber = thingcount(T_CYBERDEMON,0);
zombiem4 = thingcount(ZOMBIEM4,0);
demonios = imp+demon+zombie+shotguy+hellknight+baronofhell+revenant+caco;
}
script 100 (void) {
setfont("CONFONT");
hudmessage(s:"Demons: ", d:demonios;CR_BLUE,0,0,0.9,0.07,0.0); //Demonios
hudmessage(s:"ArchVile: ", d:archvile;CR_YELLOW,0,0,0.9,0.08,0.0); //Archvile
hudmessage(s:"CyberDemon: ", d:cyber;CR_YELLOW,0,0,0.9,0.09,0.0); //Cyber
hudmessage(s:"M4Guy ", d:zombiem4;CR_YELLOW,0,0,0.9,0.10,0.0);
} |
Al script 100 le llama el script2 (que no lo puse) el cual se ejecuta al iniciar la partida.
Saludos y gracias. _________________
|
|
Volver arriba |
|
|
RicarDooM Administrador
Registrado: 06 Sep 2006 Mensajes: 443 Ubicación: México
|
Publicado: Mie Ene 27, 2010 10:35 pm Título del mensaje: |
|
|
Es probable que los enemigos que muestras con thing spaw le pongas un tid diferente a cero.
De todas maneras para contar enemigos sin importar su tid mejor usa ThingCountName que a diferencia de thingcount con valor 0 buscara a todos los enemigos de su clase sin excepción.
Mas información -> http://remilia.zdoom.org/wiki/ThingCountName |
|
Volver arriba |
|
|
Aluqah Gurú del Mapeo
Registrado: 01 Dic 2006 Mensajes: 156
|
Publicado: Mie Ene 27, 2010 11:44 pm Título del mensaje: Re: Ayuda con contador de enemigos |
|
|
Yagoh escribió: | Pero no consigo hacerlo funcionar bien, ya que solo detecta los enemigos que estan durante la partida, y yo quiero que vaya encontrando los que aparecen mediante spawnnofog. |
Te haría falta hacer que el código se repita Algo así:
script 101 open
{
imp = thingcount(T_IMP,0);
demon = thingcount(T_DEMON,0);
zombie = thingcount(T_ZOMBIE,0);
shotguy = thingcount(T_SHOTGUY,0);
hellknight = thingcount(T_HELLKNIGHT,0);
baronofhell = thingcount(T_BARON,0);
revenant = thingcount(T_REVENANT,0);
caco = thingcount(T_cACODEMON,0);
archvile = thingcount(T_VILE,0);
cyber = thingcount(T_CYBERDEMON,0);
zombiem4 = thingcount(ZOMBIEM4,0);
demonios = imp+demon+zombie+shotguy+hellknight+baronofhell+revenant+caco;
setfont("CONFONT");
hudmessage(s:"Demons: ", d:demonios;CR_BLUE,0,0,0.9,0.07,0.0); //Demonios
hudmessage(s:"ArchVile: ", d:archvile;CR_YELLOW,0,0,0.9,0.08,0.0); //Archvile
hudmessage(s:"CyberDemon: ", d:cyber;CR_YELLOW,0,0,0.9,0.09,0.0); //Cyber
hudmessage(s:"M4Guy ", d:zombiem4;CR_YELLOW,0,0,0.9,0.10,0.0);
delay(35);
restart;
} _________________ - Aluqah's Web -
|
|
Volver arriba |
|
|
Yagoh Mapeador
Registrado: 07 Sep 2007 Mensajes: 344 Ubicación: Delante del ordenador.
|
Publicado: Dom Ene 31, 2010 6:44 pm Título del mensaje: |
|
|
Muchas gracias a ambos, ahora si que funciona perfectamente .
Saludos! _________________ |
|
Volver arriba |
|
|
|
|
No puede crear mensajes No puede responder temas No puede editar sus mensajes No puede borrar sus mensajes No puede votar en encuestas
|
|