• Prophunters - Change player models for hunters and props
    17 replies, posted
Hi ! I use Prophunters on a private server to play with friends: https://steamcommunity.com/sharedfiles/filedetails/?id=260275546 I would like to change player models for hunters and props but I don't know how to do it. Among all the files, sv_player.lua is the one to edit: Dropbox For example, for hunters, I would like this model: https://steamcommunity.com/sharedfiles/filedetails/?id=166239934 And for props, this one: https://steamcommunity.com/sharedfiles/filedetails/?id=170910643 Thank you for your help!
figure it out. this is really not hard at all. it's pretty audacious of you to come here asking for help for changes to your own private version of this mode.
Is it not this part that you have to add playermodels? I could be wrong but that's what looks like you have to change or add. local playerModels = {} local function addModel(model, sex) local t = {} t.model = model t.sex = sex table.insert(playerModels, t) end addModel("male03", "male") addModel("male04", "male") addModel("male05", "male") addModel("male07", "male") addModel("male06", "male") addModel("male09", "male") addModel("male01", "male") addModel("male02", "male") addModel("male08", "male") addModel("female06", "female") addModel("female01", "female") addModel("female03", "female") addModel("female05", "female") addModel("female02", "female") addModel("female04", "female") addModel("refugee01", "male") addModel("refugee02", "male") addModel("refugee03", "male") addModel("refugee04", "male")
If you're not here to help, why did you even post then? I just want to have the best gameplay experience with friends, sorry if I don't run and pay a community server. Besides, I was going to release a tutorial on the steam page of Prophunters after figuring out here how to do change player models.
lemme rephrase, i didn't mean "asking for help" i meant "asking for exactly what to do" and yes, if the author used models from garry's mod, just replace them with the ones you want it to be.
What about this part? function GM:PlayerSetModel( ply ) local cl_playermodel = ply:GetInfo( "cl_playermodel" ) local playerModel = table.Random(playerModels) cl_playermodel = playerModel.model local modelname = player_manager.TranslatePlayerModel( cl_playermodel ) util.PrecacheModel( modelname ) ply:SetModel( modelname ) ply.ModelSex = playerModel.sex net.Start("player_model_sex") net.WriteString(playerModel.sex) net.Send(ply) end Also, how do I differentiate props and hunters here? Could you give me an example please for both please?
Is there a github for that gamemode? It'll make it a bit easier so I can see all of the files.
I tried but the owner has not answered me sadly. Here my files for the gamemode : https://www.dropbox.com/s/sey1i9vhi6jijou/prophunters.rar?dl=0 I already did some modifications to change timer, set one hunter randomly every round and added some new taunts. I'm pretty sure hunters and props share the same models from that list randomly.
Hmmm I looked through the github and couldn't seem to find anything to change it. You could also try this - addModel( "hunk_cvp", "male") Although I don't think that will work. Try that and see if anything changes. If not I can keep looking through the github.
If you remove all of this, there is an error: addModel("male03", "male") addModel("male04", "male") addModel("male05", "male") addModel("male07", "male") addModel("male06", "male") addModel("male09", "male") addModel("male01", "male") addModel("male02", "male") addModel("male08", "male") addModel("female06", "female") addModel("female01", "female") addModel("female03", "female") addModel("female05", "female") addModel("female02", "female") addModel("female04", "female") addModel("refugee01", "male") addModel("refugee02", "male") addModel("refugee03", "male") addModel("refugee04", "male") No error with only this line: addModel( "models/player/lordvipes/rerc_hunk/hunk_cvp.mdl", "male") Only Blu and Orange Kleiner are available (they are not in the original gamemode). With only your line, no error either: addModel( "hunk_cvp", "male") But all models from the list are available (no Kleiner).
Ok I found something interesting. When you remove the addlist, and write this: function GM:PlayerSetModel( ply ) addModel( "HUNK_cvp", "male")     local cl_playermodel = ply:GetInfo( "cl_playermodel" )     local playerModel = table.Random(playerModels)     cl_playermodel = playerModel.model     local modelname = player_manager.TranslatePlayerModel( cl_playermodel )     util.PrecacheModel( modelname )     ply:SetModel( modelname )     ply.ModelSex = playerModel.sex     net.Start("player_model_sex")     net.WriteString(playerModel.sex)     net.Send(ply) end It works but both teams have the same skin. https://files.facepunch.com/forum/upload/487327/02cfc814-2634-430a-a600-a30471a8e867/image.png https://files.facepunch.com/forum/upload/487327/dd65a0fb-ed23-4006-bc4e-6ed7d29a30d8/image.png Hunk is going to take the color of its team. For some workshop models it's not the case: https://files.facepunch.com/forum/upload/487327/f767a659-3bdf-42a1-9841-b7070b43a84b/image.png I just have to select two differents skins with no color modification, no needs to change the code about this. However, I would like a specific skin for hunters and a specific skin for props.
I'll need to look through the github again at some point but, for the original list of playermodels, did it choose those playermodels at random for both the prop and the seeker?
Yep it does.
Yikes okay well for that part I'm not sure what to do. Unless someone else has a better idea, the only thing I could think of is you would have to rewrite part of the gamemode to make it so that the hunters are a specific model and the props are a specific model. Looking at the owner of the gamemode he doesn't seem to be willing to help with changing his gamemode in any way. After this point I won't be of much help to you. Sorry about that :/
Ok thanks for your help I'm still looking for someone to help me then. This can probably help: Gamemode Coding Help
rather than having it randomly select the model, ie: local playerModel = table.Random(playerModels) have a statement selecting the right model based on player team, like: local playerModel = table.Random(playerModels) if ply:Team() == 2 then -- hunters playerModel = playerModels[1] elseif ply:Team() == 3 then -- props playerModel = playerModels[2] end it would be better to have two tables separate for props and hunters so that you can have multiple models to select from
local playerModels = {} local function addModel(model, sex)     local t = {}     t.model = model     t.sex = sex     table.insert(playerModels, t) end addModel( "Tron Anon", "male") function GM:PlayerSetModel( ply )     local cl_playermodel = ply:GetInfo( "cl_playermodel" )     local playerModel = table.Random(playerModels) if ply:Team() == 2 then -- hunters   playerModel = playerModels[1] elseif ply:Team() == 3 then -- props   playerModel = playerModels[2] end     cl_playermodel = playerModel.model     local modelname = player_manager.TranslatePlayerModel( cl_playermodel )     util.PrecacheModel( modelname )     ply:SetModel( modelname )     ply.ModelSex = playerModel.sex     net.Start("player_model_sex")     net.WriteString(playerModel.sex)     net.Send(ply) end Thank you very much! This is what my code looks like. Sorry but I'm really a beginner with lua. If I want this specific skin for hunters: https://steamcommunity.com/sharedfiles/filedetails/?id=241187700&searchtext= ( "Tron Anon" ) And this specific skin for props: https://steamcommunity.com/sharedfiles/filedetails/?id=170910643 ( "Boxman" ) How do I write it please?
i imagine that something like this should work: local playerModels = {["prop"] = {},["hunter"] = {}} local function addModel(model, sex, team) local t = {} t.model = model t.sex = sex table.insert(playerModels[team], t) end addModel( "Boxman", "male", "prop") addModel( "Tron Anon", "male", "hunter") function GM:PlayerSetModel( ply )     local cl_playermodel = ply:GetInfo( "cl_playermodel" ) local playerModel = table.Random(playerModels["hunter"]) -- def. to hunter if ply:Team() == 3 then -- change if player on props team playerModel = table.Random(playerModels["prop"]) end     cl_playermodel = playerModel.model     --ect. ect. rest of hook then you can add models like before, but with a team selection added on addModel(model, sex, team) if that doesn't work, then either try some other method or use the fact that the number in the square brackets for the model table ( playerModels[NUMBER] ) corresponds to the order you add the model with addModel() function, and develop some logic to figure out what number it should be.
Sorry, you need to Log In to post a reply to this thread.