HIT Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [coding question]Changing hulls  (Read 922 times)

0 Members and 1 Guest are viewing this topic.

Shooter__Andy

  • Idea Generator
  • Gargantua
  • *******
  • Offline Offline
  • Posts: 643
  • ZombieEd. dev.
    • View Profile
    • Shooter__Andy's HomePage (in russian)
[coding question]Changing hulls
« on: May 11, 2008, 11:30:15 AM »

As you know, there is four hulls, used by GoldSrc Engine: Point, Normal Player, 64x64x64 and Ducked Player. I want to change 64x64x64 hull to the headcrab size for my Zombie Edition mod. I don't fully understand what I did, but it seems that I've changed point hull but anyway it is used only in waterjump function... So, it isn't working. What did I done? Firstly, I've written hullfile containing this:
Code: [Select]
32 32 72
24 24 24
32 32 36
It is copy-paste from Natural Selection hullfile with changed second string.
Then, I've compiled map with different-size holes using this file.
In SDK I've changed PM_Duck function (because headcrab-player is crouched):
Code: [Select]
if (pmove->iuser4 == 1)

    {

    pmove->usehull = 2;

        if ( pmove->onground != -1 )

        {

            for ( i = 0; i < 3; i++ )

            {

                pmove->origin[i] -= ( pmove->player_mins[1][i] - pmove->player_mins[0][i] );

            }

            for ( i = 0; i < 3; i++ )

            {

                pmove->origin[i] -= ( pmove->player_mins[2][i] - pmove->player_mins[1][i] );

            }

            // See if we are stuck?

            PM_FixPlayerCrouchStuck( STUCK_MOVEUP );

            // Recatagorize position since ducking can change origin

            PM_CatagorizePosition();

        }
This was added before the normal checking for the Duck key, flag etc (now it's in else).
player_mins[2] and player_maxs[2] are defined in PM_Init.
The problem is that player with this hull is stucking in every surface he touch. Why and how to deal with it?
Logged