[ACS] (Survival) ACS Excuting if the Last Player loses all lives

Discuss all aspects related to modding Zandronum here.
Post Reply
TaporGamingBugReport
 
Posts: 44
Joined: Mon Apr 30, 2018 9:00 am
Clan: DoomBreakerMadness
Clan Tag: doombreakermdnss

[ACS] (Survival) ACS Excuting if the Last Player loses all lives

#1

Post by TaporGamingBugReport » Sat Aug 10, 2019 2:05 pm

So i don't know if i do if the last player lost all it's lives.

Anyone can help this?

User avatar
Dusk
Developer
Posts: 581
Joined: Thu May 24, 2012 9:59 pm
Location: Turku

[ACS] Re: (Survival) ACS Excuting if the Last Player loses all lives

#2

Post by Dusk » Sun Aug 11, 2019 7:23 pm

Wire up a death script and check whether 'GetPlayerLivesLeft' returns 0.

TaporGamingBugReport
 
Posts: 44
Joined: Mon Apr 30, 2018 9:00 am
Clan: DoomBreakerMadness
Clan Tag: doombreakermdnss

[ACS] Re: (Survival) ACS Excuting if the Last Player loses all lives

#3

Post by TaporGamingBugReport » Mon Aug 12, 2019 2:41 am

I test out with 3 bots. But only one player has lost all lives and they executed the script

Can i do to check players if alive? If all players died execute the script. Should i do?

TaporGamingBugReport
 
Posts: 44
Joined: Mon Apr 30, 2018 9:00 am
Clan: DoomBreakerMadness
Clan Tag: doombreakermdnss

[ACS] Re: (Survival) ACS Excuting if the Last Player loses all lives

#4

Post by TaporGamingBugReport » Sat Aug 17, 2019 11:15 am

Anyone?

TDRR
 
Posts: 89
Joined: Thu Jun 28, 2018 9:13 pm

[ACS] Re: (Survival) ACS Excuting if the Last Player loses all lives

#5

Post by TDRR » Sat Aug 17, 2019 3:29 pm

Count all players in the game and every time someone loses all lives add to a separate int (Possibly called something like DeadPlayers) and in the same death script check if DeadPlayers equals the player count.

You can get the player count by using PlayerCount().

TaporGamingBugReport
 
Posts: 44
Joined: Mon Apr 30, 2018 9:00 am
Clan: DoomBreakerMadness
Clan Tag: doombreakermdnss

[ACS] Re: (Survival) ACS Excuting if the Last Player loses all lives

#6

Post by TaporGamingBugReport » Sun Aug 18, 2019 11:00 am

Idk why i do this.

Full code?

TDRR
 
Posts: 89
Joined: Thu Jun 28, 2018 9:13 pm

[ACS] Re: (Survival) ACS Excuting if the Last Player loses all lives

#7

Post by TDRR » Sun Aug 18, 2019 5:35 pm

Code: Select all

int DeadPlayers; //This is a script-scope variable.

Script "Suvival_Death" DEATH
{
     if(PlayerIsSpectator(PlayerNumber()) == 2) //This checks if the player ran out of lives
     {
          DeadPlayers++;
     }
     if(DeadPlayers >= PlayerCount()) //This checks if all players are dead.
     {
          //do whatever you need to do here
     }
}
Actually Dusk was wrong, since GetPlayerLivesLeft returning 0 means the player has one life left. Unless of course this was changed and the wiki wasn't updated, but this method i used in the script works too.

TaporGamingBugReport
 
Posts: 44
Joined: Mon Apr 30, 2018 9:00 am
Clan: DoomBreakerMadness
Clan Tag: doombreakermdnss

[ACS] Re: (Survival) ACS Excuting if the Last Player loses all lives

#8

Post by TaporGamingBugReport » Mon Aug 19, 2019 7:30 am

It's not working

Fix?

TaporGamingBugReport
 
Posts: 44
Joined: Mon Apr 30, 2018 9:00 am
Clan: DoomBreakerMadness
Clan Tag: doombreakermdnss

[ACS] Re: (Survival) ACS Excuting if the Last Player loses all lives

#9

Post by TaporGamingBugReport » Tue Aug 20, 2019 1:26 am

Anyone?

TaporGamingBugReport
 
Posts: 44
Joined: Mon Apr 30, 2018 9:00 am
Clan: DoomBreakerMadness
Clan Tag: doombreakermdnss

[ACS] Re: (Survival) ACS Excuting if the Last Player loses all lives

#10

Post by TaporGamingBugReport » Tue Aug 20, 2019 2:55 pm

Oh it works. but...
Still buggy

Should you Fix it?

Post Reply