ZDaemon Forum Index ZDaemon
Client/Server DOOM
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ACS: GiveTeamPoints, TakeTeamPoints

 
Post new topic   Reply to topic    ZDaemon Forum Index -> Implemented Requests
View previous topic :: View next topic  
Author Message
DoomerMrT
Spamming!


Joined: 09 Mar 2007
Location: http://destiny-server.ath.cx/forums/

PostPosted: Tue Jun 29, 2010 12:35 pm    Post subject: ACS: GiveTeamPoints, TakeTeamPoints Reply with quote

There could be something like this to make team games more customizable via ACS. For example Kill the Cyberdemon just ends the map currently when a cyberdemon is killed on either team, and prints a message to the screen. With this ACS command, we could make the team actually score a point when kills the opposite team's cyberdemon. This command could be useful for CTF and TDM games too.

Code:
GiveTeamPoints(str team, int amount, bool announce)


The "team" should be a string considering the future implementation of the TEAMINFO lump (if that ever becomes more than just a concept). Optionally you can choose if you want the announcer to tell the scoring or not. (0 means false, 1 means true, should be true if value not given)Announcing is only relevant in CTF mode.


Example:

Code:
GiveTeamPoints("Red", 1, 1);
//standard team
Code:
GiveTeamPoints("FancyColorTeam", 1, 0);
//TEAMINFO team


Taking points should work in a similar way:
Code:
TakeTeamPoints(str team, int amount)


Unless there will be an implementation of losing points for the announcer, the announce part of taking points is pretty needless.

Example:

Code:
TakeTeamPoints("Red", 1);
//standard team
Code:
TakeTeamPoints("FancyColorTeam", 1);
//TEAMINFO team
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Cybershark
Spamming!


Joined: 05 Jan 2005
Location: off the grid, but still fighting for the users!

PostPosted: Thu Jul 01, 2010 2:26 am    Post subject: Reply with quote

Nicely thought out, particularly the point removal side of things which wasn't something I'd ever gone as far as to consider.

This suggestion is something that I have really wanted to see added for a long time. Without it one has to resort to less-than-ideal, hackish methods to allow any sort of scoring of points, and under such circumstances the intermission scoreboard is less than capable of reflecting the true scores.
Back to top
View user's profile Send private message Visit poster's website
BestOfTheWorst
Spamming!


Joined: 02 Jun 2006

PostPosted: Thu Jul 01, 2010 4:06 pm    Post subject: Reply with quote

announcing sounds/messages should not be lumped with the score functions! Mad
You've been looking too much at skulltag ACS functions Razz

The announcing stuff should be done with existing ACS functions, ambientsounds and print messages/hudmessages.


Also the functions should not be that limited.. rather have something like this instead:
Code:
SetTeamScore (team, value)
GetTeamScore (team)


That's all you need for all possible manipulations of team scores Razz
Back to top
View user's profile Send private message
EarthQuake
Spamming!


Joined: 02 Apr 2004
Location: Athens, Ohio. Dieblieber gonna getcha!

PostPosted: Thu Jul 01, 2010 10:49 pm    Post subject: Reply with quote

Teams should also be integers and not strings.

We need to agree upon which teams correspond to which values.

For example, ACS 1.49 has the following teams specified in zdefs for Skulltag:
Code:
// Skulltag Teams -----------------------------------------------------------
#define TEAM_BLUE            0
#define TEAM_RED            1
#define NO_TEAM               2


ZDoom itself doesn't have anything set for this purpose, and going for Skulltag compatibility is problematic because a value of 2 specifies "no team". ZDaemon will most likely need it's own definition for teams.

I think the most consistent numbering would be red (0), blue (1), green (2), and white (3). This is what values the "team" console variable accepts. It's also what TEAMINFO should use to define new teams.

Also the functions Worst suggested should have the "team" parameter as optional. If unspecified, it should affect the team of the activator. This would make using it in ENTER, RESPAWN, and DEATH scripts more flexible.
Back to top
View user's profile Send private message Send e-mail
BestOfTheWorst
Spamming!


Joined: 02 Jun 2006

PostPosted: Fri Jul 02, 2010 4:36 pm    Post subject: Reply with quote

EarthQuake wrote:
Teams should also be integers and not strings.
Yes, for the sake of having compability eventually with: GetPlayerInfo(PlayerNumber(), PLAYERINFO_TEAM)

EarthQuake wrote:

We need to agree upon which teams correspond to which values.

I think the most consistent numbering would be red (0), blue (1), green (2), and white (3). This is what values the "team" console variable accepts. It's also what TEAMINFO should use to define new teams.

If you think we should have better cross-port compability, then the values should match the ones GetPlayerInfo(PlayerNumber(), PLAYERINFO_TEAM) returns.
then numbers are based on the zdoom TEAMINFO lump Arrow

EarthQuake wrote:

Also the functions Worst suggested should have the "team" parameter as optional. If unspecified, it should affect the team of the activator. This would make using it in ENTER, RESPAWN, and DEATH scripts more flexible.

You can't have 'optional' parameters in ACS functions. While you can have certain values have special meanings (such as 0 meaning a activator property), it isn't necessary to do so here. rather we could have like
Code:
int playerTeam = GetPlayerInfo(PlayerNumber(), PLAYERINFO_TEAM);
int playerScore = GetTeamScore (playerTeam);
SetTeamScore(playerTeam, playerScore + 1);

this also means staying compatible with GetPlayerInfo..

It sucks though that ZDoom has the red and blue team otherway around than we do.. but then again those are just some numbers for functions.. Razz
Back to top
View user's profile Send private message
Cybershark
Spamming!


Joined: 05 Jan 2005
Location: off the grid, but still fighting for the users!

PostPosted: Fri Jul 02, 2010 5:57 pm    Post subject: Reply with quote

BestOfTheWorst wrote:
You can't have 'optional' parameters in ACS functions.

That goes against my experience with it. What about commands like Acs_Execute which can be issued with only 2, or up to 5 paramters?
Back to top
View user's profile Send private message Visit poster's website
BestOfTheWorst
Spamming!


Joined: 02 Jun 2006

PostPosted: Fri Jul 02, 2010 6:07 pm    Post subject: Reply with quote

Those are line specials.

EDIT: and when you dont supply those parameters, a value of 0 is assumed..

For the engine these two are exactly the same:
Code:

Acs_Execute(5);
Acs_Execute(5,0,0,0,0);

so 'left out' arguments are actually not left out, but filled with 0.
Back to top
View user's profile Send private message
Cybershark
Spamming!


Joined: 05 Jan 2005
Location: off the grid, but still fighting for the users!

PostPosted: Fri Jul 02, 2010 11:02 pm    Post subject: Reply with quote

I'm sorry but that wentire post looks like a matter of semantics to me Laughing
Back to top
View user's profile Send private message Visit poster's website
BestOfTheWorst
Spamming!


Joined: 02 Jun 2006

PostPosted: Sat Jul 03, 2010 12:08 am    Post subject: Reply with quote

Back to top
View user's profile Send private message
Doomination
Spamming!


Joined: 23 Oct 2006
Location: It's NOT lupus. Posts: 6.022 x 10^23

PostPosted: Sat Jul 03, 2010 12:22 am    Post subject: Reply with quote

Back to top
View user's profile Send private message
Cybershark
Spamming!


Joined: 05 Jan 2005
Location: off the grid, but still fighting for the users!

PostPosted: Sat Jul 03, 2010 1:48 am    Post subject: Reply with quote

Yes, yes, obviously you can't show up to the compiler using any ACS command and try to pass some random number of params into it. But clearly it is possible, so if one were to create a new command then there is no reason this feature could not be integrated into it.
Back to top
View user's profile Send private message Visit poster's website
BestOfTheWorst
Spamming!


Joined: 02 Jun 2006

PostPosted: Sat Jul 03, 2010 9:20 am    Post subject: Reply with quote

Yeah, but you really don't want to implement function overloading in ACS..

And its pretty bad design to have some values or settings SET by actually NOT SETTING them. Confused
Back to top
View user's profile Send private message
phenex2
Spamming!


Joined: 10 Jan 2008

PostPosted: Fri Sep 24, 2010 1:09 pm    Post subject: Reply with quote

is there a similar function for ACS in Zdoom?
if yes we could support it here as well.
Back to top
View user's profile Send private message
EarthQuake
Spamming!


Joined: 02 Apr 2004
Location: Athens, Ohio. Dieblieber gonna getcha!

PostPosted: Fri Sep 24, 2010 3:48 pm    Post subject: Reply with quote

Looks like Skulltag has a few specials regarding this:

http://zdoom.org/wiki/Team_GivePoints

http://zdoom.org/wiki/Team_Score

It's probably best that we support these instead of making up our own specials, for sake of compatibility. Note that one of the specials requires a "team" argument. Some thought needs to be put into what values ZDaemon would be using for each team (see rest of thread).
Back to top
View user's profile Send private message Send e-mail
DoomerMrT
Spamming!


Joined: 09 Mar 2007
Location: http://destiny-server.ath.cx/forums/

PostPosted: Fri Sep 24, 2010 7:00 pm    Post subject: Reply with quote

While I agree that compatibility is important ZDoom doesn't have such functions because it is mostly a singleplayer port. Skulltag indeed has some but they are not very well thought out IMO so I think we should support worst's suggestion instead:

Code:
SetTeamScore (team, value)
GetTeamScore (team)


These two are the only ones that are necessary for all possible manipulations of team scores.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    ZDaemon Forum Index -> Implemented Requests All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group