New Command: DECLARE_ROUND_WINNER

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
Post Reply
User avatar
fman23
On Lightcycle Grid
Posts: 36
Joined: Thu Sep 08, 2011 1:54 am
Location: Yes
Contact:

New Command: DECLARE_ROUND_WINNER

Post by fman23 »

At the request of Lover$Boy, I made this for his script so that he can easily declare the round's winner by some detected action. All it requires is 17 extra lines at the end of gGame.cpp. The syntax is "DECLARE_ROUND_WINNER <player>". I also patched english_base.txt to add a different message for winning by the command and for the necessary help stuff. Attached is declareroundwinner.patch.txt which has these changes incorporated. Since .patch attachments are not allowed, the attachment has a .txt extension. Note: I only tested this on sty+ct.

Edit: Updated for the command DECLARE_ROUND_WINNER and to use gGame.cpp
Attachments
declareroundwinner.patch.txt
(1.92 KiB) Downloaded 307 times
Last edited by fman23 on Sat Apr 21, 2012 12:10 am, edited 2 times in total.
User avatar
Z-Man
God & Project Admin
Posts: 11589
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: New Command: SET_ROUND_WINNER

Post by Z-Man »

Hmm, I'd rather put this into gGame.cpp and name it DECLARE_ROUND_WINNER. And document it via a declare_round_winner_help text in english_base.txt, of course. But otherwise, looking good.

Post below if you want this integrated into the mainline. Should be compatible just fine.
User avatar
fman23
On Lightcycle Grid
Posts: 36
Joined: Thu Sep 08, 2011 1:54 am
Location: Yes
Contact:

Re: New Command: SET_ROUND_WINNER

Post by fman23 »

Ok, I thought about doing that at first, but I copied and pasted a lot of code from gWinZone.cpp and I figured I would put it there but I can move it. I would definitely like to see it merged with mainline. It would be my first contribution to this brilliant project. Thanks for the speedy reply too.
User avatar
fman23
On Lightcycle Grid
Posts: 36
Joined: Thu Sep 08, 2011 1:54 am
Location: Yes
Contact:

Re: New Command: DECLARE_ROUND_WINNER

Post by fman23 »

Ok, I updated everything for you and it should be ready to be merged.
User avatar
AI-team
Shutout Match Winner
Posts: 1020
Joined: Tue Jun 23, 2009 6:17 pm
Location: Germany/Munich
Contact:

Re: New Command: DECLARE_ROUND_WINNER

Post by AI-team »

nice idea, but I think this should also work for teams
  
 
"95% of people believe in every quote you post on the internet" ~ Abraham Lincoln
 
 
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: New Command: DECLARE_ROUND_WINNER

Post by LOVER$BOY »

An idea I got from Kill The King!

I LOVE IT!!!

Nice work fman23 ;)
Image
User avatar
Tank Program
Forum & Project Admin, PhD
Posts: 6711
Joined: Thu Dec 18, 2003 7:03 pm

Re: New Command: DECLARE_ROUND_WINNER

Post by Tank Program »

I like the idea.

Maybe if the winningPlayer can't be found then try for teams, or vice-versa?
Image
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: New Command: DECLARE_ROUND_WINNER

Post by LOVER$BOY »

Well for normal servers, it could be placed where both normal and team based winning could work although I have to admit. I'm a noob at C++ or C#

The winning player will be found! I'm using php script to see who killed the king from the opponent team. With this I can easily use DEATH_SHOT or DEATH_ command stuff to see who killed the opponent king.
Image
User avatar
Z-Man
God & Project Admin
Posts: 11589
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: New Command: DECLARE_ROUND_WINNER

Post by Z-Man »

This actually works on a team basis, you just have to pick a random player on it. Doesn't matter whom. Thing is, we don't have a robust team picking function yet, only a good player picking function.

Selecting a team only if no player is found is a bad idea :) I'd name myself "Team Gold" and join blue. The two things would need to be separate commands. Or we need a good unified 'reference player entity' format. Might be a good idea anyway. I never was happy about player commands taking both a player ID or a part of the name to reference a player. See above, name yourself "2", annoy an inept server admin and watch them kick the wrong person first. The challenge, of course, would be to decide which of the current behaviours to break.

Anyway, I'll be merging this, using the ReadPlayer() function from ePlayer.cpp instead of the custom parsing done here (which doesn't work verbatim, as it turns out, mainline is missing a string function).
User avatar
LOVER$BOY
Match Winner
Posts: 731
Joined: Thu Jan 24, 2008 12:46 pm

Re: New Command: DECLARE_ROUND_WINNER

Post by LOVER$BOY »

Ok I think that's for the best Z-Man ;)

Although in Kill The King case, it would normally be the player who killed the king and if they are "attacker" or "king", I can use the script to issue the command to that player.
Image
Post Reply