PDA

View Full Version : p_m16's attachment is broken



KaLo
02-05-2016, 10:42 AM
(SOLVED)

After testing some custom weapons.

I found something broken.

When if I use a custom weapon which using MP5 Animation, the p_model's attachment position is at the muzzle point , the muzzle flash appear at the p_model's attachment without problem.

MP5:
17222
17226

However , when I use a custom weapon which using M16 Animation, p_model's attachment position is at the muzzle point too....

But the muzzle flash appear at (0 0 0) of player's position (player chest), not the attachment point.
Also if I remove the attachment , the muzzle flash position will goes the gun body , not gun muzzle.

M16:
17223

And there's more p_model attachments not working.

Sniper:
17224

M249:
17225

BlackShadowX
02-05-2016, 11:14 AM
I guess this issue with your AngelScript. You should been opened this in AngelScript threads. Hopefully admins will move it. But anyway.

For MP5 you need to edit player model animation on your script.




bResult = self.DefaultDeploy( self.GetV_Model( "models/csmodels/v_mp5.mdl" ), self.GetP_Model( "models/csmodels/p_mp5.mdl" ), MP5_DEPLOY, "mp5" );




don't directly copy this script. Find this exact string on your script and add "mp5" on Deploy string. This make player hold MP5 with Player's MP5 Animation.

Single uzi was using "onehand" command also pistols too. keep this in mind.

KaLo
02-05-2016, 11:33 AM
I guess this issue with your AngelScript.


Well , I try to not using angelscript , I use tremplar's AK74 skin and it was a p_m16 replacement , not a plugin gun. And I set the attachment too (at muzzle point).

And see.....

http://i1180.photobucket.com/albums/x409/KaLo2222/MISC/m16again.png

The problem still here , its not just AngelScript's problem.

If the image still not trusting you , you can download this p_m16 , replace the original p_m16 , and the result still be shows above.
https://drive.google.com/file/d/0BzsoYvmFpyfIdmtGZm5udjZCMzQ/view?usp=sharing

BlackShadowX
02-05-2016, 11:40 AM
You need to scale, gun's model to a bit smaller fit to the hands.

KaLo
02-05-2016, 11:48 AM
You need to scale, gun's model to a bit smaller fit to the hands.

uhh......Are you changing the subject?? This is just a sample , I am not caring about the hands touch the switch or not.

Scaling model can't make M16's muzzle flash move , it stuck at "0 0 0" of player's body if attachment is set.

BlackShadowX
02-05-2016, 12:49 PM
I thought you're saying it wasn't fit to hands... That's why i told you to scale. I forgot how to fix that muzzle flash sadly.

Sniper
02-05-2016, 03:29 PM
I added custom muzzle sprites a few versions back. The m16a2 uses them.

Make sure the player model you're using has the right bones or attachments available.
In the current release, the m16a2 is setup like so:


attachment 1
bone 4
spritename sprites/SAWFlash.spr
scale 20
colorR 255
colorB 255
colorG 255
rendermode 5
transparency 255

(\svencoop\events\muzzle_SPAW.txt)

In this case, attachment has precedence over the bone setting. The code should be looking for attachment point 1 on the model.

KaLo
02-05-2016, 06:33 PM
I added custom muzzle sprites a few versions back. The m16a2 uses them.

Make sure the player model you're using has the right bones or attachments available.
In the current release, the m16a2 is setup like so:

In this case, attachment has precedence over the bone setting. The code should be looking for attachment point 1 on the model.

Yeah , I didn't know the events/muzzle_SPAW.txt use attachment 1, now it works with this setting:

$attachment 0 "flash" 0 0 0
$attachment 1 "flash" 0 0 0

thank Sniper for tech support.

http://i1180.photobucket.com/albums/x409/KaLo2222/MISC/fss.png