SRB2 Message Board  

Go Back   SRB2 Message Board > Sonic Robo Blast 2 > Releases > Lua

Reply
 
Thread Tools
Classic-style Coop (classiccoop.lua) Details »»
Classic-style Coop (classiccoop.lua)
Version: 1.3, by FuriousFox (AKA FuriousFox) FuriousFox is offline
Developer Last Online: Nov 2017

Category: Version: SRB2 Rating: (2 votes - 3.60 average)
Released: 04-24-2016 Last Update: Never Installs: 3
Scripts Re-Useable Content

This Lua script makes it so all players except for the "main player" act like Player 2 from the old Sonic games. This means:

You cannot lose rings
You cannot lose lives
You cannot pop monitors
You cannot activate starposts
You cannot finish levels
Any rings you pick up go to the main player
Any score you gain will go to the main player
If you die or go too far away from the main player, you will teleport back to them

The main player still plays like a normal player, with lives and rings and everything. Basically, the main player is the "Player 1" of the group. Everyone's HUD will display the rings and lives for the main player.

This script includes 3 console commands to assist you with using it.

MAINPLAYER <name> - Sets the main player for the game. This is the player that will still act like normal. By default, this will be the host. If the main player leaves, the host will become the new main player.
LEASH <number> - Sets how far players can move away from the main player, in fracunits. Set to 0 to turn off the leash. Default is 8192.
SUICIDE - Kill yourself. Useful if you get stuck somewhere, like in a zoom tube. You will respawn at the main player.

Version 1.0
Initial Release

Version 1.1
MAINPLAYER command should now accept player numbers in addition to names.
Added CC_CHANGEONDEATH console variable. If set to true, the Main Player will change when the current Main Player dies.
Added CC_CHANGEONNEWMAP console variable. If set to true, the Main Player will change when a new map is loaded.
Added CC_SHOWMAINPLAYERNAME console variable. If set to true, the lives icon will show the Main Player's name instead of their skin's name.

Version 1.2
Fixed a problem where only the server could turn the leash off.
Fixed a problem where only the server could turn main player names on.
Fixed coins not giving the main player rings when picked up by other players.
Fixed the new main player respawning when the previous main player died.
Fixed respawning players not having the same scale as the main player.
Main player names are now on by default.
Made it so only main players can pick up special stage tokens, Chaos Emeralds, and Fire Flowers.
The lives icon should now display the main player's character's Super icon while they are in Super form.

Version 1.3
Fixed a warning that was popping up in 2.1.15
Fixed extra lives counter not being transferred when manually switching mainplayers
Improved the HUD for splitscreen

Download Now

File Type: lua ClassicCoop-v1.3.lua (16.6 KB, 418 views)

Show Your Support

  • The author of this addon has given explicit permission for its content to be re-used and/or reproduced.

Comments
Old 04-24-2016   #2
Wolfy
wolfs
Developer
 
Wolfy's Avatar
Default

Heh, this is pretty neat! I honestly didn't expect anyone to try and recreate how the classics handled the AI Tails in single player, but it turns out this actually makes netgames pretty interesting, and slightly more playable!

We've already worked out all the bugs on IRC, so you're good to go. Welcome to releases!
__________________
Quote:
[23:56:36] <SM-MaxX> prisma illya is a gift to this impure earth and a shining beacon for all anime
Wolfy is offline   Reply With Quote
Old 04-24-2016   #3
FuriousFox
AKA FuriousFox
Developer
 
FuriousFox's Avatar
Default

Quick update: Just remembered a small bug where assisting players could be hurt by the main player's Elemental Shield flame trail. That has been fixed. If you downloaded the Lua right after it came out, you might want to redownload it.
FuriousFox is offline   Reply With Quote
Old 04-24-2016   #4
MK.exe
Lazy, Lazy and lazy?
 
MK.exe's Avatar
Default

Play this with combi ring and let the games begin!
__________________
Done:
Hit a 180 Rail shot
First person to have a map in releases with Slopes
MK.exe is offline   Reply With Quote
Old 04-25-2016   #5
MosaicMario
Possessed User Title
 
MosaicMario's Avatar
Default

Quote:
Originally Posted by MK.exe View Post
Play this with combi ring and let the games begin!
Combiring alone is hard enough, I speak with experience.
But thinking about that it either makes no difference since every player is bound to each other and will respawn next to them anyways and/or it gets slightly easier because only one player has to deal with rings ect. rendering this useless to the combiring chain.
__________________
Possessed signature!
MosaicMario is offline   Reply With Quote
Old 04-25-2016   #6
MosaicMario
Possessed User Title
 
MosaicMario's Avatar
Default

So I had hosted an server with this lua today and I have to say that I am terrible as a lead player. I outrun the other players most of the time when TRYING to play cooperative. But later I have tried to outrun the other players on purpose and this can be then a lot of fun for the other players trying to catch up to the lead player (much like the outrun races in Need For Speed Underground 2) or even outrun him. It is really a lot of fun esp. when one of your best friends teleports above a bottomless pit all the time ;P.

But I still have some suggestions to make:
1. I would suggest to be able to elect players by their node number because it is easier than typing their full name esp. when they use tons of special characters. Also I was unable to elect players who had spaces in their names.
2. It would be nice if the main player changes on mapchange and/or death. I think a command to toggle this feature would be nice so the host does not have to deal with typing all the names into the console and just enjoy randomly elected lead players.

Other than that I had a lot of good laughs with this script.
__________________
Possessed signature!
MosaicMario is offline   Reply With Quote
Old 04-25-2016   #7
Monster Iestyn
Friendly Neighbour-Hood
Moderator
 
Monster Iestyn's Avatar
Default

Does using quotes help at all for names with spaces?
__________________
My page stuffed full of MIDI goodness!
The Hitchhiker's Guide to the Robo-Hoodiverse
Timeline of Sonic Robo Blast History!

That's an uppercase i, not a lowercase L, for the record.
Monster Iestyn is online now   Reply With Quote
Old 04-25-2016   #8
FuriousFox
AKA FuriousFox
Developer
 
FuriousFox's Avatar
Default

1. Unfortunately I'm not sure if it's possible to find a player's node number in Lua, so name is pretty much the only option.

2. I might add them as toggles, but for many people I think they'll want to keep the mainplayer the same throughout the game.
FuriousFox is offline   Reply With Quote
Old 04-25-2016   #9
MosaicMario
Possessed User Title
 
MosaicMario's Avatar
Default

Quote:
Originally Posted by Monster Iestyn View Post
Does using quotes help at all for names with spaces?
It does! Thank you!
but I should have known that better by now

Quote:
Originally Posted by FuriousFox View Post
2. I might add them as toggles, but for many people I think they'll want to keep the mainplayer the same throughout the game.
I found it rather boring to have the same mainplayers over and over again so I thought this might be a good idea. Or at least just select a random player when entering mainplayer without a name into the console.
__________________
Possessed signature!

Last edited by MosaicMario; 04-25-2016 at 10:37 PM.
MosaicMario is offline   Reply With Quote
Old 04-26-2016   #10
JTE
 
JTE's Avatar
Default

Quote:
Originally Posted by FuriousFox View Post
1. Unfortunately I'm not sure if it's possible to find a player's node number in Lua, so name is pretty much the only option.
Are you sure? If you have the player object (eg. by using players.iterate), try #player?

EDIT: Oh, but since you're trying to find a player BY node, then just do players[node] and make sure to check it isn't nil?
__________________
<Chimera> jte you're scaring me <Chimera> jte stop <Mystic> too much catnip

Last edited by JTE; 04-27-2016 at 07:33 AM.
JTE is offline   Reply With Quote
Old 05-01-2016   #11
FuriousFox
AKA FuriousFox
Developer
 
FuriousFox's Avatar
Default

Uploaded a new version which adds console commands for changing the Main Player upon death or upon starting a new level. The MAINPLAYER command should also accept player numbers as arguments now too.
FuriousFox is offline   Reply With Quote
Old 05-15-2016   #12
FuriousFox
AKA FuriousFox
Developer
 
FuriousFox's Avatar
Default

UPDATE!

Fixes:
Fixed a problem where only the server could turn the leash off.
Fixed a problem where only the server could turn main player names on.
Fixed coins not giving the main player rings when picked up by other players.
Fixed the new main player respawning when the previous main player died.
Fixed respawning players not having the same scale as the main player.

Changes:
Main player names are now on by default.
Made it so only main players can pick up special stage tokens, Chaos Emeralds, and Fire Flowers.
The lives icon should now display the main player's character's Super icon while they are in Super form.

Known issues:
Non main players can pop monitors on Mario Mode levels. This is to prevent a much worse problem from occurring.
Rings HUD item is not in the correct position on non-aspect-correct resolutions.

Other:
Added Lua garbage collection every time a new level loads. Will this help with anything? I don't know, but I'm trying it.

Last edited by FuriousFox; 05-15-2016 at 10:00 PM.
FuriousFox is offline   Reply With Quote
Old 05-21-2016   #13
FuriousFox
AKA FuriousFox
Developer
 
FuriousFox's Avatar
Default

Minor update:

Fixed a warning that was popping up in 2.1.15
Fixed extra lives counter not being transferred when manually switching mainplayers
Improved the HUD for splitscreen
FuriousFox is offline   Reply With Quote
Old 02-19-2017   #14
SSNCaleb
Casually plays with Dragon
 
SSNCaleb's Avatar
Default

This wad is temporary broken. It won't work.
SSNCaleb is offline   Reply With Quote
Old 02-19-2017   #15
FuriousFox
AKA FuriousFox
Developer
 
FuriousFox's Avatar
Default

I'm out of town at the moment and can't look at it. How exactly is it broken? Is it throwing up an error message? If so, what is that message?
FuriousFox is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:16 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.