This is a cryptographically signed message in MIME format.
--
Howdiez all,

Am looking for some tips or suggestion on how to fix some hat code we're
doing for our project. It uses a script made in /scripts folder from a
list of characters. All works well except when  getting down to spawning
the gib, it gives the message on line 958 of c_baseentity.cpp "Model
could not be found, index is -1" although verified thoroughly that it is
not a problem with the model...we debugged the parameter being passed in
and it is "models/hats/carsonhat.mdl" which is a fully functional model.

Anyway, to explain how we have our setup its like this...........We have
all characters with hat attachments using bodygroups with flag in QC set
to off so when players spawn the code enables the hat. Once a player
dies a world hat model spawns and falls.

Here's what we have in c_baseanimating.cpp

=================
    pRagdoll->SetBodygroup( 1,0 );
    #define PREFIX 11 //strlen("characters\")
    const char *pHatModelName =
g_pHatAssociations->GetString(hdr->name()+PREFIX,NULL); //changed for hats
    #undef PREFIX
    if(pHatModelName)
    {
        Vector origin;
        int boneIndex = pRagdoll->LookupBone("ValveBiped.Bip01_Head1");
        ragdoll_t *ragdoll = pRagdoll->m_pRagdoll->GetRagdoll();
        Vector velocity(0,0,0);
        AngularImpulse angularVelocity(0,0,0);
        for(int i=0;i<ragdoll->listCount;i++)
        {
            if(ragdoll->boneIndex[i]==boneIndex)
            {
                QAngle angle;
                ragdoll->list[i].pObject->GetPosition( &origin, &angle );
                ragdoll->list[i].pObject->GetVelocity( &velocity,
&angularVelocity );
                VectorScale(velocity,1.5,velocity);
                VectorScale(angularVelocity,1.5,angularVelocity);
                break;
            }
        }

C_Gib::CreateClientsideGib(pHatModelName,origin,velocity,angularVelocity,cl_hat_fadeout_time.GetFloat());
    }
========================

Thanks,
Gus
http://www.wildwestgames.org
Outlaws & Lawmen Mod Project
--
Content-Description: S/MIME Cryptographic Signature

[ smime.p7s of type application/x-pkcs7-signature deleted ]
--

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to