Ludeon Forums

RimWorld => Releases => Mods => Outdated => Topic started by: SlimeCrusher on November 14, 2015, 03:47:55 PM

Title: [A12] Weapon Effects[v1.2.0]
Post by: SlimeCrusher on November 14, 2015, 03:47:55 PM
Weapon Effects
Formerly known as "Rocket Effects"
v1.2.0
General:
<----------------------------------------------------------------------------------------------------------->
Tired of those old spring-launched rockets with no residue smoke? Need a way to make firearms look nicer when shot? Don't know where that mortar shell came from? Don't worry, Weapon Effects will fix all that.
Adds new awesome effects to most weapons, like smoke trails for rockets and mortars, case-dropping firearms and sparking charge projectiles.

Doesn't modify any stats
Full Preview:
<----------------------------------------------------------------------------------------------------------->
-Doomsday rocket launcher:
(http://imgur.com/NrVZZ04.gif)
-Triple rocket launcher:
(http://imgur.com/0XYcnQw.gif)
Spent cartridge drops:
(http://i.imgur.com/ZQElQZC.gif)
-[NEW!] Molotov Cocktails:
(http://i.imgur.com/HtUW4lH.gif)
-[NEW!] Charge projectiles:
(http://i.imgur.com/5N7lV6V.gif)
-[NEW!] Mortar trails:
(http://imgur.com/npdXPhG.png)
Download:
<----------------------------------------------------------------------------------------------------------->
DropBox Download (https://www.dropbox.com/s/hqc0zhwy4hc6fgw/Weapon%20Effects.rar?dl=0)
To install:
<----------------------------------------------------------------------------------------------------------->
.Simply download the mod, unzip it and drag it to your Rimworld/Mods folder. Make sure the folder setup is "Rimworld/Mods/Weapon Effects/Defs,Sounds,etc" and not "Mods/Weapon Effects/Weapon Effects".
.Then, boot up Rimworld and activate the mod via "Mods" menu.
.You don't need to make a new colony to use this mod.

THIS MOD IS INCOMPATIBLE WITH: Mods that modify pretty much any projectile code. They will load and work, but you'll get a console error (probably) and you won't see any cool effects
Changelog:
<----------------------------------------------------------------------------------------------------------->
v1.0: Initial Release.

v1.1: Added new casing drop effects on firearms
Changed name from "Rocket Effects" to "Weapon Effects".

v1.2.0: Added another digit to update number
Casings now despawn slower
Casings are now spawned at pawn's location (instead of 1 tick after firing)
Added new effects for charge projectiles
Added new effects for mortar shells
Added a new "secondary" sound effect to mortar shells wich plays JUST before impact
Added new "firetrail" effect for molotov cocktails
"Optimized" a bit of code (aka removed 1 class)

You just found the last message i'm making on the forums, hooray! You win a cookie. Bye fellow stranger. Don't worry, i'll come back when tynan does, i've gotten sick of modding. And no, i'm not going to update this again, too hard to code C# alone.
To do/Plans for future:
<----------------------------------------------------------------------------------------------------------->
-Add some kind of effect for charge weapons.  Done! (v1.2.0)
-Make this somewhat usable via XML for easier making of new effects. (for compatibility patches mainly)

-Make compatibility patches!
-Add a trail to mortars that spawns even when you aren't looking Done! (v1.2.0)

If you want to suggest a feature, do it, i need as many ideas as i can!  ;D
Licence and Credits:
<----------------------------------------------------------------------------------------------------------->
(https://i.creativecommons.org/l/by-sa/4.0/88x31.png) (http://creativecommons.org/licenses/by-sa/4.0/)
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

The mod "Turret Collection" by eatKenny (https://ludeon.com/forums/index.php?topic=6895.0) was used as an inspiration for this mod, i used a bit of code from it as a base for developing the rocket effects(modified a lot of it), wich then evolved into casing drops (wich i made my own code!). Thanks to him ;D
Rocket sounds are heavily edited Battlefield 1942 rocket sounds (i like old games).
Title: Re: [A12] Rocket Effects [v1.0]
Post by: LustrousWolf on November 14, 2015, 03:51:39 PM
Damn this sounds neat!!! Any chance of doing this to the missiles fired from the mortars?? :o
Title: Re: [A12] Rocket Effects [v1.0]
Post by: SlimeCrusher on November 15, 2015, 10:28:37 AM
Quote from: LustrousWolf on November 14, 2015, 03:51:39 PM
Damn this sounds neat!!! Any chance of doing this to the missiles fired from the mortars?? :o
Uh i think mortars fire shells and not missiles :P
Maybe i can think of another trail effect, or just a very faint smoke trail for mortar shells
Title: Re: [A12] Rocket Effects [v1.0]
Post by: Elixiar on November 18, 2015, 03:53:48 PM
Being able to see streaks in the sky from mortar exchanges would be super cool. Would be nice if the lingered a little too.
Title: Re: [A12] Rocket Effects [v1.0]
Post by: SlimeCrusher on November 18, 2015, 04:26:18 PM
The main problem is that there seems to be a limit on how many motes ("sprites" for non-modders) can be spawned in. So if i make a long-lasting mortar trail, it's just going to work for a single shell, since if 2 shells are fired within the time the trail is visible, the trail will sort of cut-off mid-way the target. I don't know if it's really going to be such a large problem or not, i'll see what i can come up with.

I just quickly implemented the rocket code to mortars and realised the problem is the same, but in a different way.
Motes are only generated if the camera is watching the generator object (the mortar shell), so if an enemy fires a mortar shell while you aren't looking, and then suddenly it appears, the smoke trail will end up looking cut in half.
No idea if this is solvable or not.
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: SlimeCrusher on November 20, 2015, 11:37:59 AM
Updated!
Added new casing drop effects for firearms (i'll add a preview soon i promise). I've changed the name of the mod in order to account for new effects (since they have nothing to do with rockets)
No new mortar effects yet, i wasted a bit of time researching on XML conversion but didn't work out and i ended up breaking the rockets. So i'll retry that later. Maybe next update i'll work on mortars.
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: Mechanoid Hivemind on November 21, 2015, 12:45:33 AM
Quote from: SlimeCrusher on November 20, 2015, 11:37:59 AM
Updated!
Added new casing drop effects for firearms (i'll add a preview soon i promise). I've changed the name of the mod in order to account for new effects (since they have nothing to do with rockets)
No new mortar effects yet, i wasted a bit of time researching on XML conversion but didn't work out and i ended up breaking the rockets. So i'll retry that later. Maybe next update i'll work on mortars.
If i may but in, i would like the whistle that the mortar gives as it falls, ya know that last sound before you see your as* fly infront of you
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: sanya02 on November 21, 2015, 01:51:37 AM
you can do a long the disappearance of bullet casings from bullets ?
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: LustrousWolf on November 21, 2015, 05:02:31 AM
Nice weapon effects! Does this work with combat realism mod? :O
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: SlimeCrusher on November 21, 2015, 11:03:29 AM
Quote from: Mechanoid Hivemind on November 21, 2015, 12:45:33 AM
If i may but in, i would like the whistle that the mortar gives as it falls, ya know that last sound before you see your as* fly infront of you
So you say that i should add a "bomb" whistle as mortar shells are about to fall? It should be easy enough, i'll see what i can do ;)
Quote from: sanya02 on November 21, 2015, 01:51:37 AM
you can do a long the disappearance of bullet casings from bullets ?
Yea i can make them last a bit longer, i didn't make them too long-lasting because i was scared i'd lag the game or something. I'll increase their lifespan next update.
Quote from: LustrousWolf on November 21, 2015, 05:02:31 AM
Nice weapon effects! Does this work with combat realism mod? :O
Not ATM, but i plan to make it compatible soon. Maybe next update. Look foward to it!
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: NoImageAvailable on November 21, 2015, 11:09:06 AM
I haven't looked at your modifications to the projectile code, but if you're worried about compatibility you might look into making the effects comps. Then you could use the comp injector from CCL and have no hard incompatibilities anymore. The only mods requiring patches would be those with new weapons and even those would be easier to make and maintain.
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: Alistaire on November 21, 2015, 11:20:26 AM
Shell casings shouldn't eject from either the stock of a machine gun or the barrel of an assault rifle~~-
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: SlimeCrusher on November 21, 2015, 02:10:26 PM
Quote from: Alistaire on November 21, 2015, 11:20:26 AM
Shell casings shouldn't eject from either the stock of a machine gun or the barrel of an assault rifle~~-
Errm i know?
Oh wait, i just realised that i could make the casing spawn when fired instead 1 tick after... I really don't know why i did it the way i made it. Oh well expect pretty much everything fixed next update (yes i know i'm promising a lot of stuff for v1.2), but they'll still eject from the stock.
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: Alistaire on November 21, 2015, 05:16:04 PM
You can make a single C# solution and add a new project under that solution, that way you can compile both projects under the same solution
and under the same DLL.

CCL can inject tags into existing ThingDefs so you don't have to overwrite bullets as you're currently doing. A method to spawn in shells in the
correct position could be to add the functionality on the weapons' ThingDef (instead of the projectile's ThingDef) and add a Comp (look at CR,
can also be injected with CCL) which includes some parameter for the distance from pawn center to the ejection port.

The problem with spawning in motes on the projectiles themselves is that CR for example modifies bullet speeds so the casings would drop
quite some ways away from the gun on assault rifles for example.
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: SlimeCrusher on November 21, 2015, 06:00:53 PM
Thanks Alistaire!
Currently (dev version) the bullets spawn using SpawnSetup instead of ticks like it used to. So CR shouldn't have a problem with high-speed bullets. I've already made the dll into a single solution, too. I'll look into CCL later, and i'll see if i can make it more tweakable using comps instead of full-on C#.
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: Austupaio on November 21, 2015, 07:05:52 PM
Quote from: Alistaire on November 21, 2015, 11:20:26 AM
Shell casings shouldn't eject from either the stock of a machine gun or the barrel of an assault rifle~~-

The problem with spawning in motes on the projectiles themselves is that CR for example modifies bullet speeds so the casings would drop
quite some ways away from the gun on assault rifles for example.
Uh... obviously in Rimworld's future, all of the guns have FS2000 ejection. Totally.

Since I'm posting though, just want to say that if all the kinks can be worked out, I do like the concept of this mod and would totally use it (and endeavor to make my own mod compatible once I've completed updating it.)
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: sanya02 on November 21, 2015, 10:04:19 PM
Thank you !
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: Lolencolony09 on November 21, 2015, 11:54:30 PM
Uhh.. it says the download is malisious, should I install it?  :-\
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: SlimeCrusher on November 22, 2015, 12:02:17 AM
Quote from: Lolencolony09 on November 21, 2015, 11:54:30 PM
Uhh.. it says the download is malisious, should I install it?  :-\
It's just your antivirus thinking it's malware for no reason when it actually isn't. It's common for that to happen, just download it, it'll be fine ;)
Probably will change to Dropbox later, as Mediafire seems to have quite a few ads on it's download page (wich i haven't realised since i use adblock).
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: devilyn on November 23, 2015, 01:23:49 PM
Can you make it compatible with Combat Realism?
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: SlimeCrusher on November 23, 2015, 01:38:22 PM
Quote from: devilyn on November 23, 2015, 01:23:49 PM
Can you make it compatible with Combat Realism?
I'm trying  ;) . I've been having some problems with converting the casing drops into comps (mainly because i lack skill to develop my own code from scratch), so that is slowing development down.
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: Dragoon on November 24, 2015, 08:05:34 PM
Nice immersion.
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: sanya02 on November 26, 2015, 10:53:24 AM
Hi! There's a thought! You can make to the liner did not disappear, and removed the settlers, there is a zone where the cleaning !! ??)) I would be very grateful for this work))
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: SlimeCrusher on November 26, 2015, 03:14:36 PM
Quote from: sanya02 on November 26, 2015, 10:53:24 AM
Hi! There's a thought! You can make to the liner did not disappear, and removed the settlers, there is a zone where the cleaning !! ??)) I would be very grateful for this work))
Umm... Sorry but i couldn't make out what you typed. Could you please rephrase that?
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: sanya02 on November 26, 2015, 06:54:51 PM


Hi! You can do that the sleeves did not disappear, and the settlers removed when cleaning the area!?!
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: SlimeCrusher on November 26, 2015, 08:44:52 PM
Quote from: sanya02 on November 26, 2015, 06:54:51 PMHi! You can do that the sleeves did not disappear, and the settlers removed when cleaning the area!?!
Oh i get it now damn you google translate!. With my current code this is impossible, and would also require a lot of tinkering to get working. Maybe overwriting cleaning code, wich is not ideal. It would also create tons of lag, especially with mechanoids with miniguns, since you'll have to render all the casings on the floor until a colonist cleans them up.
Title: Re: [A12] Weapon Effects[v1.1] Now with casings!
Post by: sanya02 on November 27, 2015, 05:24:17 AM
Ок)
Title: Re: [A12] Weapon Effects[v1.2.0]
Post by: SlimeCrusher on November 27, 2015, 10:52:07 PM
Updated!
Now with mortar trails (wich work correctly now), molotov fire and charge weapons sparks! (for full changelog reffer to OP's changelog)
No CR compatibility yet, sorry. But i plan on making this compatible with Rimfire and similar weapon mods shortly, so stay tuned!  ;D
Edit: Change of plans, cancelling everything, bye :)
Title: Re: [A12] Weapon Effects[v1.2.0]
Post by: skyarkhangel on November 28, 2015, 05:47:00 AM
Quote from: SlimeCrusher on November 27, 2015, 10:52:07 PM
Updated!
Now with mortar trails (wich work correctly now), molotov fire and charge weapons sparks! (for full changelog reffer to OP's changelog)
No CR compatibility yet, sorry. But i plan on making this compatible with Rimfire and similar weapon mods shortly, so stay tuned!  ;D

I made compatible with CR, based on CR 1.4
Sources uploaded in PM.

Also, with this angle and range, much better:


moteThrown.SetVelocityAngleSpeed((float)Rand.Range(160, 200), Rand.Range(0.020f, 0.0115f));
Title: Re: [A12] Weapon Effects[v1.2.0]
Post by: LustrousWolf on December 26, 2015, 12:46:01 PM
Any news on when this mod will be compatible with combat realism? :D
Title: Re: [A12] Weapon Effects[v1.2.0]
Post by: SlimeCrusher on April 10, 2016, 12:22:04 AM
Is anybody interested in taking over this?
Not sure if any of the code works on A13 though, i'm pretty sure i left the source in the download file so i shouldn't need to upload anything new.

I kinda realised i'm not a good enough coder to complete this, i was going to abandon this and let it rot while i'm away, but if anyone wants to take over this i'm basically fine with that, as i won't ever work on this again ;)

(Sorry for those who wanted a compatibilty patch for Combat Realism, as i said i'm not an experienced c# coder, so it was out of my reach)
Title: Re: [A12] Weapon Effects[v1.2.0]
Post by: SlimeCrusher on April 10, 2016, 03:26:13 PM
I see... Locking then.
Any moderator can move this and all my mods to outdated, i doubt anybody will miss them tbh.

Edit 7/27/2016: Reopened in case someone wants to point out something. Will leave open from now on...
No, this is not an update to the mod and i'm not back, just a random fly-by i guess...
Title: Re: [A12] Weapon Effects[v1.2.0]
Post by: Robloxsina66 on October 13, 2016, 09:22:40 PM
bring it back
Title: Re: [A12] Weapon Effects[v1.2.0]
Post by: Jdalt40 on October 14, 2016, 01:50:47 AM
Robloxxsina66 he won't bring this back, please leave this guy alone, he is already done with this mod and is not your butler which is supposed to serve you mods