Raised This Month: $ Target: $400
 0% 

Making a model solid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-07-2006 , 20:14   Making a model solid
Reply With Quote #1

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
wonsae is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 03-07-2006 , 20:19  
Reply With Quote #2

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.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
wonsae
Senior Member
Join Date: Jan 2006
Location: Behind you >:D
Old 03-07-2006 , 20:21  
Reply With Quote #3

thank you hopefully it works
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)
wonsae is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 03-07-2006 , 20:22  
Reply With Quote #4

it does work. Just a matter of using it correctly.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
T(+)rget
Senior Member
Join Date: Mar 2004
Old 03-08-2006 , 07:55  
Reply With Quote #5

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)
T(+)rget is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 03-08-2006 , 17:18  
Reply With Quote #6

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.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
T(+)rget
Senior Member
Join Date: Mar 2004
Old 03-08-2006 , 17:52  
Reply With Quote #7

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)
T(+)rget is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 03-08-2006 , 17:58  
Reply With Quote #8

maybe in AMX, however the way I wrote it is how it works in AMXX.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
T(+)rget
Senior Member
Join Date: Mar 2004
Old 03-08-2006 , 18:02  
Reply With Quote #9

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!
T(+)rget is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-08-2006 , 18:07  
Reply With Quote #10

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.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Reply



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 20:22.


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