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: Are there notes on editing existing mods?  (Read 1085 times)

#Negi

  • Ensign
  • *
  • Posts: 38
    • View Profile
Are there notes on editing existing mods?
« on: April 19, 2022, 09:10:36 PM »

Maybe I looked in all the wrong spaces, but I'm looking for any notes on editing existing mods.  If I can't find any, I'll look at making mods, but for now I'd like to know how to pair down mods/know the basics of what is necessary for a mod so I can fish the important bits out of existing mods.  Can someone point me in the right direction? 

Example: my poor computer cannot handle the 60+ mods I want to use and load times are abysmal, but rather than disable half of them, I'd like to take the ships/weapons I like from a few of them and consolidate them into a new 'consolidated ships mod' for my own use.  That, or cut out bits of mod contents without breaking the mod.  Every mod seems to have at least one Buffalo variant, I've got a dozen of them and use maybe one, they're the first thing that can go. 

I've looked at the files inside a mod and noticed a few patterns, but messing around with it blindly on my own hasn't yet yielded any results, so I turn to the experts on the forums.  Thank you.
« Last Edit: April 19, 2022, 09:19:14 PM by #Negi »
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7174
  • Harpoon Affectionado
    • View Profile
Re: Are there notes on editing existing mods?
« Reply #1 on: April 20, 2022, 10:08:01 AM »

Hmmm, I don't think there really are guides on this particular task. You'll want to read the wiki introduction to modding: https://starsector.fandom.com/wiki/Intro_to_Modding

Much of the data in there won't be useful to you because its about creating ships/weapons/etc, but it includes where things need to go to make a functioning mod, so most of the data you need will be there.

Another aspect is that many mods use scripted effects in combat or have campaign scripts that require compilation: if you want to include those, you are going to need to set up an IDE and compile those scripts into a JAR file.
Logged

#Negi

  • Ensign
  • *
  • Posts: 38
    • View Profile
Re: Are there notes on editing existing mods?
« Reply #2 on: April 21, 2022, 02:19:07 PM »

Thank you, the link helped some, but it doesn't cover scripts and most mods have a few of those.  I'm stuck at a point where I've taken a weapon and modified/moved all the parts its .wpn refers to, and all the files those refer to and so forth until I thought I'd hit the end.  I've got weapon_data, .wpn file, .proj file, graphics, sounds, an onhiteffect script, description, some config setting files, etc, everything that is referenced in a long chain starting at the entry in the weapon_data file, all moved and modified to use their new paths.  But it won't run, it says 'Fatal:JSONObject["source"] not found', but I cannot find any such object within the original mod, or referenced within the mod.  I'll have to dive deeper, learn some more java and see what I can dig up.  Thanks again.

Question: why do sounds have a sound settings file under data/config, to tell it the path to the sound files?  graphics just use the file path, why does sound need a sound settings middleman?  (looking at various .wpn files)
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1340
  • On break.
    • View Profile
Re: Are there notes on editing existing mods?
« Reply #3 on: April 21, 2022, 02:49:15 PM »

Depending on the mod, you might end up having to de/reconstruct it and maintain it in parallel; too many interrelated files and game systems. It's up to you if you want to do that.

(Sounds are set up the way they are to allow you to call multiple sounds randomly for the same ID - this can be useful for all sorts of purposes, from minor variations on the same sound for better flow during rapid fire to multiple distinct sounds for the same event).
Logged

#Negi

  • Ensign
  • *
  • Posts: 38
    • View Profile
Re: Are there notes on editing existing mods?
« Reply #4 on: April 23, 2022, 01:51:05 AM »

too many interrelated files

Ya I'm learning that, but I'm gonna try it anyway, and either way I've gained a new skill.  Thanks for the response, and another question if you don't mind; is there documentation on how to read starsector.log?  I found this link, but it talks about how to post the log for someone else to read, not how I can read it myself.  https://starsector.fandom.com/wiki/Starsector.log

I'm getting an error that says a particular script for an on-hit effect isn't loading, but it only offers "Check starsector.log for more info."  I've checked it (there are three different such logs apparently), but I don't know what I'm looking at, nothing seems wrong, and I can't find anything in it that looks like an error record.  It's 3k lines of "... loading rule: ...". 
Logged