AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Access to model struct (https://forums.alliedmods.net/showthread.php?t=112811)

joropito 12-21-2009 09:55

Access to model struct
 
Is there a way to access to model struct as defined in hlsdk?

I mean to access this info

PHP Code:

typedef struct model_s
{
    
char            nameMAX_MODEL_NAME ];
    
qboolean        needload;           // bmodels and sprites don't cache normally
    
modtype_t       type;
    
int             numframes;
    
synctype_t      synctype;
    
int             flags;

//
// volume occupied by the model
//          
    
vec3_t          minsmaxs;
    
float           radius;

//
// brush model
//
    
int             firstmodelsurfacenummodelsurfaces;
    
int             numsubmodels;
    
dmodel_t        *submodels;
...
... 

I guess it's possible via entity pdata, but I'm not sure

PHP Code:

struct cl_entity_s
        qboolean                        player
;     // True if this entity is a "player"
        
int                             index;      // Index into cl_entities ( should match actual slot, but not necessarily )
        
entity_state_t                  baseline;   // The original state from which to delta during an uncompressed message
        
entity_state_t                  prevstate;  // The state information from the penultimate message received from the server
        
entity_state_t                  curstate;   // The state information from the last message received from server
...
...
...
        
struct model_s                  *model;     // cl.model_precache[ curstate.modelindes ];  all visible entities have a model
        
struct efrag_s                  *efrag;     // linked list of efrags
...
... 

Thanks

Arkshine 12-21-2009 10:01

Re: Access to model struct
 
It's possible with Orpheu. In the latest version there is already 2 or 3 structures added. But without orpheu, I have no idea.

joropito 12-21-2009 10:18

Re: Access to model struct
 
Yes, I know with orpheu I can but I'm looking for somethink more standard.

I don't know but I guess combining FM get_pdata and HAM get_pdata_cbase there's a way...

Arkshine 12-21-2009 10:23

Re: Access to model struct
 
Soon Orpheu will become the standart. :mrgreen:

joropito 12-21-2009 11:56

Re: Access to model struct
 
Just a question, how can I access, for example, this offsets in an CBaseAnimation entity (ex: func_illusionary)?

Sub-Class Table (1 Deep): DT_BaseAnimating
Sub-Class Table (2 Deep): DT_BaseEntity
Sub-Class Table (3 Deep): DT_CollisionProperty
-Member: m_nSolidType (offset 41)
-Member: m_usSolidFlags (offset 36)

PHP Code:

CBaseAnimating:
 
Sub-Class Table (1 Deep): DT_BaseAnimating
  Sub
-Class Table (2 Deep): DT_BaseEntity
   Sub
-Class Table (3 Deep): DT_AnimTimeMustBeFirst
   
-Memberm_flAnimTime (offset 40)
  -
MemberAnimTimeMustBeFirst (offset 0)
  -
Memberm_flSimulationTime (offset 44)
  -
Memberm_vecOrigin (offset 796)
  -
Memberm_nModelIndex (offset 30)
   
Sub-Class Table (3 Deep): DT_CollisionProperty
   
-Memberm_vecMins (offset 8)
   -
Memberm_vecMaxs (offset 20)
   -
Memberm_nSolidType (offset 41)
   -
Memberm_usSolidFlags (offset 36)
   -
Memberm_nSurroundType (offset 40)
   -
Memberm_triggerBloat (offset 42)
   -
Memberm_vecSpecifiedSurroundingMins (offset 44)
   -
Memberm_vecSpecifiedSurroundingMaxs (offset 56



All times are GMT -4. The time now is 04:06.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.