-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
playermodels: Unique Playermodels at round start #1487
base: master
Are you sure you want to change the base?
Conversation
Every Player gets a different model assigned at round start.
Menu Button
En Label added for unique model
De Label added for unique model
just fixed a short error on my side
fixed the spaces...
You know that this is already a thing in TTT2? :D |
Huh? Maybe I am blind lol... Doesn't the current "model_per_Round" assign the same model to everyone at round start? The Changes im proposing is that at round start everyone gets assigned a different model. |
Oh sorry, then nevermind! I'll review it later today, thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review, it kind of got lost in my todo list.
I'd like to change this a bit. Your implementation now results in three modes:
- random identical playermodel on map chanage
- random identical playermodel on round change
- random unique playermodel on round change
Imho it would be better to keep the two old modes as is (new model assignment on round or map change) and just modify your convar so it affects both modes. If your convar is enabled, a random unique player model is selected no matter the selection mode.
Does that make sense to you? I think this would be better and cleaner.
I was sadly quite busy the last 2 weeks but should be able to get to it soon. |
No worries, I'm out of town as well. The proposed changes should probably be pretty easy for you |
Maybe someone else takes a look at this as I reworked this a lot compared to the initial PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly is the goal of this change?
- diversify the selectable playermodels. So that not everyone looks the same (but allow duplicates)
- give a hard guarantee that any two players won't have the same model. So that you can instantly recognize a specific player (besides identity-swapper shenanigans etc.)
Because currently the implementation does the former and the settings implies the latter.
We need to consolidate this
if cvSelectUniqueModelPerPlayer:GetBool() then | ||
local plys = player.GetAll() | ||
for i = 1, #plys do | ||
plys[i].defaultModel = playermodels.GetRandomPlayerModel() | ||
end | ||
else | ||
local plys = player.GetAll() | ||
for i = 1, #plys do | ||
plys[i].defaultModel = nil | ||
end | ||
|
||
self.playermodel = playermodels.GetRandomPlayerModel() | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TimGoll
Can we find out what addons etc. write to .defaultModel
? Because until now we (ttt2) never wrote to it and only read it.
If we start writing to and even resetting(!) it that might be a problem. Even more so now that the default behaviour is changed here.
Don't get me wrong this could all be completely fine, but i have no idea where any value for .defaultModel
would have come from. Certainly not from ttt2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had the same thoughts, however I'm unable to find any use of that variable in our whole code base. My test server also has loads of addons and I didn't encounter any issues. My suspicion is that this is a very old part of the code that is no longer used. But I could also introduce a new variable for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.defaultModel
is used twice in our codebase.
First occurrence in plymeta:SetModel(mdlName)
as a fallback if the given mdlName
is not a valid model.
Second occurrence which calls the function in the first occurrence with ply.defaultModel or GAMEMODE.playermodel
. Which is somewhat stupid in itself ...
If we can reasonably believe that this does not break playermodelselector addons i'm fine with merging this. streamlining the playermodel handling can come later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that it is set nowhere. But you are right. I might ask some EPMS users on discord to test this branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The former. I guess the wording in the UI is then a bit unfitting. Unique models are more complex and are probably not worth it |
At Round Start, if the option is activated, each player gets assigned a different playermodel from the pool.