Raised This Month: $32 Target: $400
 8% 

[SOLVED] Entity size doesn't work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 12-15-2010 , 18:51   [SOLVED] Entity size doesn't work
Reply With Quote #1

I don't know why this doesn't works:

PHP Code:
    new iEnt create_entity("info_target")
    
    
entity_set_string(iEntEV_SZ_classname"func_oil_barrel")
    
    
entity_set_origin(iEntvecEnd)
    
entity_set_model(iEntBARREL_MODEL)
    
    
entity_set_int(iEntEV_INT_solidSOLID_BBOX)
    
entity_set_int(iEntEV_INT_movetypeMOVETYPE_TOSS)
    
    
entity_set_float(iEntEV_FL_takedamageDAMAGE_YES)
    
entity_set_float(iEntEV_FL_health100.0)
    
    
entity_set_edict(iEntEV_ENT_euser3iId)
    
    
entity_set_size(iEntBARREL_MINSBARREL_MAXS)
    
    
set_task(0.1"task_SendBeam"iEnt
"task_SendBeam" function:

PHP Code:
public task_SendBeam(iEnt// Code for testing purpose.
{
    if(!
is_valid_ent(iEnt))
        return;
    
    new 
Float:vecOrigin[3], Float:vecMins[3], Float:vecMaxs[3];
    
    
entity_get_vector(iEntEV_VEC_minsvecMins);
    
entity_get_vector(iEntEV_VEC_maxsvecMaxs);
    
entity_get_vector(iEntEV_VEC_originvecOrigin);
    
    
vecMins[0] += vecOrigin[0];
    
vecMins[1] += vecOrigin[1];
    
vecMins[2] += vecOrigin[2];
    
vecMaxs[0] += vecOrigin[0];
    
vecMaxs[1] += vecOrigin[1];
    
vecMaxs[2] += vecOrigin[2];
    
    
DrawLine(vecMaxs[0], vecMaxs[1], vecMaxs[2], vecMins[0], vecMaxs[1], vecMaxs[2])
    
DrawLine(vecMaxs[0], vecMaxs[1], vecMaxs[2], vecMaxs[0], vecMins[1], vecMaxs[2])
    
DrawLine(vecMaxs[0], vecMaxs[1], vecMaxs[2], vecMaxs[0], vecMaxs[1], vecMins[2])
    
DrawLine(vecMins[0], vecMins[1], vecMins[2], vecMaxs[0], vecMins[1], vecMins[2])
    
DrawLine(vecMins[0], vecMins[1], vecMins[2], vecMins[0], vecMaxs[1], vecMins[2])
    
DrawLine(vecMins[0], vecMins[1], vecMins[2], vecMins[0], vecMins[1], vecMaxs[2])
    
DrawLine(vecMins[0], vecMaxs[1], vecMaxs[2], vecMins[0], vecMaxs[1], vecMins[2])
    
DrawLine(vecMins[0], vecMaxs[1], vecMins[2], vecMaxs[0], vecMaxs[1], vecMins[2])
    
DrawLine(vecMaxs[0], vecMaxs[1], vecMins[2], vecMaxs[0], vecMins[1], vecMins[2])
    
DrawLine(vecMaxs[0], vecMins[1], vecMins[2], vecMaxs[0], vecMins[1], vecMaxs[2])
    
DrawLine(vecMaxs[0], vecMins[1], vecMaxs[2], vecMins[0], vecMins[1], vecMaxs[2])
    
DrawLine(vecMins[0], vecMins[1], vecMaxs[2], vecMins[0], vecMaxs[1], vecMaxs[2])
    
    
set_task(0.1"task_SendBeam"iEnt)

The size works fine, but there's something that I don't know why doesn't works correctly.

See this picture: LINK

The size is perfect for the model as you can see.

You can see in the code that I activated the damage for the entity. Supposedly it must show some sparks on the endposition of the bullet.

PHP Code:
public fw_Barrel_TraceAttack(iVictimiAttackerFloat:flDamageFloat:vecDirection[3], iTriDamageType)
{
    new 
szClassname[33]
    
entity_get_string(iVictimEV_SZ_classnameszClassnamecharsmax(szClassname))
    
    if(!
equal(szClassname"func_oil_barrel"))
        return 
HAM_IGNORED
        
    
new Float:vecEndPos[3]
    
get_tr2(iTrTR_vecEndPosvecEndPos)
    
    
engfunc(EngFunc_MessageBeginMSG_PVSSVC_TEMPENTITYvecEndPos0)
    
write_byte(TE_SPARKS// TE iId
    
engfunc(EngFunc_WriteCoordvecEndPos[0]) // x
    
engfunc(EngFunc_WriteCoordvecEndPos[1]) // y
    
engfunc(EngFunc_WriteCoordvecEndPos[2]) // z
    
message_end()
    
    return 
HAM_HANDLED

Now see this picture: LINK

It doesn't.

See how my (custom) flashlight ignores the entity: LINK - LINK (It obviously uses traceline's method)

Only when I aim at the center of the entity (and when I fire too) it doesn't ignore it: LINK

Anyone knows why appears this problem?
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross

Last edited by meTaLiCroSS; 12-17-2010 at 11:10.
meTaLiCroSS is offline
IneedHelp
Veteran Member
Join Date: Mar 2007
Location: Argentina
Old 12-16-2010 , 14:20   Re: Entity size doesn't work
Reply With Quote #2

It would be interesting to solve the flashlight thingy, I have almost the same situation with one of my custom entities...
__________________
IneedHelp is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 12-16-2010 , 20:56   Re: Entity size doesn't work
Reply With Quote #3

The custom flashlight. How are you doing it? Because it's a model entity. It will have issues receiving light. Unlike brush based entity's.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
lazarev
Veteran Member
Join Date: Sep 2008
Old 12-17-2010 , 05:00   Re: Entity size doesn't work
Reply With Quote #4

Quote:
Originally Posted by IneedHelp View Post
It would be interesting to solve the flashlight thingy, I have almost the same situation with one of my custom entities...
try to make it SOLID_BSP,I'm not sure
lazarev is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 12-17-2010 , 09:43   Re: Entity size doesn't work
Reply With Quote #5

Quote:
Originally Posted by Drak View Post
The custom flashlight. How are you doing it? Because it's a model entity. It will have issues receiving light. Unlike brush based entity's.
Traceline method, same thing happens with bullets.

Quote:
Originally Posted by lazarev View Post
try to make it SOLID_BSP,I'm not sure
I perfectly sure that the engine will crash with an error if I put SOLID_BSP on his solid ev.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 12-17-2010 , 11:10   Re: Entity size doesn't work
Reply With Quote #6

OMG I solved it. The problem was model's hitboxes, they were a little box instead of his real size.
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS 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 22:45.


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