AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Missile hitbox (size) problem (https://forums.alliedmods.net/showthread.php?t=62981)

hlstriker 11-09-2007 00:39

Missile hitbox (size) problem
 
I made a missile that a player can shoot. It all works fine except it won't "touch" anything.

Here is the code:
PHP Code:

new missile engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"info_target"));
set_pev(missilepev_classnameMISSILE_CLASSNAME);
engfunc(EngFunc_SetSizemissileMISSILE_MINSMISSILE_MAXS);
engfunc(EngFunc_SetModelmissileMISSILE_MODEL);
engfunc(EngFunc_SetOriginmissileorigin);
set_pev(missilepev_solidSOLID_TRIGGER);
set_pev(missilepev_movetypeMOVETYPE_FLY);
set_pev(missilepev_velocityvelocity);
set_pev(missilepev_ownerid);
set_pev(missilepev_anglesangles); 

If I set the solid state as 'SOLID_BBOX' it WILL touch things, but the hitbox size seems to be about 0.1 x 0.1 and it won't use my specified size.

Setting it how it is now as 'SOLID_TRIGGER' doesn't touch at all.

Orangutanz 11-09-2007 11:45

Re: Missile hitbox (size) problem
 
Try it in this order:
Code:
ball = create_entity("info_target") set_pev(ball, pev_classname, "ball") set_entity_model(ball, "models/w_fb.mdl") set_pev(ball, pev_body, random_num(1, 3)) set_pev(ball, pev_movetype, MOVETYPE_BOUNCE) set_pev(ball, pev_solid, SOLID_TRIGGER) set_pev(ball, pev_friction, 0.25) set_pev(ball, pev_gravity, 1.0) set_entity_size(ball, Float:{-6.0, -6.0, -6.0}, Float:{6.0, 6.0, 6.0}) set_entity_origin(ball, ball_position[0]) set_pev(ball, pev_nextthink, get_gametime() + 0.1)
When creating entities etc I usually leave the size and origin to last and never had any problems at all.


All times are GMT -4. The time now is 01:21.

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