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
New Command: DECLARE_ROUND_WINNER
New Command: DECLARE_ROUND_WINNER
- 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.
Re: New Command: SET_ROUND_WINNER
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.
Post below if you want this integrated into the mainline. Should be compatible just fine.
Re: New Command: SET_ROUND_WINNER
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.
Re: New Command: DECLARE_ROUND_WINNER
Ok, I updated everything for you and it should be ready to be merged.
- 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
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
Re: New Command: DECLARE_ROUND_WINNER
An idea I got from Kill The King!
I LOVE IT!!!
Nice work fman23
I LOVE IT!!!
Nice work fman23
- Tank Program
- Forum & Project Admin, PhD
- Posts: 6711
- Joined: Thu Dec 18, 2003 7:03 pm
Re: New Command: DECLARE_ROUND_WINNER
I like the idea.
Maybe if the winningPlayer can't be found then try for teams, or vice-versa?
Maybe if the winningPlayer can't be found then try for teams, or vice-versa?
Re: New Command: DECLARE_ROUND_WINNER
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.
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.
Re: New Command: DECLARE_ROUND_WINNER
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).
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).
Re: New Command: DECLARE_ROUND_WINNER
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.
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.