AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Making a model solid (https://forums.alliedmods.net/showthread.php?t=25102)

wonsae 03-07-2006 20:14

Making a model solid
 
hi im trying to make carmodels solid but when I used
Code:
   entity_set_int(car,EV_INT_solid,SOLID_TRIGGER)
it didnt work so i was wondering how i would make it solid

GHW_Chronic 03-07-2006 20:19

Code:
entity_set_int(car,EV_INT_solid,SOLID_BBOX)
bbox. used for objects to cause colisions with players. also need to use entity_set_size. Example usage:
Code:
new Float:min[3] new Float:max[3] min[0]=-16.0 min[1]=-16.0 min[2]=-32.0 max[0]=16.0 max[1]=16.0 max[2]=32.0 entity_set_size(car,min,max)
that makes it -16 units large to the right (of origin) (-16 right = 16 left), 16 units large to the right,16 units large to the front, -16 units large to the front, 32 units tall, and -32 units tall. (this is the exact size of an HL player model).
Mess with sizes to figure out what u need to set your car at.

wonsae 03-07-2006 20:21

thank you hopefully it works :D
so for example it would be like this?
Code:
   entity_set_int(car,EV_INT_solid,SOLID_BBOX)    new Float:min[3]    new Float:max[3]    min[0]=-16.0    min[1]=-16.0    min[2]=-32.0    max[0]=16.0    max[1]=16.0    max[2]=32.0    entity_set_size(car,min,max)

GHW_Chronic 03-07-2006 20:22

it does work. Just a matter of using it correctly.

T(+)rget 03-08-2006 07:55

You don't seem to understand how entity_set_size works:

Its runs this: pfnSetAbsBox

That is the controller of the main bounding box, so running jumping or w/e this is constantly updating.

How it works:
It gets the origin of any given entity then adds on the mins & maxes values.

So using this native you need origin + min and origin + max, else it won't work as you expected. Its how I was able to make my tripmine script on AMX forums, so that you could stand on them instead of bouncing around like a tit (original) :lol:

GHW_Chronic 03-08-2006 17:18

Code:
new Float:origin[3] //fill in origin here new ent = create_entity("info_target") entity_set_string(ent,EV_SZ_classname,"ghw_fake_player") entity_set_model(ent,"models/player/gign/gign.mdl") entity_set_origin(ent,origin) entity_set_int(ent, EV_INT_solid,SOLID_BBOX) entity_set_int(ent,EV_INT_movetype,MOVETYPE_FLY) entity_set_edict(ent,EV_ENT_owner,33) //idle sequence (looks like he's lagged out / swimming in air) entity_set_float(ent,EV_FL_framerate,1.0) entity_set_int(ent,EV_INT_sequence,0) //Set size of invisible box that is interactive w/ players (depending on solid type) new Float:min[3] new Float:max[3] min[0]=-16.0 min[1]=-16.0 min[2]=-32.0 max[0]=16.0 max[1]=16.0 max[2]=32.0 entity_set_size(ent,min,max)

Don't know EXACTLY what you are talking about Target with the whole origin + min, but incase you think I'm saying something I'm not, that is an example of creating a player model and that would set its size to the exact size of a player. Used that exact script in several of my plugins and works.

T(+)rget 03-08-2006 17:52

how it should be written:
Code:
min[0] = origin[0] - 16.0 min[1] = origin[1] - 16.0 min[2] = origin[2] - 32.0 max[0] = origin[0] + 16.0 max[1] = origin[1] + 16.0 max[2] = origin[2] + 32.0 entity_set_size(ent, min, max)

GHW_Chronic 03-08-2006 17:58

maybe in AMX, however the way I wrote it is how it works in AMXX.

T(+)rget 03-08-2006 18:02

Install PM Tools to trace it, the native is exactly the same. I think it also depends on the SOLID_STATE, but as I said its how the actual HL engine (pfnSetAbsBox) does this!

Twilight Suzuka 03-08-2006 18:07

target, thats wrong.

The engine automatically does the origin addition for you, so that it DOES update each and every frame. If you simply did the origin statically like that, it would only work for one frame. The engine handles the origin addition for you.


All times are GMT -4. The time now is 20:22.

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