Author Topic: how the forget do you make a /hub thing  (Read 1354 times)

k i know i asked years ago, but i genuinely don't know how you'd go about making a /hub command or something alike, that just forces a the client back to a default minigame, or some specified mini within a script.cs or maybe that server/admin menu or something.

I've needed a mod like this for like 2 years and I have no forgetin idea how I'd even start. There's so many servers that already do this like Rose's, or even like the occasional falling tiles server, hell I think even that BCS server has something to bring you back. Like genuinely, i got this gucci server at a standstill bc it don't have a /hub command to take you back from some mini-minigames. Yeah i could do some kinda button or some stuff but it's kinda niche, also intrusive af.

Maybe there's some kinda gamemode script I could butcher into a /hub cmd, but I genuinely need a fix that's not giant, "BACK TO HUB" signs with a small button to press. If anyone could point me in the right direction as to just how you'd go about making such a cmd I'd be happy to throw my face at a wall figuring out how torquescript works and how tf you'd actually use the minigame parameters in a command execution. Maybe I could reference /leaveminigame, but still, don't even know the parameter to force someone to switch minigames.

you would remove the client from the current minigame they're in, and add them to the other one
should probably start by figuring out how to get the list of minigames, how to get the client's current minigame, how to add/remove from minigames, and how to create a / command

(hint: you can dump the objects if you need to find useful functions/fields that exist such as add/remove members from above post)

Here I made this for you to test out:


Plant a hub spawn brick. Typing /hub will remove you from the current mini game and teleport you to said hub brick.

You will probably need a button or something at the hub for players to rejoin the mini. I don't know exactly how you want this to work but if you wanna message me on steam or discord we could modify it to better suite your server/needs

don't iterate through bricks like that, it will create noticeable lag on high brick counts which doesn't sound bad but will be super obnoxious if multiple people are using /hub or if they're straight up using it to grief

brickHubSpawnData::onPlant(%this, %brick)
brickHubSpawnData::onLoadPlant(%this, %brick)
to set a global variable or add to a simset or something

Here I made this for you to test out:

I think I might be able to make do with a sort of "on player touch" > "join mini" event thing- even just a command that warps you into a room for just a second to fix the current minigame would work fine, literally even just a TP command for /hub works loving beautifully, i'll have to give it a go in a bit

alright, well im trying it out and I've placed the new "Hub Spawn" bricks with in a mini, outside of a mini, as a public bricks (/plantas 888888 with dup), and of course, just normally. Every time I try the /hub command it's reporting that no hub brick was found....not sure what to do, might be a conflicting mod I have, I'll give it a go some other time in isolation but let me know if there's something specific I should do, like give the block a name or anything.

Or, perhaps something's broken? I really don't wanna suggest that bc you just whipped up a script like a forgetin god of somethin I've been needing for years lol

I rewrote it so that it works. It will find the hub bricks correctly without lag and will choose one of them at random.

Note that players can place their own hub spawns and it will be added to the set, so if you're using this for a gamemode where players can build, extra work will be required.

It can be modified to drop clients into a specific minigame but I don't know how your server is handling minigames so right now it just removes them from whatever minigame they're in.
« Last Edit: December 10, 2020, 12:51:02 AM by Crook »


seriously you guys should publish this if you haven't already, put it on glass or something, ik it sounds retarded but this is probs one of the most useful addons I've had in a while

Also I just put an "onplayertouch > client > ChangeMinigame" event on the brick, seems to work fine so that's forgetin amazing, now all I need is to figure out a player point keeper and a shop setup, and im gucci for my island hub minigame sorta server