AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   entity_set_model, but entity lososes hitbox (https://forums.alliedmods.net/showthread.php?t=5377)

karlos 08-30-2004 11:15

entity_set_model, but entity lososes hitbox
 
when i use entity_set_model the model of the entity gets changed but it looses its hitboxes
(im using it for NS to change armory and cc model for combat, armory has then no hitbox so that u can walk through it and noone can attack it but rines still can use it get get ammo)
anyone know how to fix it?

karlos 08-30-2004 13:39

just found a solution but i dont really like it: (get hitboxes and origin, set model, write its hitboxes and origin)
Code:
entity_get_vector(entid, EV_VEC_origin, orig) entity_get_vector(entid, EV_VEC_mins, MinBox) entity_get_vector(entid, EV_VEC_maxs, MaxBox) entity_set_model(entid,"model.mdl") entity_set_vector(entid, EV_VEC_mins, MinBox) entity_set_vector(entid, EV_VEC_maxs, MaxBox) entity_set_origin(entid, orig) entity_set_int(entid,EV_INT_solid,2)

Votorx 08-30-2004 14:02

Eh, those aren't hit boxes, they're boundries really, just another way to make the entity solid.

The hitboxes of the entity you changed the model of should still be there. If it isn't then you did something wrong when you set the model to the ent.

karlos 08-30-2004 15:21

hitboxes boundries, does not matter but without it u can walk through the model and u can attack it

Votorx 08-30-2004 17:15

Yeah it does make a difference because hitboxes are exactly what they're name implies, they are boxes on the model which will act upon the entity when shot or taken damage by another entity.

Anyways, what you did should be fine.

Downtown1 08-31-2004 12:55

Yeah, if people can walk through it, but can't shoot it, what's to prevent them walking in it and hiding ? :).

Johnny got his gun 09-06-2004 05:37

You need to set EV_INT_solid to some value. Look in engine_const.inc.
BBoxes need to be right as well.

karlos 09-06-2004 08:34

jonny look at 2nd post, there is "entity_set_int(entid,EV_INT_solid,2)", but that alone dont work, this has to be set too
Code:
entity_set_vector(entid, EV_VEC_mins, MinBox) entity_set_vector(entid, EV_VEC_maxs, MaxBox) entity_set_origin(entid, orig)

btw: u can also use:
Code:
pev(entid, pev_size, MinBox, MaxBox) //get site entity_set_model(entid,"mymodel.mdl") //set_pev(entid,pev_model,"mymodel.mdl") is not working, dont know why set_pev(entid, pev_size, MinBox, MaxBox) //set size
but its not working on all entitys, on some its give runtime errors (eg. NS b5 if ent is command chair)

Ingram 09-06-2004 14:35

u can use EngFunc_SetModel


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

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