UGX-Mods

Call of Duty 5: World at War => Downloadable Items for Mappers => Custom Maps, Mods & Tools => Scripts => Topic started by: Dust on October 02, 2014, 06:16:12 pm

Title: How to add a Zombie Counter
Post by: Dust on October 02, 2014, 06:16:12 pm
For some reason, UGX does not have a tutorial for a Zombie Counter so after seeing the topic that was made today asking how to add a Zombie Counter I decided to make a tutorial for it.

Credit to MakeCents for this updated zombie counter.

1.Open up zombiemode_spawner found in mods/maps, if you dont have it in there then it should be in raw/maps. Copy it and paste it to mods/maps.

2. At the top you should see
Code Snippet
Plaintext
init
{
Under the breacket put
Code Snippet
Plaintext
thread ZombieCounter();

3. Now look for
Code Snippet
Plaintext
zombie_death_event( zombie )
{
zombie waittill( "death" );

and replace the entire function with this

Code Snippet
Plaintext
RoundStart(){
level.zombieCounterText = "Zombies Left: ";
level.ZombiesLeft SetText(level.zombieCounterText + "None Yet!");
UpdateZombieCount( "intro_hud_done", 3);
while(1){
UpdateZombieCount("between_round_over", 1);
wait(.1);
}
}
UpdateZombieCount(notification, waiting){
level waittill(notification);
wait(waiting);
numberOfZombies = level.zombie_total + get_enemy_count();
level.ZombiesLeft SetText(level.zombieCounterText + numberOfZombies);
}
ZombieCounter(){
level.ZombiesLeft = create_simple_hud();
    level.ZombiesLeft.horzAlign = "center";
    level.ZombiesLeft.vertAlign = "middle";
    level.ZombiesLeft.alignX = "center";
    level.ZombiesLeft.alignY = "middle";
    level.ZombiesLeft.y = 230;
    level.ZombiesLeft.x = -1;
    level.ZombiesLeft.foreground = 1;
    level.ZombiesLeft.fontscale = 8.0;
    level.ZombiesLeft.alpha = 1;
    level.ZombiesLeft.color = ( 0.423, 0.004, 0 );
    thread RoundStart();
}
zombie_death_event( zombie )
{
zombie waittill( "death" );
level.ZombiesLeft SetText(level.zombieCounterText + (level.zombie_total + get_enemy_count()));

4. Build mod, and your done
Title: Re: How to add a Zombie Counter
Post by: TheScotchGuy on October 02, 2014, 11:54:22 pm
It worked dude, thanks! +1
Title: Re: How to add a Zombie Counter
Post by: MAK911 on October 03, 2014, 01:01:06 am
I'm just going to leave this here.
http://custom-zombies.com/Forums/index.php?topic=23.0 (http://custom-zombies.com/Forums/index.php?topic=23.0)
Title: Re: How to add a Zombie Counter
Post by: HitmanVere on October 03, 2014, 09:32:41 am
I'm just going to leave this here.
http://custom-zombies.com/Forums/index.php?topic=23.0 (http://custom-zombies.com/Forums/index.php?topic=23.0)

People ask many times, if theres tut for counter here, so thats why its good, that zombie added it here
Title: Re: How to add a Zombie Counter
Post by: MakeCents on October 04, 2014, 04:34:00 pm
Does anyone know how this counts towards your hud elements? Is it two per player?
Title: Re: How to add a Zombie Counter
Post by: DuaLVII on October 04, 2014, 04:39:08 pm
Seperate hud for the words `Zombies remaining` another for the count, very old script.
Title: Re: How to add a Zombie Counter
Post by: MakeCents on October 04, 2014, 04:43:45 pm
Seperate hud for the words `Zombies remaining` another for the count, very old script.

I thought so.

Thanks. I'll PM OP with alternative solution, with one hud element, I've made, if they are interested.
Title: Re: How to add a Zombie Counter
Post by: Dust on October 04, 2014, 06:02:54 pm
Thanks. I'll PM OP with alternative solution, with one hud element, I've made, if they are interested.

Sure I would be interested in that, this is just the script ive used for ages now, and yes it is very old. Would be nice to have a updated version

Updated the tutorial with the one MakeCents gave me
Title: Re: How to add a Zombie Counter
Post by: MakeCents on October 04, 2014, 07:23:31 pm
Sure I would be interested in that, this is just the script ive used for ages now, and yes it is very old. Would be nice to have a updated version

Updated the tutorial with the one MakeCents gave me

Cool. Everything looks good.


Title: Re: How to add a Zombie Counter
Post by: Rorke on October 24, 2014, 03:01:50 pm
Code Snippet
Plaintext
zombie_death_event( zombie )
{
zombie waittill( "death" );
level.ZombiesLeft SetText(level.zombieCounterText + (level.zombie_total + get_enemy_count()));

you missed a } at end of bottom line
Title: Re: How to add a Zombie Counter
Post by: MakeCents on October 24, 2014, 03:13:37 pm
Code Snippet
Plaintext
zombie_death_event( zombie )
{
zombie waittill( "death" );
level.ZombiesLeft SetText(level.zombieCounterText + (level.zombie_total + get_enemy_count()));

you missed a } at end of bottom line

If you mean to close the zombie_death_even function then it is that way on purpose. You are not to replace anymore in that function, and especially not the last }, other than this:
Code Snippet
Plaintext
zombie_death_event( zombie )
{
zombie waittill( "death" );

Title: Re: How to add a Zombie Counter
Post by: Rorke on October 25, 2014, 01:49:43 pm
well in ugx chat someone said it gave them bad sytax and when they put } on last line it fixed it
Title: Re: How to add a Zombie Counter
Post by: MakeCents on October 25, 2014, 01:55:04 pm
well in ugx chat someone said it gave them bad sytax and when they put } on last line it fixed it

They must have done something wrong then. Either they didn't replace the section off code above and just pasted it in, or they deleted too much of the function. If they are still having issues, please tell then to pm me. They can send me their _zombiemode_spawner.gsc and I will make it work for them.