How do I change the player's height? Created 1 year ago2023-07-16 08:26:47 UTC by shreder95ua shreder95ua

Created 1 year ago2023-07-16 08:26:47 UTC by shreder95ua shreder95ua

Posted 1 year ago2023-07-16 08:26:47 UTC Post #347709
So I want to make a mod for Half-Life where you play as the houndeye (my favorite xenian!), but it would be weird if the player was 150 cm. long.
Do you guys know how to change the player's height?
Posted 1 year ago2023-07-16 10:04:02 UTC Post #347710
A common way to make the player smaller is a clever use of relativity: Just make everything else bigger. Just double the size of your levels, monsters, items etc.
Of course, doubling the size of your level in vanilla goldsrc might not be too optimal as you're halving how big you can make your maps which is already pretty limited in goldsrc, but at least it's an easy method that doesn't require coding.

As for coding it, it might be possible to halve the height of the view (v_origin perhaps?) though I haven't looked much into the view part of the code so I might be wrong there.
After that, the map compilers will still generate cliphulls for a normal player's size but you could use info_hullshape to halve the collision box experienced by the player.
Or since you're already coding stuff, use the source code that comes with VHLT and, if I'm not mistaken, change g_hull_size in hlcsg/hullfile.cpp. The three vectors are hull0, hull1, hull2, and hull3 respectively, but we only want to change hull1 (commented as 32x32x72, standing hull) and hull3 (commented as 32x32x36, crouching hull). Just halve the Z value in these vectors (i.e. {-16, -16, -36} => {-16, -16, -18}). Then using this new compiler, any new maps compiled with it will produce cliphulls for a player half the original height.
Posted 1 year ago2023-07-16 18:41:45 UTC Post #347711
Thanks!
You must be logged in to post a response.