Resource icon

[Reusable] Player Rotation (Rotate.pk3)


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!
  • rotate-out.png
    rotate-out.png
    39 KB · Views: 110
  • rotate-q.png
    rotate-q.png
    67.1 KB · Views: 96
Author
jameds
Views
370
First release
Last update
Rating
0.00 star(s) 0 ratings

Share this resource

Top