A way to give people lives in Survival through ACS

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

A way to give people lives in Survival through ACS

#1

Post by Ivan » Fri Oct 05, 2012 5:27 pm

Does one such way exist? Would be very handy.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Llewellyn
Forum Regular
Posts: 578
Joined: Mon Jul 02, 2012 7:12 am

RE: A way to give people lives in Survival through ACS

#2

Post by Llewellyn » Fri Oct 05, 2012 6:14 pm

No. (Unless something has been implemented very recently.)
Your choices are to:
Create a hack of Cooperative Gamemode that allows you to select which players can play and which cannot with scripts
Use Survival gamemode with a high number of lives, and basically when you want someone to stop playing force-spec them.
Last edited by Llewellyn on Fri Oct 05, 2012 6:14 pm, edited 1 time in total.

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: A way to give people lives in Survival through ACS

#3

Post by Torr Samaho » Fri Oct 05, 2012 6:31 pm

No, but we can discuss adding an ACS function for this.

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

RE: A way to give people lives in Survival through ACS

#4

Post by Ivan » Fri Oct 05, 2012 6:40 pm

I've made a tracker request for this.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: A way to give people lives in Survival through ACS

#5

Post by Torr Samaho » Fri Oct 05, 2012 6:56 pm

Ok, then let's discuss the technicalities in there.

User avatar
Ænima
Addicted to Zandronum
Posts: 3583
Joined: Tue Jun 05, 2012 6:12 pm

RE: A way to give people lives in Survival through ACS

#6

Post by Ænima » Fri Oct 05, 2012 7:01 pm

I haven't seen the source but I'd imagine that making lives manipulatable via ACS shouldn't be too difficult. I mean lives already have their own hardcoded variable (which is changed via sv_maxlives), right?
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

Theshooter7
Forum Regular
Posts: 262
Joined: Wed Jun 06, 2012 2:15 am

RE: A way to give people lives in Survival through ACS

#7

Post by Theshooter7 » Fri Oct 05, 2012 7:30 pm

Looks easy enough, from my quick browse of the source. Just make the ACS function call PLAYER_SetLivesLeft() with a pointer to the desired player, and add one (and in fact, this is how the Survival/LMS code seems to handle it, when queuing the player for respawn). I'd suggest the ACS command use a player ID to obtain which player. So, it'd look like this:

Code: Select all

SetPlayerLives(int playernum, int lives);
Alternatively, we could extend it into SetPlayerProperty(), but that might conflict with any future ZDoom changes, so I don't know what your call on that would be.

The good news, is it looks like PLAYER_SetLivesLeft() handles all the c/s interaction related to it automatically, so at least there won't be extra work in that regard.
Ænima wrote: I haven't seen the source but I'd imagine that making lives manipulatable via ACS shouldn't be too difficult. I mean lives already have their own hardcoded variable (which is changed via sv_maxlives), right?
Just for some information, sv_maxlives is only used when setting up the game (initializing the game rules etc.). Actively altering the current lives of a player requires changing the variable stored in the player class. Interestingly, this means one could add lives to players that go over the set value for sv_maxlives. I suppose one might want to make sure that any changes in lives through ACS does not go over the server variable maximum (a simple comparison when calling PLAYER_SetLivesLeft()), but that's a dev's decision of course. :)
Last edited by Theshooter7 on Fri Oct 05, 2012 7:34 pm, edited 1 time in total.
Image

Llewellyn
Forum Regular
Posts: 578
Joined: Mon Jul 02, 2012 7:12 am

RE: A way to give people lives in Survival through ACS

#8

Post by Llewellyn » Fri Oct 05, 2012 7:47 pm

Theshooter7 wrote:

Code: Select all

SetPlayerLives(int playernum, int lives);
I would rather have it as an ActorProperty myself... to be accessed with GetActorProperty/SetActorProperty, with your current implementation how do you count how many lives you have left? (Also you could give actors lives and set them etc.)
Last edited by Llewellyn on Fri Oct 05, 2012 7:47 pm, edited 1 time in total.

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

RE: A way to give people lives in Survival through ACS

#9

Post by Ivan » Fri Oct 05, 2012 8:05 pm

Well my suggestion was to have functions retrieve life values and let you set them as well so really, once you have one of them you should get the other to have better usage.
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Post Reply