How to make bullet penetration (dont even hope guests its not tutorial i need help)
9 replies, posted
So... As the title says, how to make variable bullet penetration in gmod? What is the simplest way? Is it possible with default bullet code?
Basically what you have to do is make 2 bullets.
One that starts from your weapon and flies just as regular bullet and the second one that spawns on the other side of obscale the first bullet has hit.
[img]http://puu.sh/lw5ge/3516b74853.png[/img]
Powodzenia :3
[QUOTE=Netheous;49171551]Basically what you have to do is make 2 bullets.
One that starts from your weapon and flies just as regular bullet and the second one that spawns on the other side of obscale the first bullet has hit.
[img]http://puu.sh/lw5ge/3516b74853.png[/img]
Powodzenia :3[/QUOTE]
i am lua noob :\
This is how CS:S handles it (per material and bullet type): [url]https://github.com/Kefta/Garrys-Mod-Source/blob/master/cstrike/lua/autorun/sh_player.lua#L246-L319[/url]
[QUOTE=code_gs;49171584]This is how CS:S handles it (per material and bullet type): [url]https://github.com/Kefta/Garrys-Mod-Source/blob/master/cstrike/lua/autorun/sh_player.lua#L246-L319[/url][/QUOTE]
will it work with default bullet? just simply copy-paste?
[QUOTE=xgdg;49171603]will it work with default bullet? just simply copy-paste?[/QUOTE]
You can copy and paste that function and fire bullets through it, but you need to configure the ammo type penetration that you are using.
[QUOTE=code_gs;49171632]You can copy and paste that function and fire bullets through it, but you need to configure the ammo type penetration that you are using.[/QUOTE]
how to do it? :|
[QUOTE=xgdg;49171643]how to do it? :|[/QUOTE]
Find out what ammo type you are using (SWEP.Primary.Ammo) and add it to the BulletTypeParameters table.
[QUOTE=code_gs;49171664]Find out what ammo type you are using (SWEP.Primary.Ammo) and add it to the BulletTypeParameters table.[/QUOTE]
i copied-pasted the penetration code i configured ammo and i get this thing:
[ERROR] addons/mac-10/lua/weapons/weapon_mac10_ns/shared.lua:92: no loop to break
1. unknown - addons/mac-10/lua/weapons/weapon_mac10_ns/shared.lua:0
and thats what is on 91-96 line:
[CODE] if ( ( iPenetration == 0 and not hitGrate ) or iPenetration < 0 ) then
break // no, stop
end
// try to penetrate object, maximum penetration is 128 inch
local penetrationEnd = TraceToExit( tr.HitPos, vecDir, 24, 128 )[/CODE]
[QUOTE=xgdg;49171689]i copied-pasted the penetration code i configured ammo and i get this thing:
[ERROR] addons/mac-10/lua/weapons/weapon_mac10_ns/shared.lua:92: no loop to break
1. unknown - addons/mac-10/lua/weapons/weapon_mac10_ns/shared.lua:0
and thats what is on 91-96 line:
[CODE] if ( ( iPenetration == 0 and not hitGrate ) or iPenetration < 0 ) then
break // no, stop
end
// try to penetrate object, maximum penetration is 128 inch
local penetrationEnd = TraceToExit( tr.HitPos, vecDir, 24, 128 )[/CODE][/QUOTE]
I meant that you would have to copy and paste the entire FireBullet code and fire through it on your weapon. Not just that section.
Sorry, you need to Log In to post a reply to this thread.