Raised This Month: $ Target: $400
 0% 

Bullet decals


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 01-25-2009 , 15:49   Re: Bullet decals
Reply With Quote #1

1. But how can I set in what direction sparks will go?
2. Thanks. But:
PHP Code:
write_byte(texture index of precached decal texture name
What is this?
3. Shootgun?
4. Thanks.
5. Thanks.
6. Image.
7. Image.
Attached Thumbnails
Click image for larger version

Name:	x2.jpg
Views:	427
Size:	9.6 KB
ID:	36284  
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-25-2009 , 16:33   Re: Bullet decals
Reply With Quote #2

Quote:
Originally Posted by MPNumB View Post
6. Image.
7. Image.
I think that you need to hook a touch event of that entity.
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 01-25-2009 , 16:40   Re: Bullet decals
Reply With Quote #3

Quote:
Originally Posted by Dores View Post
I think that you need to hook a touch event of that entity.
It is not anentity - it's an message, so it's impossible to hook touch event of it.
Attached Thumbnails
Click image for larger version

Name:	x2.jpg
Views:	313
Size:	7.1 KB
ID:	36286  
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.
MPNumB is offline
Send a message via Skype™ to MPNumB
marcellus
Senior Member
Join Date: Mar 2004
Old 01-25-2009 , 17:28   Re: Bullet decals
Reply With Quote #4

Quote:
Originally Posted by MPNumB View Post
It is not anentity - it's an message, so it's impossible to hook touch event of it.
are u talking about this ?

Code:
// eject a shell from the weapon every shot 
public eject_brass(Float: vecOrigin[3],Float:   vecVelocity[3],Float: rotation, soundtype )
{
	engfunc(EngFunc_MessageBegin, MSG_BROADCAST, SVC_TEMPENTITY, vecOrigin, 0);
	write_byte( TE_MODEL);
	engfunc(EngFunc_WriteCoord, vecOrigin[0]);
	engfunc(EngFunc_WriteCoord, vecOrigin[1]);
	engfunc(EngFunc_WriteCoord, vecOrigin[2]);
	engfunc(EngFunc_WriteCoord, vecVelocity[0]);
	engfunc(EngFunc_WriteCoord, vecVelocity[1]);
	engfunc(EngFunc_WriteCoord, vecVelocity[2]);
	engfunc(EngFunc_WriteAngle, rotation);
	write_short( g_shell);
	write_byte( soundtype);
	write_byte ( 25 );
	message_end();
}
__________________
www.war-cs.com
french cz community
marcellus is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 01-25-2009 , 17:43   Re: Bullet decals
Reply With Quote #5

Quote:
Originally Posted by marcellus View Post
are u talking about this ?

Code:
// eject a shell from the weapon every shot 
public eject_brass(Float: vecOrigin[3],Float:   vecVelocity[3],Float: rotation, soundtype )
{
    engfunc(EngFunc_MessageBegin, MSG_BROADCAST, SVC_TEMPENTITY, vecOrigin, 0);
    write_byte( TE_MODEL);
    engfunc(EngFunc_WriteCoord, vecOrigin[0]);
    engfunc(EngFunc_WriteCoord, vecOrigin[1]);
    engfunc(EngFunc_WriteCoord, vecOrigin[2]);
    engfunc(EngFunc_WriteCoord, vecVelocity[0]);
    engfunc(EngFunc_WriteCoord, vecVelocity[1]);
    engfunc(EngFunc_WriteCoord, vecVelocity[2]);
    engfunc(EngFunc_WriteAngle, rotation);
    write_short( g_shell);
    write_byte( soundtype);
    write_byte ( 25 );
    message_end();
}
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)?
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 01-25-2009 at 17:46.
MPNumB is offline
Send a message via Skype™ to MPNumB
marcellus
Senior Member
Join Date: Mar 2004
Old 01-25-2009 , 17:53   Re: Bullet decals
Reply With Quote #6

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
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 01-25-2009 , 17:58   Re: Bullet decals
Reply With Quote #7

Quote:
Originally Posted by marcellus View Post
in the example,
g_shell = precache_model("models/shotgunshell.mdl")
I had in mind list of cs shell models. Didn't found it in:
http://wiki.amxmodx.org/CS_Weapons_Information

// edit:

Ok, found models:
pshell.mdl // pistols only
rshell.mdl // gun list, plz?
rshell_big.mdl // gun list, plz?

// edit2:

isn't there anyway how to get where decal should be writed w/o that trace-line?
__________________
Skill and no annoying bugs with fixed balance issues is my goal!
My approved plugins what don't show up in Approved List:
* Bomb/Death/CSS Radar
* HotVision
___
Need help? Please check this documentation first.

Last edited by MPNumB; 01-25-2009 at 18:09.
MPNumB is offline
Send a message via Skype™ to MPNumB
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 20:55.


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