ULX

Author Topic: [Help] Gamemode in TTT using excisting commands  (Read 2933 times)

0 Members and 1 Guest are viewing this topic.

Offline Wolviller111

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
[Help] Gamemode in TTT using excisting commands
« 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

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: [Help] Gamemode in TTT using excisting commands
« Reply #1 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
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Wolviller111

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: [Help] Gamemode in TTT using excisting commands
« Reply #2 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

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: [Help] Gamemode in TTT using excisting commands
« Reply #3 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?
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

Offline Wolviller111

  • Newbie
  • *
  • Posts: 3
  • Karma: 0
Re: [Help] Gamemode in TTT using excisting commands
« Reply #4 on: November 15, 2017, 11:31:42 AM »
No thank you. Only for the next round will do just fine ^^

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: [Help] Gamemode in TTT using excisting commands
« Reply #5 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)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: [Help] Gamemode in TTT using excisting commands
« Reply #6 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.

I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.