Programming & Scripting

View unanswered posts | View active topics


Post a new topicPost a reply
Previous topic | Next topic 

User avatar   Skilled Modder Skilled ModderMember since: 30.04.2010, 14:42Posts: 714Location: Russia Likes: 21
 

 Post Topic: Changing players bounding box?
PostPosted 12.02.2012, 14:42 
Greetings. Very simple question here: is it possible to edit player bounding box size? Working with real-scale doorways, stairs, and so on, I often have problems navigating there with default, relatively big bounding box. The character is a bit fat, you know. :)

Thanks in advance! :)

User avatar   Beginner BeginnerMember since: 26.10.2009, 05:06Posts: 73Location: Australia Likes: 0
 

 Post Topic: Re: Changing players bounding box?
PostPosted 13.02.2012, 05:56 
Not sure if this is the best way to do it, but you can modify the player.lua file (found in Scripts/entities/actor/ folder).
If you look at the Stance section of the file (near the top ish) it will look something like this:
Code:
stanceId = STANCE_STAND,
maxSpeed = 4.0,
heightCollider = 1.25,
heightPivot = 0.0,
size = {x=0.41,y=0.41,z=0.3},
viewOffset = {x=0,y=0.065,z=1.65},
weaponOffset = {x=0.2,y=0.0,z=1.35},
viewDownYMod = 0.05,
modelOffset = {x=0,y=0,z=0.0},
name = "stand",
useCapsule = 1,


If you change the size's Z parameter from 0.3 down to say 0.2 then that will make the character short enough to fit through a standard height door. You can try fiddling with the other values as well but it might take some trial and error until you get something that works the way you like it. Also note that you may want to change the values for the other stances as well (crouch, swim etc) depending on your needs.