Would anyone mind assisting me with making a script for the ammo on a gun I'm creating to use, I need it to explode on hit after a few miliseconds and do a small concusive-like blast.
Do note I've never truely experimented with LUA and will probably need lots of help. EDIT: This is of course if it even is needed to use Lua for HE ammo. I am unaware of ways to do it outside of it though.
Fri Aug 14, 2015 6:07 pm
SnowMonster20
Joined: Wed Jul 16, 2008 12:49 am Posts: 226
Re: High Explosive ammo from scratch
You can do this through ini. Just make your round an AEMitter and have it gib the explosion. A low impulse limit will make it more likely to explode on impact.
EDIT: if you want the round to stun enemies then there is a few mods you can look into for stun rounds. I also have an old stun round script that was made for me a while back. Not sure it still works though
Fri Aug 14, 2015 9:34 pm
Galacticruler
Joined: Sat Oct 15, 2011 4:19 pm Posts: 322
Re: High Explosive ammo from scratch
SnowMonster20 wrote:
You can do this through ini. Just make your round an AEMitter and have it gib the explosion. A low impulse limit will make it more likely to explode on impact.
EDIT: if you want the round to stun enemies then there is a few mods you can look into for stun rounds. I also have an old stun round script that was made for me a while back. Not sure it still works though
By consussive blast I mean more on the lines of the MaximDudeCorp Compressed Air bomb.
Sat Aug 15, 2015 3:59 am
p3lb0x
Forum Moderator
Joined: Fri Feb 02, 2007 3:53 pm Posts: 1896 Location: in my little gay bunker
Re: High Explosive ammo from scratch
I am not entirely sure what that is. Do you want it to blow nearby physical objects away from it?
Sat Aug 15, 2015 2:18 pm
SnowMonster20
Joined: Wed Jul 16, 2008 12:49 am Posts: 226
Re: High Explosive ammo from scratch
p3lb0x wrote:
I am not entirely sure what that is. Do you want it to blow nearby physical objects away from it?
If that was the case you should still be able to do it in ini. just add air burst (or whatever CC calls them now) to your gibbed explosion
EDIT: Or if you are looking to make something similar to another mod then look at the source code to learn from it. Or hell, do what most the rest of us do and just copy it. I know i've used others code before. Just try to get permission and give credit.
Code:
AddAmmo = AEmitter PresetName = HE Slug Mass = 5 GlobalAccScalar = 0.50 AirResistance = 0 RestThreshold = -500 HitsMOs = 1 GetsHitByMOs = 0 SpriteFile = ContentFile FilePath = YOUR SRITE FILEPATH FOR THE BULLET FrameCount = 1 OrientToVel = 1 SpriteOffset = Vector X = x //Make sure these are right or your explosive will phase through MOs Y = y EntryWound = AEmitter CopyOf = Dent Metal ExitWound = AEmitter CopyOf = Dent Metal AtomGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Military Stuff PresetName = No Bounce Please Bounce = -1 Resolution = 2 Depth = 0 DeepGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Military Stuff PresetName = No Bounce Please Bounce = -1 Resolution = 4 Depth = 1 DeepCheck = 0 AddEmission = Emission EmittedParticle = MOSParticle CopyOf = Tiny Smoke Ball 1 PresetName = Gun Smoke 1 //These are for the muzzle flash LifeTime = 200 GlobalAccScalar = 0.0 ParticlesPerMinute = 1 BurstSize = 5 Spread = 1.5 MaxVelocity = 1 MinVelocity = 0 PushesEmitter = 0 AddEmission = Emission EmittedParticle = MOSParticle CopyOf = Tiny Smoke Ball 1 PresetName = Gun Smoke 2 LifeTime = 150 GlobalAccScalar = 0.0 ParticlesPerMinute = 1 BurstSize = 5 Spread = 0.7 MaxVelocity = 2 MinVelocity = 1 PushesEmitter = 0 AddEmission = Emission EmittedParticle = MOSParticle CopyOf = Side Thruster Blast Ball 1 PresetName = Gun Smoke 3 LifeTime = 200 GlobalAccScalar = 0.0 AirResistance = 0.3 ParticlesPerMinute = 1 BurstSize = 5 Spread = 0.2 MaxVelocity = 15 MinVelocity = 10 PushesEmitter = 0 EmissionEnabled = 1 EmissionsIgnoreThis = 0 BurstTriggered = 1
Here is an HE ini code I use. If you want it to knock people around then add more of the Air Blasts. This references Base.rte so it should work on its own. There may be a variable or two you have to change though. For a bigger explosion, up the particle counts and lifetimes. Vise verse for a smaller one. Also note that the Air Blasts have a chance to hurt and outright kill actors. They also dislodge weapons from hands.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum