Garry's Mod

Garry's Mod

Custom Roles for TTT [OUTDATED]
486 kommentarer
Malivil  [ophavsmand] 29. juni 2021 kl. 6:02 
AS OF June 29th, 2021 - This version of Custom Roles for TTT is no longer being actively developed. Please see note at the top of the description.
Thairoon 19. juni 2021 kl. 17:05 
yep worked, yw and thanks again^^
Malivil  [ophavsmand] 19. juni 2021 kl. 16:14 
I figured it out. There was a bug that could cause all of the roleweapons features (and shop randomization) to not work with certain weapons.

Should be fixed now, thanks for the report =)
Malivil  [ophavsmand] 19. juni 2021 kl. 15:21 
Hmm, interesting. I'll look into that
Thairoon 19. juni 2021 kl. 13:47 
also weapons of type EQUIP2 cant be excluded. Is that a bug? See for example https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=1377883019&searchtext=ttt+controllable+manhack
Thairoon 18. juni 2021 kl. 14:16 
oh nicee, i thank you for implementing^^
Malivil  [ophavsmand] 18. juni 2021 kl. 12:44 
And now there is. Thanks for the idea =)
Malivil  [ophavsmand] 18. juni 2021 kl. 12:07 
There is not currently a way to do that, no
Thairoon 18. juni 2021 kl. 12:05 
hey, is there a way of excluding equipment weapons like the radar? only found an option too include in the docs.
Thairoon 13. juni 2021 kl. 6:18 
hmm okay
Malivil  [ophavsmand] 13. juni 2021 kl. 6:01 
The client side settings apply to any server you connect to because they belong to the client. That's how they work and I verified that by testing. I'm sorry Thairoon but I am not going to implement some extremely custom something that risks breaking other addon compatibility. It's not worth it.
Thairoon 13. juni 2021 kl. 5:37 
if i can count my local host as a server too, then the settings i have set for me on my server do not apply on my local host^^
and to extend the function, there could also be an if condition binding the functions execution to an id that is this unique addon name else drop it and remove the previous setting
Malivil  [ophavsmand] 13. juni 2021 kl. 5:25 
Thairoon: I'm not saying if they have both on one server, I'm saying if someone goes to a server running this and then to a different server running another version it causes problems.

And no, it wouldn't avoid compatibility issues because the very fact you are setting the client values to something invalid (-1 or 0) is what causes the compatibility issues.
Thairoon 13. juni 2021 kl. 5:18 
why would somebody add this addon and another (BEM itself or other versions of Custom Roles)
if this here already contains it? and you listed above that installing other versions of CR and BEM itself would cause compatibility issues under conflicts too^^

and in my last comment i mentioned a function example with a if condition that applies the code clientside if the server has allow_change set to 1. that would also prevent compatibility issues if someone would still install another addon.
Malivil  [ophavsmand] 13. juni 2021 kl. 4:58 
At this point the main problem is compatibility, not how to get the client to not have default values. As I mentioned in one of my previous comments, I wrote a proof-of-concept and while it worked in this addon, it caused problems with any other addon that had BEM functionality (BEM itself, other versions of Custom Roles, etc.) and that's not something I wanted to do.

If you set those client values to 0 or -1 and that client joins another server that isn't running code that supports that, their shop window is completely messed up and unusable. They can fix it by changing the client setting values but any time they joined a server running this code they would have the same problem and I don't want to cause that.
Thairoon 13. juni 2021 kl. 4:58 
a function that does:
if server convar allow_change = 1 then
ulx cexec <playername> allow_change = -1
Thairoon 13. juni 2021 kl. 4:53 
thats okay^^ at least i know now this isnt done so easily.
btw. i was referring to to ulx beeing able of executing commands on clients
beacuse u said it would be doable if the convar would be set on clientside to -1.
dunno what exactly u where thinking of when u said that but that was just an idea as an solution for that problem
Malivil  [ophavsmand] 13. juni 2021 kl. 4:42 
Thairoon: I don't think there is a good way of implementing this without breaking compatibility with other systems which I won't do. If you are really determined to force your clients to use a specific different default, you can use your ULX way to do that but I don't really understand why this is so important. If a player wants to have a different configuration, they should be able to. If your players are asking for the configuration to change, just tell them how to do it themselves. It's in the F1 menu so it's really easy to change.

I think that's as much time as I'm willing to spend on this, sorry.
Thairoon 13. juni 2021 kl. 2:39 
i had another idea. i remembered my server is running ulx, which enables me to remotely run conosle commands on other players clients. what i havent foud out is how to autoexecute a ulx command on a player on server join. maybe knowing this helps?
Thairoon 13. juni 2021 kl. 2:25 
there is no way of solving the issue i guess?
1nvent0r 12. juni 2021 kl. 18:11 
@Malivil Ok, Thanks!
Malivil  [ophavsmand] 12. juni 2021 kl. 18:00 
@1nvent0r: If you're using a peer-to-peer game you can put the settings you want in the listenserver.cfg file inside your garrymod/cfg folder
1nvent0r 12. juni 2021 kl. 17:55 
Is there a way to edit the settings for a steam peer2peer game? Pardon my ignorance but I don't know anything about the gmod config. Do I need a dedicated server?
Malivil  [ophavsmand] 12. juni 2021 kl. 11:58 
autoexec.cfg only runs on the client, it doesn't force a client to run something
I don't think it runs on a server at all
Thairoon 12. juni 2021 kl. 11:53 
i understand, cant that be achieved too by adding the convar line with value -1 to the autoexec.cfg of the server? it would be executed on every client right? or did i also missunderstood the functionality of the autoexec.cfg?^^
Malivil  [ophavsmand] 12. juni 2021 kl. 11:51 
I tested it, it's doable... but if someone switches to a server that doesn't have the same logic, their buy menu completely collapses and is not usable.

So, while I think it would be possible to get what you want working, I don't think I'm going to include it because it causes compatibility problems with other servers that don't have matching logic and one of my tenants is cross-addon compatibility. Sorry =/
Malivil  [ophavsmand] 12. juni 2021 kl. 11:15 
That's just over-complicating things...

The right way to do something like this is to have the clientside convars default to an "unset" value, like -1 and then use the server-side values if the client is -1
I can do that, but what I can't do is force anyone who has clientside convars already (e.g. anyone who has ever loaded BEM or any of the CRs that integrate it) to use the new "-1" defaults.

So you can recommend your players set it to "-1" to let the server decide, but most people won't know to do that.
Thairoon 12. juni 2021 kl. 7:20 
I had an idea. would it work if there would be a clientside convar in the autoexec.cfg of the server that would reveal the current BEM settings of the client which the server could use to decide whether to let client override?
Malivil  [ophavsmand] 12. juni 2021 kl. 5:39 
Yea, that's not really how that stuff works, sorry
Thairoon 12. juni 2021 kl. 4:58 
the clientside convars could be set to the default values on startup if allow_change hasnt been 1 on last startup^^
Thairoon 12. juni 2021 kl. 4:53 
Hmm I have really no idea on how to interpret that code I just have advanced basic knowledge^^
But what if its Like this:

cols = serverCols
rows = serverRows
size = serverSize
if allow_change then
default = {
cols = serverCols
rows = serverRows
size = serverSize
}
cols = clientCols
rows = clientRows
size = clientSize
end

A simple default is given it wouldnt deny client override. Wouldnt that work? Or am I thinking a wrong logic?^^
Malivil  [ophavsmand] 11. juni 2021 kl. 16:33 
That's exactly what it does, except I have no way of telling whether they changed the client side values so if allow_change = 1, then it uses the client values instead of the server values

Like this:

cols = serverCols
rows = serverRows
size = serverSize
if allow_change then
cols = clientCols
rows = clientRows
size = clientSize
end
Thairoon 11. juni 2021 kl. 13:54 
I dont know if that would work just a thought:
Perhaps if you cant GET clientside convar setting state you could write a function allowing clientside overwrite. Something like "if server convar allow_change = 1 then client can convar cols,rows,size.
Malivil  [ophavsmand] 11. juni 2021 kl. 13:25 
The current implementation is a 1:1 from Better Equipment Menu, you either let the client choose or the server tells them what to use.

I would consider changing that but the problem is how do I know if someone wants to use the values they've set versus what you've set on the server? I can't just check for the client-side defaults because if someone wants to actually use those values, it will use the server values instead.
Thairoon 11. juni 2021 kl. 12:50 
@Malivil yw :) but Its still not working the way I imagined. My Idea is I wanted to set a serverside default and enable the players to adjust to their needs. The Problem Im experiencing is the moment I set the allow_change convar from 0 to 1 then the serverside convars dont apply the default cols, rows and size convars anymore. Is there a way to quickly adjust that?
Malivil  [ophavsmand] 11. juni 2021 kl. 8:43 
@Thairoon: All the same BEM convars should be available but you're right I didn't have them in the docs, I just added them. Thanks for letting me know =)
Thairoon 11. juni 2021 kl. 8:37 
Hey @Malivil,
i was looking for some serverside convars for the Built in BEM but havent found any in the docs.
Are there any? If not, do you think you can implement the column, row and icon size ones like in the original? would be really nice to be able to configure it serverside.
Malivil  [ophavsmand] 9. juni 2021 kl. 5:47 
@Horolicht: If you and your friend have some time and are willing to test, I just put out an update that optimizes something that could have been causing the FPS problems. Can you give it a try and see if that's better? It's OK if you don't have time or don't want to =)
Horolicht 27. maj 2021 kl. 12:49 
@Malivil
After everything we decided to swap to a different Custom Roles addon. With this the lag issue was solved and it stopped giving us headaches. Anyway thank you for your effort :Mu:
Malivil  [ophavsmand] 22. maj 2021 kl. 11:37 
@RuinSmith_Hlit: Luckily I already had a system in place that made this pretty easily to do
RuinSmith_Hlit 22. maj 2021 kl. 11:19 
everytime i am surprised in your ability to do requests like that, thank you so much!
Horolicht 22. maj 2021 kl. 9:52 
@Malivil
It's something we can atleast test out, still I don't believe that solves the issue. Next thing we think about it to disable the throttlng of the GPU itself by some third party software or something.
It really is bizarre...
Malivil  [ophavsmand] 22. maj 2021 kl. 9:21 
@Horolicht: I honestly have no idea what could cause that. My previous comment to you had a list of the things that this addon displays which really isn't that much. You could try disabling them (via ConVars) to see if that makes a difference?
Horolicht 22. maj 2021 kl. 8:14 
@Malivil Heyy we sadly couldn't find a solution, but we found an issue we can not pin down. When having this addon active my friends GPU throttles down to like 1-2% usage, which of course causes lag spikes. Without the addon his GPU works fine. We have checked/updated the driver and deactivated everything which could interfere with the gmod settings, but it's no use. He is using an AMD Radeon R9 200 graphics card.
Perhaps you have an idea? Also we did make sure that we both have only this specific addon subscribed.
Malivil  [ophavsmand] 22. maj 2021 kl. 5:44 
@RuinSmith_Hlit: I added the feature you asked for =)

There is a new paragraph named "Bypassing Weapon Randomization" on the CONVARS page on my GitHub that explains how it works: https://github.com/Malivil/TTT-Custom-Roles/blob/master/CONVARS.md#bypassing-weapon-randomization
Malivil  [ophavsmand] 22. maj 2021 kl. 4:52 
@Horolicht: I would be very curious to know. There aren't many things the addon actually renders. Just the icons over everyone's heads, labels when you look at someone, the color change for Zombies, and the halo affect for Zombie vision, Vampire vision, and traitor vision (if it's enabled).
Horolicht 22. maj 2021 kl. 0:26 
@Malivil This should not be the problem since we specifically took care that we have the same things from our collection subscribed. When finding a solution I will come back here to report.
Malivil  [ophavsmand] 21. maj 2021 kl. 19:05 
There isn't currently a way of configuring that, no. I can add a system using a similar approach to the RoleWeapons and Excludes system (e.g. you create a weaponname.norandom.txt in the data/roleweapons/{RoleName} folder)
RuinSmith_Hlit 21. maj 2021 kl. 17:00 
probably going to be an impossible question to answer but, with random shops and there percentages, is there anyway to set an item to be 'always there' ignoring making the item a 'tool' ?