Raised This Month: $ Target: $400
 0% 

Gunshot smoke( wall puff)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-20-2012 , 06:12   Gunshot smoke( wall puff)
Reply With Quote #1

How can i calculate angle, velocity, smoke when the bullet hit wall?
Can i use TE_MODEL to create the sprite?
__________________

Hatsune Miku~
tei1995 is offline
Hyper Nova
BANNED
Join Date: May 2012
Old 06-20-2012 , 13:36   Re: Gunshot smoke( wall puff)
Reply With Quote #2

explain more please.

I dont understand how the smoke must be, mayby give picture or something?
if you want to change angle, velocity and such stuff then you need to create new entity.
Hyper Nova is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-20-2012 , 13:41   Re: Gunshot smoke( wall puff)
Reply With Quote #3

Hook Ham_TraceAttack and get the hit point with get_tr2 TR_vecEndPos.
__________________

Last edited by <VeCo>; 06-20-2012 at 13:41.
<VeCo> is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-20-2012 , 22:15   Re: Gunshot smoke( wall puff)
Reply With Quote #4

I know that, but i want create smoke at the point when bullet hit something not human.
Of course,TE_SPRITE cant be used in this case.
__________________

Hatsune Miku~
tei1995 is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 06-20-2012 , 22:39   Re: Gunshot smoke( wall puff)
Reply With Quote #5

get_user_aimning(id,victim,bh) - if 0<victim<=get_max_players() then is not human
get_user_origin(id,origin,3) - aim pos
__________________
The functional way is the right way
GordonFreeman (RU) is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-21-2012 , 00:45   Re: Gunshot smoke( wall puff)
Reply With Quote #6

Men, i want to create smoke, not get aim origin.
__________________

Hatsune Miku~
tei1995 is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 06-21-2012 , 01:47   Re: Gunshot smoke( wall puff)
Reply With Quote #7

create smoke at aim origin (problem?)
__________________
The functional way is the right way
GordonFreeman (RU) is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-21-2012 , 05:32   Re: Gunshot smoke( wall puff)
Reply With Quote #8

No,create smoke at bullet hit point. Use TraceAttack to get the endposition.
My english suck!
__________________

Hatsune Miku~
tei1995 is offline
GordonFreeman (RU)
Veteran Member
Join Date: Jan 2010
Location: Uzbekistan
Old 06-21-2012 , 05:48   Re: Gunshot smoke( wall puff)
Reply With Quote #9

to calculate angle you can use my method in http://forums.alliedmods.net/showthread.php?t=183454
PHP Code:
public spawn_something(ent,type){
    new 
model
    
    
new Float:mins[3]
    new 
Float:maxs[3]
    new 
i
    
    
new trace
    
new Float:ground_trace[3]
    
    static 
charger_model
    
    enum 
{_Trace_Length_ 10.0};
    
    new const 
Float:g_vectors[][] ={
        {
0.00.0Float:_Trace_Length_},
        {
0.00.0, -Float:_Trace_Length_},
        {
0.0Float:_Trace_Length_0.0},
        {
0.0, -Float:_Trace_Length_0.0},
        {
Float:_Trace_Length_0.00.0},
        {-
Float:_Trace_Length_0.00.0}
    }
    
    if(
pev_valid(ent) && ((charger_model || (charger_model engfunc(EngFunc_AllocString"info_target"))) && pev_valid((model engfunc(EngFunc_CreateNamedEntitycharger_model))))){
            
pev(entpev_minsmins)
            
pev(entpev_maxsmaxs)
            
            
xs_vec_add(minsmaxsmaxs)
            
xs_vec_mul_scalar(maxs0.5maxs)
            
            
set_pev(entpev_effectsEF_NODRAW)
            
            
engfunc(EngFunc_SetModel,model,type?hp_model:ap_model)
            
dllfunc(DLLFunc_Spawn,model)
            
            
set_pev(modelpev_solidSOLID_NOT)
            
set_pev(modelpev_takedamageDAMAGE_NO)
            
set_pev(modelpev_movetypeMOVETYPE_NOCLIP)
            
set_pev(modelpev_classname,type?"hp_model":"ap_model")
            
            do{
                if(
<< << (sizeof g_vectors))
                    break
                
                
xs_vec_sub(maxsg_vectors[i], ground_trace)
                
engfunc(EngFunc_TraceLine,maxsground_traceIGNORE_MONSTERS IGNORE_MISSILEenttrace)
                
get_tr2(traceTR_vecPlaneNormalground_trace)
                
                
i++
            }
            while(!(
ground_trace[2] || ground_trace[1] || ground_trace[0]));--i
            
            set_ent_angles_expert
(model,ground_trace,maxs)
            
i=0
            
            
return model
    
}
    
    return 
0
}

set_ent_angles_expert(&iEnt, const Float:ground_angle[], const Float:origin[]){
    new 
Float:real_angles[3]

    
xs_vec_mul_scalar(ground_angle, -1.0real_angles)
    
vector_to_angle(real_anglesreal_angles)

    
real_angles[1] += 180.0
    
    set_pev
(iEntpev_originorigin)
    
set_pev(iEntpev_anglesreal_angles)

create enitity and start traceline to then by spining right now.
__________________
The functional way is the right way
GordonFreeman (RU) is offline
tei1995
Senior Member
Join Date: Feb 2011
Location: VietNam
Old 06-22-2012 , 09:13   Re: Gunshot smoke( wall puff)
Reply With Quote #10

I'm not sure about this calculate...
Do you have c++ code of wallpuff?
__________________

Hatsune Miku~
tei1995 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:39.


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