Raised This Month: $51 Target: $400
 12% 

Bullet decals


Post New Thread Reply   
 
Thread Tools Display Modes
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-25-2009 , 17:33   Re: Bullet decals
Reply With Quote #11

Yep, you can see in HLSDK it uses a temp model ( like TE_MODEL but client-side ) to eject shell.
Arkshine is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 01-25-2009 , 17:43   Re: Bullet decals
Reply With Quote #12

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 #13

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 - 749 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 #14

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
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-25-2009 , 18:03   Re: Bullet decals
Reply With Quote #15

models/rshell.mdl
models/pshell.mdl
models/rshell_big.mdl
models/shotgunshell.mdl
Arkshine is offline
marcellus
Senior Member
Join Date: Mar 2004
Old 01-25-2009 , 18:07   Re: Bullet decals
Reply With Quote #16

i updated my last post with the full example.
__________________
www.war-cs.com
french cz community

Last edited by marcellus; 01-25-2009 at 18:11.
marcellus is offline
MPNumB
Veteran Member
Join Date: Feb 2007
Location: Lithuania
Old 01-25-2009 , 18:41   Re: Bullet decals
Reply With Quote #17

But I'm interested - how on earth another client knows where original decals of shotgun are? And why when blocking shooter data send in addtofullpack decals arent apeart.

Also questions about what weapons use what shell decals and how to get texture index for bullet decal remain (not talking about spark direction).

Also when I shoot I noticed that only messages what are forwarded are curweapon and damage. Nothing more...
__________________
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 , 18:53   Re: Bullet decals
Reply With Quote #18

Quote:
Originally Posted by MPNumB View Post
But I'm interested - how on earth another client knows where original decals of shotgun are? And why when blocking shooter data send in addtofullpack decals arent apeart.

Also questions about what weapons use what shell decals and how to get texture index for bullet decal remain (not talking about spark direction).

Also when I shoot I noticed that only messages what are forwarded are curweapon and damage. Nothing more...
the message is send to all clients so they can see bullets holes. (im not sure :-)

take a look at this list : http://forums.alliedmods.net/showthread.php?t=20448
__________________
www.war-cs.com
french cz community

Last edited by marcellus; 01-25-2009 at 18:57.
marcellus 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 17:32.


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