Invasion: Number of Waves Survived

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

Invasion: Number of Waves Survived

#1

Post by Fabysk » Wed Sep 25, 2013 1:35 am

Does anyone know how to display the amount of waves survived in an Invasion game? I'm trying to do this for the final version of Project 115 for the Zombies mode.
e.g. GameOver! You Survived (current wave) Waves.
Something like this: (This script is from Demon Defense by Chubzdoomer)

while(TRUE)
{
SetFont("BIGFONT");
HudMessage(s:"WAVE ",
d: waveNumber;
HUDMSG_PLAIN | HUDMSG_COLORSTRING, 2, "Red", 0.50, 0.02, 1.0);

Not like this:
script 244 death

{
While((GetInvasionWave() != 2))
{
delay(1);
}
setfont("bigfont");
print(s:"\clGame Over\n\clyou survived 2 Waves");
delay(7);
restart;
}

Sorry if this sounds confusing, but I'm trying my best to describe it.
Image Image Image

Qent
Retired Staff / Community Team Member
Posts: 1424
Joined: Tue May 29, 2012 7:56 pm
Contact:

RE: Invasion: Number of Waves Survived

#2

Post by Qent » Wed Sep 25, 2013 1:43 am

Which one did you want? You used "Game over! You survived x waves!" as an example, but then said you did not want that.

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Invasion: Number of Waves Survived

#3

Post by Fabysk » Wed Sep 25, 2013 1:47 am

I wanted the "Game Over! You Survived x Waves"
Sorry for the confusion.
Image Image Image

Qent
Retired Staff / Community Team Member
Posts: 1424
Joined: Tue May 29, 2012 7:56 pm
Contact:

RE: Invasion: Number of Waves Survived

#4

Post by Qent » Wed Sep 25, 2013 1:58 am

So basically this then:

Code: Select all

script 1 DEATH {
  SetFont("BIGFONT");
  HUDMessage(s:"Game over! You survived ", d:GetInvasionWave()-1, s:" waves!";
             HUDMSG_PLAIN | HUDMSG_LOG, 0, CR_RED, 0.5, 0.02, 3.0);
}
You can add more logic for the case of only one wave survived, or a death during the warmup period.

User avatar
Fabysk
Forum Regular
Posts: 469
Joined: Sat Sep 22, 2012 8:17 pm
Location: In a house...duhh

RE: Invasion: Number of Waves Survived

#5

Post by Fabysk » Wed Sep 25, 2013 2:28 am

So I inserted the script into my mod and tested it out. It works and all but, it displays as i survived 1 wave even though I was on wave 2. So i changed the "d:GetInvasionWave()-1" to "d:GetInvasionWave()-0" and fixed the incorrect number of waves survived. Thank you Qent for solving this issue I had :smile:
Image Image Image

User avatar
Empyre
Zandrone
Posts: 1316
Joined: Sun Jul 08, 2012 6:41 am
Location: Garland, TX, USA

RE: Invasion: Number of Waves Survived

#6

Post by Empyre » Wed Sep 25, 2013 9:24 pm

If you died in the second wave, you only survived one wave, so the script was correct as Qent posted it.
"For the world is hollow, and I have touched the sky."

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Invasion: Number of Waves Survived

#7

Post by Ivan » Wed Sep 25, 2013 11:35 pm

Empyre wrote: If you died in the second wave, you only survived one wave, so the script was correct as Qent posted it.
Not to mention, making -1 to a -0 is pretty useless, you're better off just removing it. Although, this doesn't mean getting rid of -1 in first place is actually right!
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Cruduxy
Zandrone
Posts: 1059
Joined: Fri Jun 08, 2012 4:24 pm

RE: Invasion: Number of Waves Survived

#8

Post by Cruduxy » Wed Sep 25, 2013 11:54 pm

If you'll remove the -1 just rename it "You died on wave X".
[][][][][][][][][][][][][][][]
Nothing to see here
[][][][][][][][][][][][][][][]

Post Reply