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

Solid_bbox (fakemeta) is not solid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lossius
Junior Member
Join Date: Nov 2007
Old 10-17-2008 , 03:07   Solid_bbox (fakemeta) is not solid
Reply With Quote #1

Hello,

I'm french, sorry for my english

There is my code to create a block:

new i = 0;

for(i = 0; i < crates; i++) {
ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_wall"));

if(!pev_valid(ent)) continue;

dllfunc(DLLFunc_Spawn, ent);

new Float:mins[3] = { -32.0, -32.0, -32.0 }, Float:maxs[3] = { 32.0, 32.0, 32.0 };

engfunc(EngFunc_SetSize, ent, mins, maxs);
engfunc(EngFunc_SetOrigin, ent, crate_origin[a]);
engfunc(EngFunc_SetModel, ent, MDL_CRATE);

set_pev(ent, pev_classname, "ccrate");
set_pev(ent, pev_health, 9999.0);
set_pev(ent, pev_movetype, MOVETYPE_FLY);
set_pev(ent, pev_solid, SOLID_BBOX);
set_pev(ent, pev_angles, { 0.0, 180.0, 0.0 });
set_pev(ent, pev_mins, mins);
set_pev(ent, pev_maxs, maxs);
set_pev(ent, pev_owner, 33);
set_pev(ent, pev_iuser1, 0);
}

The box is created but not solid (semi solid), i jump over there and i "cross ?" them...

PS: why "EngFunc_SetSize" don't set mins and maxs? when:
pev(ent, pev_mins, cmin);
server_print("%f %f %f", cmin[0], cmin[1], cmin[2]); // return "0.0 0.0 0.0" ?

Once again, sorry for my english
lossius is offline
Old 10-17-2008, 03:50
vato loco [GE-S]
This message has been deleted by vato loco [GE-S].
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-17-2008 , 06:10   Re: Solid_bbox (fakemeta) is not solid
Reply With Quote #2

PHP Code:
server_print("%d %d %d"cmin[0], cmin[1], cmin[2]); // i dont see it in code, if not works try %s 
Quote:
PS: why "EngFunc_SetSize" don't set mins and maxs?
PHP Code:
#define fm_entity_set_size(%1,%2,%3)    engfunc(EngFunc_SetSize, %1, %2, %3) // from fakemeta_util, try it :) 
__________________
xPaw is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-17-2008 , 12:04   Re: Solid_bbox (fakemeta) is not solid
Reply With Quote #3

Also, whenever you change the entity's model with EngFunc_SetModel, you must use EngFunc_SetSize AFTER so that the size isn't messed up.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
lossius
Junior Member
Join Date: Nov 2007
Old 10-17-2008 , 12:16   Re: Solid_bbox (fakemeta) is not solid
Reply With Quote #4

Thanks for this note exolent, 1 problem fixed, no idea for the solid?
lossius is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-17-2008 , 12:27   Re: Solid_bbox (fakemeta) is not solid
Reply With Quote #5

There is a certain order for setting entity values when you create it.
This order should work:

Code:
new i = 0; for(i = 0; i < crates; i++) {         ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "func_wall"));                 if(!pev_valid(ent)) continue;                 dllfunc(DLLFunc_Spawn, ent);                 new Float:mins[3] = { -32.0, -32.0, -32.0 }, Float:maxs[3] = { 32.0, 32.0, 32.0 };         /*engfunc(EngFunc_SetSize, ent, mins, maxs);         engfunc(EngFunc_SetOrigin, ent, crate_origin[a]);         engfunc(EngFunc_SetModel, ent, MDL_CRATE);         engfunc(EngFunc_SetSize, ent, mins, maxs);                 set_pev(ent, pev_classname, "ccrate");         set_pev(ent, pev_health, 9999.0);         set_pev(ent, pev_movetype, MOVETYPE_FLY);         set_pev(ent, pev_solid, SOLID_BBOX);         set_pev(ent, pev_angles, { 0.0, 180.0, 0.0 });         set_pev(ent, pev_mins, mins);         set_pev(ent, pev_maxs, maxs);         set_pev(ent, pev_owner, 33);         set_pev(ent, pev_iuser1, 0);*/                 set_pev(ent, pev_classname, "ccrate");         set_pev(ent, pev_solid, SOLID_BBOX);         engfunc(EngFunc_SetModel, ent, MDL_CRATE);         set_pev(ent, pev_angles, Float:{0.0, 180.0, 0.0});         engfunc(EngFunc_SetSize, ent, mins, maxs);         engfunc(EngFunc_SetOrigin, ent, crate_origin[a]);                 // set any other entity values you need here }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 10-17-2008 , 12:29   Re: Solid_bbox (fakemeta) is not solid
Reply With Quote #6

Code:
set_pev(ent, pev_mins, mins); set_pev(ent, pev_maxs, maxs);
Why do you have them? They should be removed you are already using engfunc(EngFunc_SetSize, ent, mins, maxs);

Also its best to setup your entity then call the following two last:
Code:
engfunc(EngFunc_SetSize, ent, mins, maxs); engfunc(EngFunc_SetOrigin, ent, crate_origin[a]);
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
lossius
Junior Member
Join Date: Nov 2007
Old 10-18-2008 , 08:11   Re: Solid_bbox (fakemeta) is not solid
Reply With Quote #7

Thanks !
Its all good :p
lossius is offline
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 06:08.


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