Raised This Month: $ Target: $400
 0% 

Bullet decals


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
marcellus
Senior Member
Join Date: Mar 2004
Old 01-25-2009 , 17:53   Re: Bullet decals
Reply With Quote #12

Quote:
Originally Posted by MPNumB View Post
Yes. Thanks.

However I didn't found nothing in hlsdk_const.inc about sound time. Also I'm wondering where can I find those bullet models?

// edit:

So left: question in this post what is higher.

How to get bullet texture index.

How to get where decals were writen (traceline - yes, but what about shotgun)?
in the example,
g_shell = precache_model("models/shotgunshell.mdl")

for soundtype i didnt find as well, and i set it to 1 .....

for a shotgun you have to make a loop :
Code:
// my shotgun shots 7 bullets at a time
	for (bulletcount = 0; bulletcount < 7; bulletcount++)
	{
		pev(id, pev_v_angle, dest);

		dest[0] = dest[0] + random_float(-1.0, 1.0) + random_float(-1.0, 1.0)
		dest[1] = dest[1] + random_float(-1.0, 1.0) + random_float(-1.0, 1.0)
		
		engfunc(EngFunc_MakeVectors, dest);
		global_get(glb_v_forward, vecdir);

		xs_vec_mul_scalar(vecdir, 2048.0, vecdir);
		xs_vec_add(start, vecdir, dest);

		
		engfunc(EngFunc_TraceLine, start, dest, DONT_IGNORE_MONSTERS, id, ptr)
		
		Target = get_tr2(ptr, TR_pHit)

		// endpos
		get_tr2(ptr, TR_vecEndPos, endpos)
                
                //hitgroup
                hitgroup = get_tr2(ptr, TR_iHitgroup)


		engfunc(EngFunc_MessageBegin, MSG_BROADCAST, SVC_TEMPENTITY, endpos, 0)
		write_byte(TE_GUNSHOTDECAL)
		engfunc(EngFunc_WriteCoord, endpos[0])
		engfunc(EngFunc_WriteCoord, endpos[1])
		engfunc(EngFunc_WriteCoord, endpos[2])
		write_short(id)
		write_byte(decal)
		message_end()

// deal damages etc...
          }
its a part of a shotgun (with a maglite) plugin for biohazard plugin. it work with weaponmod and there are functions to get the right decal for the weapon (static decal ; decal = wpn_gi_get_gunshot_decal())

maybe have a look at weaponmod to know how it can get it.
Attached Files
File Type: sma Get Plugin or Get Source (wpn_m3torch.sma - 755 views - 15.7 KB)
__________________
www.war-cs.com
french cz community

Last edited by marcellus; 01-25-2009 at 18:06.
marcellus is offline
 


Thread Tools
Display Modes

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 20:56.


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