Raised This Month: $12 Target: $400
 3% 

[INFO] Fakemeta & Ham detailed function descriptions and examples


Post New Thread Reply   
 
Thread Tools Display Modes
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 12-02-2009 , 06:35   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #121

I've only tested with non-monsters entities but try this on that entity

PHP Code:
set_pev(entpev_solidSOLID_BBOX)
set_pev(entpev_movetypeMOVETYPE_TOSS)
set_pev(entpev_maxspeed9999.0
I don't know if BBOX it's right for that entity.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
solano
Member
Join Date: Nov 2009
Old 12-02-2009 , 06:40   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #122

Code:
    new Target[ 32 ];    
     read_argv( 1, Target, charsmax( Target ) );    
    new TargetIndex = cmd_target( id, Target, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE );    
    
         if ( !TargetIndex )   
        {       
            return PLUGIN_HANDLED;  
        } 
      
      new Float:Angles [ 3 ]; 
    new Float:Origin [ 3 ];  
    new Float:Forward[ 3 ];
    

       pev( TargetIndex, pev_origin, Origin );    
     pev( TargetIndex , pev_v_angle, Angles ); 

       angle_vector( Angles, ANGLEVECTOR_FORWARD, Forward );   
     xs_vec_mul_scalar( Forward, 150.0, Forward );    
        xs_vec_add( Origin, Forward, Origin );    

    new Zombie = create_entity( "monster_zombie" );  
    set_pev( Zombie, pev_origin, Origin );
    entity_set_int(Zombie,EV_INT_movetype,MOVETYPE_STEP);
    entity_set_int(Zombie,EV_INT_solid,SOLID_BBOX)
    //set_pev(Zombie,pev_enemy,id)
      DispatchSpawn( Zombie );    
     drop_to_floor( Zombie );
    
    new Float:TestOrigin[3];
    
    TestOrigin[0]=156.871551;
    TestOrigin[1]=892.470581;
    TestOrigin[2]=-1864.542480;
    
    engfunc(EngFunc_MoveToOrigin,Zombie,TestOrigin,100.0,MOVE_STRAFE)
this is the code i use and it doesnt work
solano is offline
solano
Member
Join Date: Nov 2009
Old 12-02-2009 , 06:43   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #123

btw is this the right function for the thing i want to do?
i want to make the monster "walk" to a specific location
walk is in "" because while walking if he sees a player he should start attacking him
solano is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 12-02-2009 , 11:26   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #124

Quote:
Originally Posted by solano View Post
btw is this the right function for the thing i want to do?
i want to make the monster "walk" to a specific location
walk is in "" because while walking if he sees a player he should start attacking him
I've tried with func_breakable entities and it walks fine and only tested with MOVETYPE_TOSS.
Try with that kind of entity, movetype and setup the model you want.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-02-2009 , 12:54   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #125

I don't think it will work with (real) monsters from HL1 because such monsters have predefined paths. I've tried and zombies are warp directly. Don't know how to force to generate paths. A way could be to create a dummy entity at the origin you want, then forcing the zombie to see it as enemy ( pev_enemy ) ; it may works.
__________________
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 12-02-2009 , 13:04   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #126

For bots, EngFunc_RunPlayerMove
For non-intelligent entities, EngFunc_MoveToOrigin
For monsters, EngFunc_WalkMove

Not tested but...
PHP Code:
EngFunc_WalkMove(edict_t *entfloat yawfloat distint iMode
Where:

- You get yaw using EngFunc_VecToYaw to convert vector to yaw (it returns a float value)
- The distance to walk is dist
- iMode
PHP Code:
#define WALKMOVE_NORMAL                 0           // Normal walkmove
#define WALKMOVE_WORLDONLY              1           // Doesn't hit ANY entities, no matter what the solid type
#define WALKMOVE_CHECKONLY              2           // Move, but don't touch triggers 
Give a try and tell us.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 12-02-2009 at 13:06.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-02-2009 , 13:17   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #127

Yeah, totally forget about this one. I'm blind because I'm reviewing the SinglePlayer HLSDK too.

Anyway, i've tested and the same result, zombie is warped instead of walking. Probably because there is not path available at this time.
__________________
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 12-02-2009 , 13:25   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #128

Quote:
Originally Posted by Arkshine View Post
Yeah, totally forget about this one. I'm blind because I'm reviewing the SinglePlayer HLSDK too.

Anyway, i've tested and the same result, zombie is warped instead of walking. Probably because there is not path available at this time.
Take a look into hlsdk-2.3-p3/singleplayer/dlls/monsters.cpp
PHP Code:
int CBaseMonster :: CheckLocalMove 
It says something about making WALK_MOVE for every step

PHP Code:
        // this loop takes single steps to the goal.
        
for ( flStep flStep flDist flStep += LOCAL_STEP_SIZE )
...
...
...
                if ( !
WALK_MOVEENT(pev), flYawstepSizeWALKMOVE_CHECKONLY ) )
... 
EDIT:

Remember to set MOVETYPE_WALK on the monster!!!!
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.

Last edited by joropito; 12-02-2009 at 13:27.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-02-2009 , 13:37   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #129

The same. Stepping by 16 units doesn't help. Well this function is just to test the origin step by step.

Quote:
Remember to set MOVETYPE_WALK on the monster!!!!
Not sure if I should do because zombie spawns already with a specific configuration. I don't see any reference of such move type for monsters. MOVETYPE_WALK would be only for player.

Code:
void CZombie :: Spawn() {     Precache( );     SET_MODEL(ENT(pev), "models/zombie.mdl");     UTIL_SetSize( pev, VEC_HUMAN_HULL_MIN, VEC_HUMAN_HULL_MAX );     pev->solid      = SOLID_SLIDEBOX;     pev->movetype      = MOVETYPE_STEP;     m_bloodColor        = BLOOD_COLOR_GREEN;     pev->health   = gSkillData.zombieHealth;     pev->view_ofs      = VEC_VIEW;// position of the eyes relative to monster's origin.     m_flFieldOfView  = 0.5;// indicates the width of this monster's forward view cone ( as a dotproduct result )     m_MonsterState    = MONSTERSTATE_NONE;     m_afCapability    = bits_CAP_DOORS_GROUP;     MonsterInit(); }

Edit: I was right, it crashes the server saying that's a bad movetype.
__________________

Last edited by Arkshine; 12-02-2009 at 13:48.
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 12-02-2009 , 13:44   Re: [INFO] Fakemeta & Ham detailed function descriptions and examples
Reply With Quote #130

I can't test right now (I'm at work).
I'm sure you have read my edit about movetype_walk

You can also take a look at hlsdk-2.3-p3/singleplayer/dlls/roach.cpp in CRoach::Move called from MonsterThink

As I see, the properties of the roach are

- SOLID_SLIDEBOX
- MOVETYPE_STEP
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:44.


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