[ACS] (Survival) ACS Excuting if the Last Player loses all lives (SEE THE NEXT PAGE)

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

[ACS] (Survival) ACS Excuting if the Last Player loses all lives (SEE THE NEXT PAGE)

#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?
Last edited by TaporGamingBugReport on Thu Aug 29, 2019 11:14 pm, edited 1 time in total.

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: 49
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: 49
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?

User avatar
TDRR
Forum Regular
Posts: 214
Joined: Thu Jun 28, 2018 9:13 pm
Location: Venezuela

[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().
"I will find joy in Yahweh. I will delight in my Elohim. He has dressed me in the clothes of salvation. He has wrapped me in the robe of righteousness like a bridegroom with a priest’s turban, like a bride with her jewels."
-Isaiah 61:10 (Names of God Bible)

TaporGamingBugReport
 
Posts: 49
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?

User avatar
TDRR
Forum Regular
Posts: 214
Joined: Thu Jun 28, 2018 9:13 pm
Location: Venezuela

[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.
"I will find joy in Yahweh. I will delight in my Elohim. He has dressed me in the clothes of salvation. He has wrapped me in the robe of righteousness like a bridegroom with a priest’s turban, like a bride with her jewels."
-Isaiah 61:10 (Names of God Bible)

TaporGamingBugReport
 
Posts: 49
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: 49
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: 49
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

Could you please to fix this?

TaporGamingBugReport
 
Posts: 49
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

#11

Post by TaporGamingBugReport » Wed Aug 28, 2019 12:22 am

Anyone?

Post Reply