Hey guys, I'm modding in a few guns, and I'm sure I'm going to run into some things I cannot figure out. First, how can I make a animated casing, that also has a "smoke" effect on it? And second, is it possible to make a muzzle flash, that has multiple animated frames, and a glow attached to it?
Wed Apr 04, 2012 8:10 pm
Arcalane
Joined: Sun Jan 28, 2007 10:32 pm Posts: 1609 Location: UK
Re: Some Modding Questions.
David Rodrigov wrote:
First, how can I make a animated casing, that also has a "smoke" effect on it?
Animated casings are easy - just set the FrameCount value appropriately for the number of frames in the sprite. Most of the weapons I do this with do it to have the shells appear to spin/flip/tumble in-flight. Here's how I did it for the bolters in the 40K comp;
Code:
AddAmmo = MOSParticle PresetName = Bolter Shell Scrap Mass = 0.01 HitsMOs = 0 GetsHitByMOs = 0 SpriteFile = ContentFile FilePath = W40K.rte/Weapons/Bolt Weapons/Shells/BolterCasing.bmp FrameCount = 8 SpriteOffset = Vector X = -2 Y = -2 AngularVel = 6 Atom = Atom Material = Material CopyOf = Scrap Metal Friction = 0.02 TrailLength = 0 Framerate = 10
It's a little bit of a cheap hack (and possibly a little overcomplicated, I'm not sure) but it works well enough at the moment. You do have to be careful with the amount of smoke generated though, as all that emission stacks up and can cause a lot of lag with automatic weapons.
Not sure about animated muzzle-flashes I'm afraid, but since they have the magenta background I think it should work like any other animated thing; just have enough frames and set the FrameCount accordingly. Glows can be attached using the usual ScreenEffect chunks, eg;
Code:
AddEffect = Attachable InstanceName = Bolter Muzzle Flare ScreenEffect = ContentFile FilePath = Base.rte/Effects/Glows/FireGlow1.bmp //YellowSmall Mass = 0.00001 HitsMOs = 0 GetsHitByMOs = 0 SpriteFile = ContentFile FilePath = W40K.rte/Weapons/Effects/BoltMuzzle.bmp FrameCount = 1 SpriteOffset = Vector X = -2 Y = -3 AtomGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Air Resolution = 2 Depth = 100 DeepGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Air Resolution = 3 Depth = 100 DeepCheck = 0 JointStrength = 10000 JointStiffness = 1 DrawAfterParent = 0
Wed Apr 04, 2012 8:37 pm
dragonxp
Joined: Wed Sep 09, 2009 3:16 am Posts: 3032 Location: Somewhere in the universe
Re: Some Modding Questions.
The first can also be a combination of animated casing with a AEmitter as the casing. Thus you can also emit particle smoke. Or even damaging particles!
I'd provide code but I'm not currently in a position where I can show an example without typing an entire block. However if you are interested just reply and I'll get back to you when I am back within my own household.
Wed Apr 04, 2012 8:51 pm
David Rodrigov
Joined: Mon Jan 25, 2010 11:35 pm Posts: 675
Re: Some Modding Questions.
I'd like to know more about that sometime, please.
Wed Apr 18, 2012 3:30 am
dragonxp
Joined: Wed Sep 09, 2009 3:16 am Posts: 3032 Location: Somewhere in the universe
Re: Some Modding Questions.
Here you go
Attachments:
File comment: Here download this, code tag is kind of bad at indenting. EmitterShell.txt [1.52 KiB]
Downloaded 219 times
Wed Apr 18, 2012 4:26 am
Kettenkrad
Joined: Mon Oct 25, 2010 5:51 am Posts: 1198 Location: Sydney
Re: Some Modding Questions.
The animated glow is a tad more difficult. A muzzle flash is an attachable, and only exists for the one frame that the gun is activated. As it only exists for one frame, understandably it can only display one frame of it's sprite. Adding multiple frames will just randomise the sprite displayed. If you want to go to the trouble of having a three or five frame flash, you could have a null flash that emits a pinned particle with multiple frames and a longer lifetime.
Adding a glow, as far as i can remember, is as simple as adding the ScreenEffect = ContentFile (or similar) chunk. Example
Joined: Sun Jan 28, 2007 10:32 pm Posts: 1609 Location: UK
Re: Some Modding Questions.
Kettenkrad wrote:
Adding multiple frames will just randomise the sprite displayed.
Interesting to know!
I should note the reason I used a MOSParticle and AEmitter is because I also wanted shells to rattle as they hit the ground, but not disappear; by giving them a GibImpulseLimit of 1, it basically ensures they make the rattling if they strike a hard surface, and still spawn a spent casing effect instead of just vanishing. A little hacky, but it works nicely.
Either way, between the snippets we've put up here, you should have all you need for smoking casings. Enjoy.
If you want to go to the trouble of having a three or five frame flash, you could have a null flash that emits a pinned particle with multiple frames and a longer lifetime.
You could also have a null flash, and use the emitter-emits-bullet trick with the flash emitted by that too, I think. That'd also give you the benefit of being able to reduce recoil, possibly significantly.
Wed Apr 18, 2012 2:28 pm
David Rodrigov
Joined: Mon Jan 25, 2010 11:35 pm Posts: 675
Re: Some Modding Questions.
Thanks a ton for all the helpful info, guys. Also, I was thinking of attempting to mod some of these guns in my free time, with different "weapon types", like this:
Close Combat Weapons Close Combat Weapons would each have their own unique effective playing styles, for example, you would use a Magnum to kill targets from close to medium range if your primary is destroyed, clear a room quickly with a DAO, or bring out a G18 to kill a target if you don't have time to reload when your magazine runs dry in a firefight. - Beretta M9 - Customized M1911 - Glock 18c - .44 Magnum - Saiga 12 - DAO 12
Assault Weapons Assault Weapons would be fairly similar to each other, with only minor differences such as price, fire rate, as well as slight damage and reload time changes, and basic feel. A player would be compelled to buy certain ones depending on their own situation. Getting a small squad of well equipped soldiers to attack a fortified enemy base? Give them high damage and effective Colt Commando's, for a higher price. Defending an area with meat shields, but don't have much funds remaining? Give them an AK74M, they'll be tough to break and reliable, as well as cheaper, even if they may not have high killing potential. - M16A4 - AK74M - FN2000 - Colt Commando - G3
Long Range Weapons These Weapons would be for long range and stealthy target killing, with high powered scopes and the ability to kill in one well aimed shot. - M40A5 - M39 EMR
Support/"Smash and Cover" Weapons Support Weapons would be for covering large amounts of ground, and holding down a strategic combat area. The MG's would be able to kill in 3-4 shots, have high fire rates, and large magazines. They would also be very inaccurate, to balance it. The Rocket Launchers would be for destroying cover, or taking out "hard targets". - M27 - M249 - M60 - SMAW
General Purpose Weapons These Weapons would be for general purpose use, they wont be incredibly effective in every situation, but simply be high quality guns to equip units with to defend themselves. - M4 - AKS74U - UMP45 - P90
I would hopefully be making this with features that would make it different and innovative compared to other mods, with things like: Laser Pointer Sights that would have a bonus, like increased hipfire accuracy. "Recoil" lua scripts that would make sustained fire less accurate than burst fire. Deployable Bipods that would give more accuracy to sustained and burst fire when stationary. Suppressors that would actually work, not alerting the enemy when you shoot them, unless they can see you. Do you think any of those idea's would be able to implement?
Also, I wasn't really organizing the weapons by their actual real life "type", (like carbine or sniper rifle or something), but instead organizing them into their playstyles. They also wouldn't really be realistic to their real life counterparts, I already realized I suck at modding things like that.
Wed Apr 25, 2012 8:50 pm
Arcalane
Joined: Sun Jan 28, 2007 10:32 pm Posts: 1609 Location: UK
Re: Some Modding Questions.
Think? I can tell you for sure that laser pointers, bipods and recoil have all been done by various modders, so you don't need to worry about that too much. I'm not sure about the silencers thing though. I guess it might be possible, I think DarkStorm had special silenced weapons.
akblabla made a pinnable (recoiling?) grenade launcher in his Trappers "Ronin Update" collection. Also check out his MP7, which can apparently be toggled in/out of two-handed mode for better recoil control.
Laser pointers depend on how you want the execution. Drawing a solid line directly from the gun to the target is probably going to be pretty laggy. You could also trace dots in the air every <x> pixels*, or draw a dot or some kind of other effect where the beam contacts something solid.
*I've seen a grenade launcher somewhere which did this for grenade trajectory prediction, it looked pretty cool.
Wed Apr 25, 2012 11:06 pm
Azukki
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
Re: Some Modding Questions.
Along with Akblabla's pinnable weapons, if you want a passive bipod that gives bonuses whenever your weapon just happens to have terrain just beneath the bipod mount, I can help with that; I've scripted one up for the Shadow Echelon Flatline precision rifle. I can also help with lasers and recoil, which are already in [SE]. Feel free to download it and use the scripts for reference. Copying them outright is fine too, with crediting accordingly.
Suppressors, yeah, that'd be troublesome, but possible in some roundabout way. The only method that comes to my mind for that is if you used a totally different button to fire.
Thu Apr 26, 2012 1:42 am
David Rodrigov
Joined: Mon Jan 25, 2010 11:35 pm Posts: 675
Re: Some Modding Questions.
Sounds great guys, I'll try to mod some guys to apply the bipods and stuff onto.
EDIT: Alright, I did some sprites, but I think they need some improvement. Here they, and from top to bottom they are a Beretta M9, Glock 18, 44 Magnum, and an M1911. They're cropped and difficult to see images, I recommend opening them GIMP or some other program.
The Magnum is slightly edited from a sprite that Kettenkrad sent me, so it's basically his. I think they're okay, but I needed some help with the 1911, I couldn't get the silvery bits to look good.
Joined: Sat Nov 03, 2007 9:44 pm Posts: 1916 Location: Flint Hills
Re: Some Modding Questions.
On the 1911, the silvery bits aren't very good, but I don't particularly know how to do better. Also move the front sight forward two pixels. Maybe for the sake of ease of spriting and easy visual distinction from the other pistols, you should go with a more classic 1911 with wooden grips and a blued finish? The Glock's trigger is a pixel farther forward than it seems to need to be, and its front sight pixel should be moved to the front. The .44's cylinder should be taller than the barrel, I'd suggest moving the bottom of the cylinder down a pixel.
Other than those little nitpickings, the sprites are pretty good.
Thu Apr 26, 2012 6:44 pm
David Rodrigov
Joined: Mon Jan 25, 2010 11:35 pm Posts: 675
Re: Some Modding Questions.
I redid some guns, and added a Saiga-12, DAO-12, and M16A4. I'm also starting the coding, and looking for sounds. The sprites, top to bottom, are Beretta M9, Magnum, G18, M1911, DAO, Saiga, and M16A4. My reference for the M16A4, it's the bottom one. I recommend opening them with a program, the backround of this site makes them look a little worse than they actually do.
And as usual, the flipping offsets are too complicated for me to do, keeping me from completing the gun. I'm going to take a few more tries on it, then maybe release the code for a gun, so you guys could be able to help me.
Mon Apr 30, 2012 6:44 pm
Arcalane
Joined: Sun Jan 28, 2007 10:32 pm Posts: 1609 Location: UK
Re: Some Modding Questions.
Offsets are always a pain in the ass. What I do is use the guide and the GIMP. I make a copy of the weapon, and mark the desired offset points in bright colours (e.g. green, cyan, red) that aren't used anywhere else on the sprite. Then I use the measuring tool to get the X/Y distances I need.
It's not too bad once you get the hang of it.
Mon Apr 30, 2012 9:48 pm
David Rodrigov
Joined: Mon Jan 25, 2010 11:35 pm Posts: 675
Re: Some Modding Questions.
Here I have a AK74, FN2000, and M4 Commando. I really don't think they look good at all, but it was very difficult to get the shape remotely correct for the FN2000.
Also, is there any way to increase the kick of a HDfirearm when it is fired? And, how can I make a gun shoot the regular bullets, with a smoke effect? Lastly, how can I code a gun that fires more than one "bullet", like for shotgun pellets?
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