[Script] Tag Coop (tagcoop.lua)

Status
Not open for further replies.

Tatsuru

2.3 will have menus
Moderator
Sonic Team Junior
Judge
Cheers!
I wanted to try my hand at a Lua script for the first time, so I came up with this simple idea and got to work. Even with my little knowledge of the language and rusty coding skills, here it is!

Largely based on FuriousFox's Classic Coop Script (obviously, with his permission), this script makes one player be assigned as the leader, and the rest of the players are their sidekicks, in the same Sonic & Tails fashion as the classic games. The leader player is the only vulnerable player and the only one who can actually proceed in the level: they can activate Star Posts, pop monitors to take their items, take Emerald tokens or Emeralds, lose rings and lives, and finish the level, while the sidekicks are invincible, but are teleported back if they go too far, and have to give any rings or score they obtain to the leader.

This script adds a twist to the main gimmick: it changes the main player at customizable intervals.
Do you have that annoying player in your Coop server who's always last and never manages to finish a level in able time, but rejoins and tries to do it all over again? Do you ever wish the players in your server were a little more cooperative and helped each other, just to live up to the gametype's name?
Say no more! The rotation automatically and actively encourages every leader to do their very best in their role, when they're carrying every other player's lives on their backs.

Coop has never been so cooperative before!

Available commands:
LEADER <node/name>: Assigns the leader directly.
LEASH <number>: Sets how far players can move away from the leader, in fracunits. Setting this to 0 turns the leash off. Default length is 8192.
LEADERTIME <number>: Sets how long the leaders keep their position in seconds. Setting this to 0 disables the rotation, making the script essentially the same as FuriousFox's version. Default is 30 seconds.
CHANGEWITHMAP <true/false>: Changes the leader at every map load.
CHANGEONDEATH <true/false>: Changes the leader if the current leader dies.
RANDOMIZE <true/false>: Instead of in a cycle, the leader is randomly selected.
PASS: If you're the leader, use this to pass the baton to the next player in the queue.
SKIPLEADER: If you're the admin, use this command to quickly skip the current leader.
SUICIDE: Essentially the same command as vanilla, but made thinking of the sidekicks. If you get stuck or want to teleport to the leader for whatever reason, use this.
TAGCOOPHELP: Shows the available commands.
Known issues:
- This script isn't meant to be used in Single Player: it only works on Coop and splitscreen mode. Glitches in Single Player are expected, but not considered.
- If the previous leader is flying as Tails and a Sonic player takes his place, Sonic goes into his super sprites for a little while.
- Characters with abilities like Espio of flipping their own gravity when in contact with the ceiling can inadvertently make the next leader flip as well.
- This script might not work well with HUD graphics modifications.
- If the current leader leaves the game, the next leader is automatically assigned as the server administrator, regardless of who was the next leader previously.
 

Attachments

  • srb20037.png
    srb20037.png
    119.6 KB · Views: 672
  • tagcoop.lua
    22.5 KB · Views: 395
Last edited:

sonc

yes i am that guy
Oh... my... god...THIS LOOKS GREAT!, it's like classic co-op, but much better! great job dude!
 
Status
Not open for further replies.
Top