Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Making Weapon Pack  (Read 3232 times)

Deshara

  • Admiral
  • *****
  • Posts: 1578
  • Suggestion Writer
    • View Profile
Making Weapon Pack
« on: May 06, 2016, 01:58:15 AM »

I don't know how to mod starsector or to do java but I do mod and I'm trying to deconstruct mods to cut them down to just their weapons so I can add guns from mods that should be part of the vanilla game without having aliens and *** in my hard-science game, but I'm having some trouble figuring out what outside of the asset files in data-weapons and the jars I found associated with them to make it compile correctly on game load.
I guess my question is which files are necessary to just have mod weapons? I'm missing something
Logged
Quote from: Deshara
I cant be blamed for what I said 5 minutes ago. I was a different person back then

joe130794

  • Commander
  • ***
  • Posts: 226
    • View Profile
Re: Making Weapon Pack
« Reply #1 on: May 06, 2016, 04:24:19 AM »

You'll need the image files for the weapons. The wpn files, Proj files and the weapon data from weapon_data.csv
Logged

FlashFrozen

  • Admiral
  • *****
  • Posts: 988
    • View Profile
Re: Making Weapon Pack
« Reply #2 on: May 06, 2016, 06:06:07 AM »

Don't forget you'll prob need to change sound effects as well. Some weapons have attached scripts which would also need work.

In general if you are planning on sharing this mod, ask the original modder before taking something from someone's else mod just in case. Some people would rather have their stuff untampered with. :)
« Last Edit: May 06, 2016, 10:10:30 AM by FlashFrozen »
Logged

Deathfly

  • Modders' Vanguard
  • Commander
  • ***
  • Posts: 245
  • Murdered by T. H. Morgan
    • View Profile
Re: Making Weapon Pack
« Reply #3 on: May 06, 2016, 07:19:04 AM »

And missiles with customized AI needs to load their AI in modPlugin. And projectiles with special every frame effects needs thire combatEveryFramePlugin.

Heh, in fact you will need at least B+ level of modding skill to do that if you what to mix up everything. And if you just want to implement some not so complicated weapons. I think you needs a C.
Logged
A not-so-noob functional geneticist
And a free bug hunter
Code and decode almost everythings with a genomics approach.
Served in Neutrino corporation as a long-term services and supports staff.

Deshara

  • Admiral
  • *****
  • Posts: 1578
  • Suggestion Writer
    • View Profile
Re: Making Weapon Pack
« Reply #4 on: May 06, 2016, 12:21:40 PM »

I got as far as the game crashing to a error about the mod plug in when it was most of the way done loading but that's where I got stuck, I wasn't sure if there was a single unified java plug in for the whole mod or if there are parts that get called on (which would explain why my computer stops for a few seconds the first time a rhon laser or clarent gets used) and if so where, I'll take another look and post an actual question later.
And, of course I wouldn't post anyone's stuff without permission, I'm the kind of jerkoff who cuts down other people's mods into something I like not the kind that steals credit where it is so very due
Logged
Quote from: Deshara
I cant be blamed for what I said 5 minutes ago. I was a different person back then

kazi

  • Admiral
  • *****
  • Posts: 714
    • View Profile
Re: Making Weapon Pack
« Reply #5 on: May 06, 2016, 05:00:41 PM »

So most basic weapons require the following (and in the proper locations)- also all of this is case-sensitive when on OSX/Linux:
- .wpn files
- the .proj files of the projectiles they shoot
- the sound effect entries from sounds.json
- the sfx files referenced by sounds.json entries
- the appropriate entries from weapon_data.csv.

More complex modded weapons may require the following .java files (and in the proper locations):
- OnHitEffectPlugins or BeamEffectPlugins... these are referenced in the .wpn/.proj files
- Custom weapon/missile AI scripts... these are typically loaded by a mod's ModPlugin scripts
- Custom combat layer plugins... these are typically loaded by settings.json.
- Utility functions from GraphicsLib / LazyLib (these mods just need to be present and active)
- Other scripts... the above are not the only way for mods to load custom bits of code for weapons and whatnot, many modders can be particularly crafty

.java code needs to be placed in the proper location (hint: in the package location mentioned in first line of each .java file), where it gets compiled by the Janino JIT compiler. Unfortunately some Java 7 language features cannot be compiled by Janino (namely, generics... they typically looks something like this: code<GenericType>), and must be compiled by an actual Java compiler into a .jar archive... see this tutorial here: http://fractalsoftworks.com/forum/index.php?topic=10057.0. Most mods readily provide their source code in a directory called src/. For the ones that don't (namely, DarkRevenant's stuff), you can rip the .java source code from their .jar files by simply unzipping it. Alternatively, IntelliJ IDEA can open and decompile pretty much any .jar file it comes across. I also know a guy who swears by the CFR decompiler - apparently it's absolutely fabulous.

Hope this helps! I'd suggest starting with some relatively simple weapons that do not require Java code before moving on to the tough stuff.
Logged

Deshara

  • Admiral
  • *****
  • Posts: 1578
  • Suggestion Writer
    • View Profile
Re: Making Weapon Pack
« Reply #6 on: May 06, 2016, 05:13:41 PM »

I just arbitrarily picked brdy but since I'm hitting a brick wall with the plug in code I'll try meters on.
Oh and thank you so much
Logged
Quote from: Deshara
I cant be blamed for what I said 5 minutes ago. I was a different person back then