I would like to create a new gametype that would run a full tournament. It would track player's scores, drop players, and display a standing after each match.
It's far beyond anything I'd coded in UT99 before. but I'm fine with learning some new things.
There are a couple important elements I know I would need to be able to do, and I'm hoping someone can offer some references or examples for how to do them.
First of all, how can I have a mod (particularly a gametype) read and write an external file? Like a custom ini file? I've seen some mods do this but I don't know the syntax nor the limitations.
Second of all, how can I control what map a gametype loads after each match? Am I forced to use the build-in map lists, or are there other options?
For one, I'd like to be able to keep a tighter control over the map cycle. For another, I'm thinking that it would be really nice if I could have the tournament end by running a map where the winners stand on podiums, like with the hall of champions at the end of the single player campaign.
Another thing I'm curious about is adding elements to the menu. I've seen the Autofill mutator do this, and I'm really curious how to create a custom menu to set up a tournament, rather than typing everything manually into an ini file.
I could start poking around in Autofill's code, but I suspect that this is a feature that is open enough that it would be better to read some kind of wiki or tutorial.
I probably also want to make some code to display a custom scoreboard after a match. This I'm really not sure about because I don't know where to begin with it. I don't know if I can alter a gametype so that the score it shows at the end of the match can stay on that freeze-frame for longer, so I can show the single match's scare for the normal length of time, and then shows the totals. I suppose maybe I could have a work-around where before the next match it quickly loads a dummy map with an extension of the gametype that won't play any actual game but just show a score, but I'm just spitballing here.
Has anyone here ever attempted such a thing, or seen a mod do such a thing? I'm really just reaching in the dark.
There are some of the questions I have that I would like to find information about before I get too far into this project. If anyone knows anything, please post a reply. Otherwise I'll just have to ask more direct questions when I run into specific issues.
auto-Tournament gametype
- PrinceOfFunky
- Godlike
- Posts: 1200
- Joined: Mon Aug 31, 2015 10:31 pm
Re: auto-Tournament gametype
This would require cookies to identify players.
viewtopic.php?f=15&t=12602
When game ends they usually call Level.ServerTravel(), there's a variable that specifies the next URL in LevelInfo, if you costantly check it you can change it at the right time and add "?Game=package.class"Marscaleb wrote: ↑Tue Oct 15, 2019 5:29 amSecond of all, how can I control what map a gametype loads after each match? Am I forced to use the build-in map lists, or are there other options?
For one, I'd like to be able to keep a tighter control over the map cycle. For another, I'm thinking that it would be really nice if I could have the tournament end by running a map where the winners stand on podiums, like with the hall of champions at the end of the single player campaign.
If I remember correctly there's a class for it that gamrtypes reference.Marscaleb wrote: ↑Tue Oct 15, 2019 5:29 amAnother thing I'm curious about is adding elements to the menu. I've seen the Autofill mutator do this, and I'm really curious how to create a custom menu to set up a tournament, rather than typing everything manually into an ini file.
I could start poking around in Autofill's code, but I suspect that this is a feature that is open enough that it would be better to read some kind of wiki or tutorial.
You can replace player's scoreboard with yours, but they are strictly related to gametypes so it wouldn't be a good idea to do it.Marscaleb wrote: ↑Tue Oct 15, 2019 5:29 amI probably also want to make some code to display a custom scoreboard after a match. This I'm really not sure about because I don't know where to begin with it. I don't know if I can alter a gametype so that the score it shows at the end of the match can stay on that freeze-frame for longer, so I can show the single match's scare for the normal length of time, and then shows the totals. I suppose maybe I could have a work-around where before the next match it quickly loads a dummy map with an extension of the gametype that won't play any actual game but just show a score, but I'm just spitballing here.
Has anyone here ever attempted such a thing, or seen a mod do such a thing? I'm really just reaching in the dark.
"Your stuff is known to be buggy and unfinished/not properly tested"
Re: auto-Tournament gametype
Maybe JackGriffin's Postal Babes mod would be a good starting point for investigating something like this.
In addition to PrinceOfFunky's reply, have a poke around in SmartCTF/SmartDM to get an idea about how these HUD Mutators work.I don't know if I can alter a gametype so that the score it shows at the end of the match can stay on that freeze-frame for longer, so I can show the single match's scare for the normal length of time, and then shows the totals. I suppose maybe I could have a work-around where before the next match it quickly loads a dummy map with an extension of the gametype that won't play any actual game but just show a score, but I'm just spitballing here.
Creating a custom GameType isn't too onerous because you inherit so much of the underpinnings when you descend from an existing GameType class (I modified CTFGame a bit, for example). And from there you just override the functions you need in order to tweak things into working the way you want.
- sektor2111
- Godlike
- Posts: 6412
- Joined: Sun May 09, 2010 6:15 pm
- Location: On the roof.
Re: auto-Tournament gametype
Whatever is needed with player in SinglePlayer/LocalTournament I don't get if exist many obstructions. Teleport player on podium when game ends or triggered by whatever event. Game must have some stuff combined with certain map on purpose, etc. etc. You have more pain when it's about net codes but here should not be that case. See what happens with XAN in last Level, if I well recall game-type itself makes pawn to taunt according to map.
As a sample, you can sort first 3 players by writing the right function and teleporting them on desired podium which is shown with a flying camera attached to a mover, even adding things - all that Tournament is... custom scripting team-working with specific maps.
At a moment I was thinking to do a mutator XanMatch where player was intended to play with XAN as in Last Level from Tournament, taunting, sending messages, etc, etc. in any map... but... when people here are saying that are not many interested about what I'm saying, or proving their "intelligence" and "social skills" in PM-s, then... I'm not gonna waste time with such mutators for public sharing...
As a sample, you can sort first 3 players by writing the right function and teleporting them on desired podium which is shown with a flying camera attached to a mover, even adding things - all that Tournament is... custom scripting team-working with specific maps.
At a moment I was thinking to do a mutator XanMatch where player was intended to play with XAN as in Last Level from Tournament, taunting, sending messages, etc, etc. in any map... but... when people here are saying that are not many interested about what I'm saying, or proving their "intelligence" and "social skills" in PM-s, then... I'm not gonna waste time with such mutators for public sharing...