Ulysses

General => Developers Corner => Topic started by: Wolviller111 on November 13, 2017, 09:40:31 AM

Title: [Help] Gamemode in TTT using excisting commands
Post by: Wolviller111 on November 13, 2017, 09:40:31 AM
Hello everyone,

i was wondering if it was possible to add/change one of the commands to add some sort off small gimmick. Basically it is supposed to make 50% of the player's Detectives and 50% traitor (at the start of the round). This could be done using the "forcenr" command. But i would love the players to actually be assigned to a team randomly. And, if that is not too complicated, to have the "event" once the command is activated, happen at the start of each round with a chance increasing over time (when it didn't trigger).

I have looked through the lua files and it doesn't seem all that complicated, but i really do not know how to do it myself.
If someone has the time and is willing to help, i would love to see how it can be done.
Just a "Mass forcern randomly" CMD without the rdm chance of it happening would just be as good.
Or just a hint on how to get me started with that whole command (i have some super basic programming knowledge)

Thanks to all the answers in advance.
Regards
Wolviller111
Title: Re: [Help] Gamemode in TTT using excisting commands
Post by: iViscosity on November 14, 2017, 12:32:07 PM
I'm a bit confused as to what you mean... So you're saying you want a command that overwrites the role selection and instead gives only T's and D's like a DM?

I'm willing to help but I've got to understand what you mean first lol
Title: Re: [Help] Gamemode in TTT using excisting commands
Post by: Wolviller111 on November 14, 2017, 01:59:44 PM
Yes. That's pretty much what i mean. I do not want it to be replaced completely, but i would like to have a command (or have another one replaced) that when i activate it, all players are assigned to either Detective or Traitor  for the next round, equally.

So should just be a fair D vs T deathmatch for the next round, when you activate the command
If the number is not equal could be something like: 1 innocent, or just 1 extra for either side.

I have tried do edit the lua code myself... but honestly... i have never worked with lua before and i don't just want to dive in & break stuff ^^
I kinda get how it works... but then there is also the ulx. stuff
Title: Re: [Help] Gamemode in TTT using excisting commands
Post by: iViscosity on November 15, 2017, 11:07:28 AM
Yeah that shouldn't be too hard. Just a command that can trigger a variable that will add a hook to assign roles. Do you want it only for the next round or until it's turned off?
Title: Re: [Help] Gamemode in TTT using excisting commands
Post by: Wolviller111 on November 15, 2017, 11:31:42 AM
No thank you. Only for the next round will do just fine ^^
Title: Re: [Help] Gamemode in TTT using excisting commands
Post by: JamminR on November 15, 2017, 03:09:57 PM
iViscosity - Though you might be planning to already, make sure to comment every line of code, even including the ulx parameters, so that Wolviller111 can learn/understand what they are doing.
(Bonus for links to ULib docs and Gmod lua wiki docs for commands/setups being used)
Title: Re: [Help] Gamemode in TTT using excisting commands
Post by: iViscosity on November 15, 2017, 03:52:57 PM
Yeah I don't plan to just write something and give it to someone without giving them the chance to learn. In fact, I wasn't planning to 100% write it for them, but give them the pseudo-code that will allow them to write it and make it their own.