AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   About SOLID_TRIGGER (https://forums.alliedmods.net/showthread.php?t=110386)

xbatista 11-29-2009 05:59

About SOLID_TRIGGER
 
When I'm creating entity with SOLID_TRIGGER and trying to kill it by aim, it won't be killed, why it happens? Maybe there are way to ignore that the entity is SOLID_TRIGGER?

P.S. I won't to use SOLID_BBOX, becouse entity will stuck in player origin and I won't to set for example XYZ + ~30 ,becouse it will piss coordinates.

PHP Code:

public Create_Items_Propane_Throw(id)
{
    
emit_sound(idCHAN_ITEMg_medkit_pickup1.0ATTN_NORM0PITCH_NORM);
    
    new 
FloatfOrigin[3], Float:fAngle[3],FloatfVelocity[3];

    
entity_get_vectoridEV_VEC_originfOrigin);
    
entity_get_vectoridEV_VEC_view_ofsfAngle);

    
fOrigin[0] += fAngle[0];
    
fOrigin[1] += fAngle[1];
    
fOrigin[2] += fAngle[2];
    
    
fm_velocity_by_aim(id0.6fVelocityfAngle);
    
fAngle[0] *= -1.0;
    
    new 
item_ent create_entity("info_target");

    
entity_set_stringitem_entEV_SZ_classname"PropItem");
    
    
entity_set_modelitem_entg_w_medic_propane);
    
    
entity_set_size(item_entFloat:{-3.5, -5.5, -8.5}, Float:{3.55.58.5})
    
    
entity_set_floatitem_entEV_FL_takedamage1.0);
    
entity_set_floatitem_entEV_FL_health20.0);
    
    
entity_set_vectoritem_entEV_VEC_originfOrigin);

    
fOrigin[0] += fVelocity[0];
    
fOrigin[1] += fVelocity[1];
    
fOrigin[2] += fVelocity[2];
    
    
entity_set_intitem_entEV_INT_solidSOLID_TRIGGER)
    
entity_set_intitem_entEV_INT_movetypeMOVETYPE_TOSS)
    
    
entity_set_floatitem_entEV_FL_gravity0.55);
    
    
fVelocity[0] *= 1000.0;
    
fVelocity[1] *= 1000.0;
    
fVelocity[2] *= 1000.0;

    
entity_set_vectoritem_entEV_VEC_velocityfVelocity);
    
entity_set_vectoritem_entEV_VEC_anglesfAngle);



Arkshine 11-29-2009 06:07

Re: About SOLID_TRIGGER
 
Try to use SOLID_BBOX and set the owner EV_INT_owner ; it should not block. If it still blocks ( it should not ahppen ) try to spawn the entity some units in front of player before.

xbatista 11-29-2009 06:23

Re: About SOLID_TRIGGER
 
Interesting , I set it to SOLID_BBOX with owner, but the solid in game is not the SOLID_BBOX, its TRIGGER :/
PHP Code:

public Create_Items_Propane_Throw(id)
{
    new 
FloatfOrigin[3], Float:fAngle[3],FloatfVelocity[3];

    
entity_get_vectoridEV_VEC_originfOrigin);
    
entity_get_vectoridEV_VEC_view_ofsfAngle);

    
fOrigin[0] += fAngle[0];
    
fOrigin[1] += fAngle[1];
    
fOrigin[2] += fAngle[2];
    
    
fm_velocity_by_aim(id0.6fVelocityfAngle);
    
fAngle[0] *= -1.0;
    
    new 
item_ent create_entity("info_target");

    
entity_set_stringitem_entEV_SZ_classname"PropItem");
    
    
entity_set_modelitem_entg_w_medic_propane);
    
    
entity_set_floatitem_entEV_FL_takedamage1.0);
    
entity_set_floatitem_entEV_FL_health20.0);
    
    
entity_set_vectoritem_entEV_VEC_originfOrigin);

    
fOrigin[0] += fVelocity[0];
    
fOrigin[1] += fVelocity[1];
    
fOrigin[2] += fVelocity[2];
    
    
entity_set_intitem_entEV_INT_solidSOLID_BBOX)
    
entity_set_intitem_entEV_INT_movetypeMOVETYPE_TOSS)
    
    
entity_set_floatitem_entEV_FL_gravity0.55);
    
    
fVelocity[0] *= 1000.0;
    
fVelocity[1] *= 1000.0;
    
fVelocity[2] *= 1000.0;

    
entity_set_vectoritem_entEV_VEC_velocityfVelocity);
    
entity_set_vectoritem_entEV_VEC_anglesfAngle);
    
    
entity_set_edictitem_entEV_ENT_ownerid);
    
entity_set_size(item_entFloat:{-3.5, -5.5, -8.5}, Float:{3.55.58.5})
    
    
set_task(0.5"Set_Back_Model"id);



Dr.G 11-29-2009 06:31

Re: About SOLID_TRIGGER
 
Ive tryed something like that as well. Never worked for me. The only way i got it to work, was by getting the classname that i aim at, check the button, and if positive, call a function that handles the kill of the entity.

xbatista 11-29-2009 06:35

Re: About SOLID_TRIGGER
 
Quote:

Originally Posted by Dr.G (Post 1001833)
Ive tryed something like that as well. Never worked for me. The only way i got it to work, was by getting the classname that i aim at, check the button, and if positive, call a function that handles the kill of the entity.

Tryied ://
With SOLID_TRIGGER don't work, also SOLID_BBOX + owner = SOLID_TRIGGER lol
how to solve?

Arkshine 11-29-2009 06:40

Re: About SOLID_TRIGGER
 
Quote:

SOLID_BBOX + owner = SOLID_TRIGGER
Check again what you are doing. Just because you provide an owner it won't change the movetype by magic.

xbatista 11-29-2009 06:51

Re: About SOLID_TRIGGER
 
Quote:

Originally Posted by Arkshine (Post 1001842)
Check again what you are doing. Just because you provide an owner it won't change the movetype by magic.

Whats wrong? :/ I don't understand

Arkshine 11-29-2009 07:20

Re: About SOLID_TRIGGER
 
Me too. I don't understand why you say "SOLID_BBOX + owner = SOLID_TRIGGER". By manipulating such dummy entity with pev_owner I had never been problems.

xbatista 11-29-2009 07:33

Re: About SOLID_TRIGGER
 
when is owner set and is SOLID_BBOX I can't remove entity by aim

Arkshine 11-29-2009 07:35

Re: About SOLID_TRIGGER
 
Not sure to understand... But if really it doesn't work like you want, you can hook the touch and disabled it for you to avoid the blocking ; or spawning the entity in front of you. Because right now you use your own origin to set the start origin.


All times are GMT -4. The time now is 13:39.

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