Change player model

Avatar
Tank420
26 Posts
Posted Jun 09, 2012
ok a little help please, i've been looking for a while now for a tutorial or any information about how to change the player model or skin, can anyone point me in the right direction
Advertisement
Registered users don’t see ads! Register now!
Avatar
spongylover123
944 Posts
Posted Jun 09, 2012
Replied 21 minutes later
there was a topic about this, search for it.
Avatar
FelixGriffin
2,680 Posts
Posted Jun 09, 2012
Replied 28 minutes later
Short answer: the cl_playermodel variable.
Avatar
Another Bad Pun
516 Posts
Posted Jun 09, 2012
Replied 1 minute later
Look in this thread: mapping-help/robots-not-chell-t3709.html?hilit=robots%20not%20chell

This one is on how to make the player model a robot... But you can use this method for many different other models too.

Avatar
Tank420
26 Posts
Posted Jun 10, 2012
Replied 6 hours later

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

Avatar
Lpfreaky90
2,842 Posts
Posted Jun 10, 2012
Replied 3 hours later
As far as I know the point_clientcommand setmodel is the only way, so if you want a different model you should use that.
Avatar
Tank420
26 Posts
Posted Jun 10, 2012
Replied 3 hours later
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?
Avatar
BenVlodgi
633 Posts
Posted Jun 12, 2012
Replied 1 day later

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/player

BenVlodgi wrote:
This is fantastic news! thanks!
EDIT:
However, this does cause the portal-gun to be held at a bad angle

CaretCaret 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 onmapspawn

spongylover123 wrote:
you have to prechache the model. That's how I got atlas to walk. the portalgun is an issue though.

Avatar
FelixGriffin
2,680 Posts
Posted Jun 12, 2012
Replied 10 hours later
I might make an instance for this once it works.

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.

Avatar
ChickenMobile
2,460 Posts
Posted Jun 12, 2012
Replied 10 hours later

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.

Avatar
Tank420
26 Posts
Posted Jun 13, 2012
Replied 5 hours later
ok so i'm trying this right now, and i don't see an issue with the angle of the portal gun.

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

Avatar
josepezdj
2,386 Posts
Posted Jun 13, 2012
Replied 1 hour later
@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...
Avatar
Tank420
26 Posts
Posted Jun 13, 2012
Replied 1 hour later

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

Avatar
josepezdj
2,386 Posts
Posted Jun 13, 2012
Replied 14 minutes later

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);*)

Avatar
Tank420
26 Posts
Posted Jun 13, 2012
Replied 6 minutes later

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

img

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.

img
img
img

Avatar
ChickenMobile
2,460 Posts
Posted Jun 13, 2012
Replied 22 minutes later
To get rid of this problem, simply just change the player other than chell and then change back to pbody?
Avatar
Tank420
26 Posts
Posted Jun 13, 2012
Replied 3 minutes later
Errr

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

Avatar
ChickenMobile
2,460 Posts
Posted Jun 13, 2012
Replied 2 minutes later
tl;dr
Avatar
Tank420
26 Posts
Posted Jun 13, 2012
Replied 2 minutes later

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

img

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.

Advertisement
Registered users don’t see ads! Register now!
Avatar
Tank420
26 Posts
Posted Jun 13, 2012
Replied 1 hour later
got it working pretty successfully i think.

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.