Aqua's Grand Prix, the lobby and voting system for SRB2Kart.
Find a file
2025-01-05 17:46:11 +01:00
Flats/Lobby migration from old git site 2025-01-05 17:39:44 +01:00
Lua migration from old git site 2025-01-05 17:39:44 +01:00
Maps/lobby zone migration from old git site 2025-01-05 17:39:44 +01:00
Music migration from old git site 2025-01-05 17:39:44 +01:00
SOC migration from old git site 2025-01-05 17:39:44 +01:00
Sounds migration from old git site 2025-01-05 17:39:44 +01:00
Sprites migration from old git site 2025-01-05 17:39:44 +01:00
Textures migration from old git site 2025-01-05 17:39:44 +01:00
ANIMDEFS.txt migration from old git site 2025-01-05 17:39:44 +01:00
MUSICDEF.dat migration from old git site 2025-01-05 17:39:44 +01:00
README.md add info on how to add cups 2025-01-05 17:46:11 +01:00
README.txt migration from old git site 2025-01-05 17:39:44 +01:00

Aqua's Grand Prix

This repo contains the files used to make Aqua's Grand Prix (AGP) work.

When the addon is loaded, a cup voting system will take effect when a specific map is loaded called the lobby map (by default map VS). Players get to vote any of three randomly chosen cups and one random cup (which cup it is is hidden until it's won the vote).

After a countdown the cup result screen shows which cup has won the vote and players get a little more time to prepare before playing the cup.

When a cup starts, all the races in the cup will be played in succession until the cup has finished. Players then return to the lobby map and vote for another cup.

The lobby

Most of the code here only runs when the SRB2Kart server is on a specific map (the lobby map). The lobby map is included in this repo and is assigned map ID VS.

It's very possible to replace the map with another one, just make sure you make use of the tags as mentioned further down below. If you want to have the lobby code run on a different map ID, edit the lobbyMap variables in Lua\AGP_Lobby.lua and Lua\ATO.1.4.lua.

Dependencies

AGP makes use of the following addons to work:

Auto Tourney Organizer by Onyo

https://mb.srb2.org/addons/ato-auto-tourney-organizer.4621/

Dino's Custom Stage Title by Dinomial

https://mb.srb2.org/addons/dinos-custom-stage-title.5483/

We thank Onyo and Dinomial for letting us reuse their addons.

Commands

Command Purpose
agp_votetime [1 - 600] The time people can vote for a cup
agp_allvotedtime [1 - 600] Time to wait when everyone voted (does not have effect if the vote timer runs below this value)
agp_resultstime [1 - 600] Time to wait after announcing the cup result to start a cup
agp_gamemodechance [1 - 100] The chance one cup will be played with a random gamemode
agp_forcehell [On/Off] Only pick hell cups if on
agp_forcegamemode [On/Off] Force one cup to always be played with a random gamemode
agp_cupmemoryrounds [0 - 999] How much rounds a cup cannot be chosen again for a vote
agp_debug [On/Off] Print debug logging

Tags

To make the lobby map fully work, the following tags need to be used in a map:

Tags Purpose
Sectors 101-103 & 201-203 When a player is standing in a sector with these tags, a cup preview will appear. Tag x01 is cup 1, tag x02 is cup 2 and tag x03 is cup 3.
Linedef 1100-1102 These linedefs will be replaced with a cup's texture on level load. The length of the linedef should match the width of the texture. We use linedefs of length 384.
Sectors 111-113 & 129 When players go through a sector with special 64 (trigger line anywhere) linked to these tags, they will vote for a specific cup. To make the vote happen, a triangle sector is used with 2 linedef effects. In the triangle sector give one linedef the specified tag with action 301, and another linedef action 443 (Call Lua function). For the line with action 443, give the frontside upper texture the name of the cup a player votes for. Cup names are: CUP1, CUP2, CUP3, CUPR Any tag can be used, we just use these ones.

Adding new cups

Adding new cups can be done by providing a new cup definition in Lua/AGP_Cups.lua and putting a cup texture in the Textures/Cups folder. An example cup definition is as follows:

local cupTest = {
    title = "Test Cup",
    cuptexture = "CUPTEST",
    maplist = {"01", "02", "03", "04", "05", "06"},
    cupcreator = "Aqua",
    cupdesc = {"This cup is certainly a cup.", "A pretty testy cup.", "Or maybe zesty?"}
}
table.insert(cups, cupTest)

The table.insert call is used to update the actual cups table with this new cup. The cup description (cupdesc) can be up to three lines: if you only want one line to show just remove the other two lines from the description.

If you do not provide a cup texture, a placeholder will be used.

Code changes

If you make any code changes it'd be hugely appreciated if you could set up a PR for them.