Resource icon

[Open Assets] Player Rotation (Rotate.pk3)

This content may be freely modified and/or maintained by anyone.

jameds

jartha
Sonic Team Junior
Kart Krew™️


It's all about those big netgames huh?


Rotate.pk3 lets you have the big lobby,
but without everyone fighting for first.

Commands and Variables:
  • rotate Yes/No[SIZE=+1] -- Toggle rotation, which is useful
    if you want to keep the other settings.[/SIZE]
  • rotate_minutes <minutes>[SIZE=+1] -- Rotate after a number of minutes.
    a number of minutes.[/SIZE]
  • rotate_races <count>[SIZE=+1] -- Rotate after a number of races or map
    exits (read on).[/SIZE]
  • rotate_count_races Finish/Exit[SIZE=+1] -- Count races by normal finish
    or forced exit.[/SIZE]
  • rotate_max_place 1-16[SIZE=+1] -- The highest placement at which a
    player may be rotated at any time. If someone places higher than this, they may
    bypass rotation, and so no rotation at all occurs.[/SIZE]
  • rotate_max_exception <exceptions>[SIZE=+1] -- The most times a single player may
    bypass rotation from a condition cleared.[/SIZE]

  • rotate_exempt <player number>[SIZE=+1] -- Exclude a player from any
    rotation. Another player will be chosen instead.[/SIZE]
  • rotate_exemptions[SIZE=+1] -- List the names of anyone excluded from rotation.[/SIZE]

A player is rotated when the ingamecap is reached and someone is waiting to
enter the game. Rotate.pk3 also prints a message for waiting players, telling
them which position in queue they are at. The longest playing player is rotated
out of the game at the end of the current or next race (not intermission/vote),
and the first player in queue enters the game.

For Programmers:
Because ingamecap isn't exposed to Lua, all players are checked until one has
PF_WANTSTOJOIN. This occurs on the second tic of intermission, so that players
who join mid-race can enter if the ingamecap has not been reached.

Take a look at LUA_LAST for a "last tic" variable tracking system.

Rotate (mind the capitalization) is a table given to player_t that holds
rotation variables. You can find all that you need in LUA_ROT. LUA_Q is where
spectator queue is handled.

Special thanks to wolfs for complaining about large netgames so much.

Please report bugs, I don't like having them!
 

Attachments

  • kl_rotate_v1.pk3
    3.9 KB · Views: 493
  • rotate-out.png
    rotate-out.png
    39 KB · Views: 1,325
  • rotate-q.png
    rotate-q.png
    67.1 KB · Views: 1,152
Last edited:
I tested it as much as I could and it seems to work, but I'm still uncertain as to what I could try. Still, I feel confident in letting this in. Welcome to releases!
 

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top