AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Gunshot smoke ( wall puff ) (https://forums.alliedmods.net/showthread.php?t=197151)

Bos93 09-29-2012 13:41

Gunshot smoke ( wall puff )
 
who can help me with recreating wall puff effect like in CS? I tried with SVC TEMPENTITY, but it looks bad

Arkshine 09-29-2012 14:16

Re: Gunshot smoke ( wall puff )
 
Find the right sprite.

Bos93 09-29-2012 14:25

Re: Gunshot smoke ( wall puff )
 
I am using default sprites, but the problem is that sprite stucks in the wall, and its not became any larger

PHP Code:

public TraceAttack_PostpEntityiAttackerFloat:flDamageFloat:fDir[3], ptriDamageType)
{
    
    new 
iDecal GUNSHOT_DECALSrandom_numsizeofGUNSHOT_DECALS ) - ) ];
    

    new 
Float:vecEnd[3], Float:vecPlane[3]
    
    
get_tr2(ptrTR_vecEndPosvecEnd);
    
get_tr2(ptrTR_vecPlaneNormalvecPlane);

    
message_begin(MSG_BROADCASTSVC_TEMPENTITY)
    
write_byte(TE_GUNSHOTDECAL)
    
write_coord_f(vecEnd[0])
    
write_coord_f(vecEnd[1])
    
write_coord_f(vecEnd[2])
    
write_short(pEntity)
    
write_byte(iDecal)
    
message_end()


    
pEntity engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_sprite"))
    
    
entity_set_origin(pEntityvecEnd)

    
entity_set_model(pEntityWEAPON_TRACE_EFFECT)

    
entity_set_int(pEntityEV_INT_solidSOLID_NOT)
    
entity_set_int(pEntityEV_INT_movetypeMOVETYPE_NOCLIP)
    
    
entity_set_float(pEntityEV_FL_animtimeget_gametime())
    
entity_set_float(pEntityEV_FL_framerate40.0)    
    
set_pev(pEntitypev_scale0.5


    
set_pev(pEntitypev_spawnflagsSF_SPRITE_ONCE)


    
// Set velocity
    
new Float:vecVelocity[3], Float:vecRight[3], Float:vecUp[3];

    
engfunc(EngFunc_VecToAnglesvecPlanevecPlane );

    
vector_to_angle(vecPlanevecPlane);

    
angle_vector(vecPlane,ANGLEVECTOR_RIGHT,vecRight)
    
angle_vector(vecPlane,ANGLEVECTOR_UP,vecUp)

    
vecVelocity[0] *= 32.0;
    
vecVelocity[1] *= 32.0;
    
vecVelocity[2] *= 32.0;
    
    new 
Float:flRandomVec random_float(0.064.0) * random_float(-1.01.0);
    
    
vecRight[0] *= flRandomVec;
    
vecRight[1] *= flRandomVec;
    
vecRight[2] *= flRandomVec;
    
    
flRandomVec random_float(0.064.0) * random_float(-1.01.0);
    
    
vecUp[0] *= flRandomVec;
    
vecUp[1] *= flRandomVec;
    
vecUp[2] *= flRandomVec;
    
    
vecVelocity[0] += vecRight[0] + vecUp[0];
    
vecVelocity[1] += vecRight[1] + vecUp[1];
    
vecVelocity[2] += vecRight[2] + vecUp[2];

    
set_pev(pEntitypev_velocityvecVelocity);

    
DispatchSpawn(pEntity);

    
entity_set_int(pEntityEV_INT_movetypeMOVETYPE_NOCLIP)

    
set_pev(pEntitypev_rendermode,  kRenderTransAdd)

    
set_pev(pEntitypev_renderamt,   27.0)

    
entity_set_float(pEntityEV_FL_animtimeget_gametime())
    
    
entity_set_float(pEntityEV_FL_nextthinkget_gametime() + 0.025);

    return 
HAM_IGNORED;



KORD_12.7 11-12-2012 08:25

Re: Gunshot smoke ( wall puff )
 
And the solution was http://pastebin.com/rcquQuiN


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

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