Change player model
This one is on how to make the player model a robot... But you can use this method for many different other models too.
spongylover123 wrote:
there was a topic about this, search for it.Tank420 wrote:
i've been looking for a while now ... can anyone point me in the right direction
Sorry, not clear enough for you. posts like this annoy me, i had been looking, i failed to find something, so i asked the community for help, you had the time to respond, so why not go that little bit further and try to help, your response was not constructive, and was a waste of your time.
thanks for both the short answer, i shall give it a go figuring cl_playermodel out myself, i learn better that way, and if i get stuck i'll refer to the tutorial
Thanks again
Tank
EDIT
So i've tried getting to grips with cl_playermodel and gotten no where, so i put a point_clientcommand in with 'setmodel player/chell/player' as the parameters, but i assume there is a better way than this.
what is cl_playermodel
an entity? a map property, confused.
ADDITIONAL EDIT
I see cl_playermodel is in a local config file.
What i mean to ask is, how do you set the player model in hammer, so the level starts with a different character
Tank420 wrote:
do we know how the game picks, is it by game type? i.e. if you're playing single you're chell, if you're co op then pbody or atlas, and if workshop bendy?
yup
here is a conversation from the secret steam forums... which you probably don't have access to
spongylover123 wrote:
in hammer, you need to make the output.
OnMapSpawn - @command - Command - setmodel player/chell/playerBenVlodgi wrote:
This is fantastic news! thanks!
EDIT:
However, this does cause the portal-gun to be held at a bad angleCaretCaret wrote:
Yeah, looks like it wasn't the best solution. For me the portal gun is held at a weird angle, there's no walking animation and it resets to bendy when a save is loaded.Motanium wrote:
Try using onmapload instead of onmapspawnspongylover123 wrote:
you have to prechache the model. That's how I got atlas to walk. the portalgun is an issue though.
It seems like what you'll need is the logic_auto and point_clientcommand, plus a prop_dynamic (will a static one work? IDK) of Chell to precache te model. You could put it in a nodraw-box so that it's not in your test chamber itself.
FelixGriffin wrote:
It seems like what you'll need is the logic_auto and point_clientcommand, plus a prop_dynamic (will a static one work? IDK) of Chell to precache te model. You could put it in a nodraw-box so that it's not in your test chamber itself.
Exactly right. In order to change the playermodel you need to precache it (as well as the animations with it. This is automatically done when you place in a dynamic model).
Changing the playermodel is easy in singleplayer: by just using the cl_playermodel command. However if you want to change the player model in coop; that may take a bit more work such as grabbing a modelindex and setting the player's modelindex to it.
if there is tho, would this not fix it
viewmodel_offset_y 0.0
viewmodel_offset_z 0.0
viewmodel_offset_x 0.0
EDIT
Ok so i think i see what the problem is, the portal gun is being held not at the wrong angle, but the wrong height, i.e. it starts at chell's height and doesn't change for ballbot, eggbot holds it about the same height anyway. Can't find bendy to prechace(although i guess you wouldn't need to prechache him on the community maps, cos he's the default) or set model as, but didn't really want him anyway, but i assume when the map is uploaded, the gun would start at bendy's height, and would only really match ballbot's height. I guess.
also > Tank420 wrote:
viewmodel_offset_y 0.0
viewmodel_offset_z 0.0
viewmodel_offset_x 0.0
doesn't help
josepezdj wrote:
@Tank420: After reading this thread I'm not really sure if you already managed to change the player model or not, as all replies urged you to visit other threads, would you please confirm? I think this is not difficult to achieve...
You might wanna re-read the posts, only 2 people have pointed me else where, and the linked page was useful, but essentially it's not that difficult, you need to put a logic_auto, point_clientcommand, and a model of which ever player you want to use, all in a hidden room. make the logic_auto -> onmapspawn -> @command -> command -> setmodel
i am in the the process of making a character selection screen, and i have run into a problem changing from chell to eggbot, (holds the portal gun near his head)the problem doesn't arise when you change from chell to ballbot or ballbot to eggbot or any other combinations, just chell to eggbot, so i've made eggbot's change, include a 0.1 second change to ballbot before changing to eggbot.
Below should be a link to the work i've done so far, in this file there are 3 rooms, 1 is the global pti instance, 2 is the room i have described above, 3 is the room with the character selection. if you just want to have it change to a different character, room 2 is all you need, and you should change the logic auto depending on what you want
setmodel player/ballbot/ballbot
setmodel player/chell/player
setmodel player/eggbot/eggbot
(for this i suggest a 0.1 sec change to eggbot first to avoid strange positioning of portal gun)
http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=2096
Tank420 wrote:
You might wanna re-read the posts, only 2 people have pointed me else where, and the linked page was useful, but essentially it's not that difficult, you need to put a logic_auto, point_clientcommand, and a model of which ever player you want to use, all in a hidden room. make the logic_auto -> onmapspawn -> @command -> command -> setmodel
Exactly. That would be the scenario.
About the position of the portalgun, you have to use scripting and set its angles (*could it be something like:
w_portalgun.SetAngles(ang.x,y,z);*)
josepezdj wrote:
About the position of the portalgun, you have to use scripting and set its angles (*could it be something like:w_portalgun.SetAngles(ang.x,y,z);*)
Tbh the actual angle of the gun is fine, it's the height, and it's only really an issue when you can see the player model, you know how when you look through a portal and you can see yourself, your crosshairs normally are the same height as your gun, well depending on who you started out as, the crosshairs remain at the same height, while the position of the gun actually moves as it should. except with the slight glitch i mentioned when changing from chell to eggbot.
and i haven't got as far as learning how to implement scripting yet
Strange Eggbot Gun Position after changing from chell to eggbot
Height Differences(i don't really see this being an issue, i've made it switch to third person for 3 seconds then back to first person.
Tank420 wrote:
i am in the the process of making a character selection screen, and i have run into a problem changing from chell to eggbot, (holds the portal gun near his head)the problem doesn't arise when you change from chell to ballbot or ballbot to eggbot or any other combinations, just chell to eggbot, so i've made eggbot's change, include a 0.1 second change to ballbot before changing to eggbot
It does turn out i've lied there tho, i've actually set the delay to 0.01
chickenmobile wrote:
tl;dr
Wha?
Also, new problem, a combination unknown to me at this second causes ballbot to hold the gun strange too, i do wonder if this is just random?
EDIT:
it appears to be the same issue actually, from chell to ballbot, but putting it on eggbot first, then ballbot solves that too, so it seems when changing to one of the bots, you have to go to the other one first, then change to the one you want.
stick that in your super secret steam forum.
ADDITIONAL EDIT:
i'm gonna publish this and see how it behaves with bendy as the default model.
(This seems to work fine, i do have the logic_auto changing to chell on mapspawn, but bendy would still be the default that it loaded wouldn't it)
ADD ADD EDIT:
Third person needs sv_cheats 1? Really?
ADD ADD ADD EDIT:
Turns out, the crosshairs stay the same height at all times anyway by the looks of things
AnotherEdit
Turns out if you are going to use bendy you need chell to have a dummy change too. and bendy will override the walk animation.
Workshop file
http://steamcommunity.com/sharedfiles/filedetails/?id=76596900
Zipped VMF
http://forums.thinking.withportals.com/downloads.php?view=detail&df_id=2096
it seems the bottom line is, you need to change the player model twice, once real quick, and in set orders
to change to a bot from chell, you must first change to the other bot
to change to chell from bendy, you must first change to a bot
and i haven't encountered problems with changing to bendy.
EDIT:
Ok so i might of made the workshop file into an online petition to valve to allow either the player to control which character they use, or give the peti editor the ability to pick.