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: Anubis-class Cruiser (12/20/24)

Pages: 1 ... 105 106 [107] 108 109 ... 753

Author Topic: Misc modding questions that are too minor to warrant their own thread  (Read 2048135 times)

Debido

  • Admiral
  • *****
  • Posts: 1183
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1590 on: May 12, 2014, 06:10:21 PM »

Yes, the hot code replacement is a tool I often use when debugging/testing. If F8 picks that up as well, all good.

Anyway I look forward to being able to do live data updates, it will help speed up the testing workflow a lot.

There is this other weird bug I found relating to this VLS missile launcher system , if I leave a missile with a FIGHTER collision class for too long, the game tries to cast it as a ShipAPI and does...weird things. Answer to that problem is not to leave your missile as FIGHTER collision class for too longer.

I think you'd like the look of the VLS missile launch animation and decent onto target, it's pretty cool.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1779
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1591 on: May 12, 2014, 07:09:26 PM »

Fixed for the next release
Sweet. Many thanks  :)

pyg

  • Lieutenant
  • **
  • Posts: 59
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1592 on: May 13, 2014, 05:03:55 PM »

How are backgrounds (specifically the battle ones) used in a mod, as in how do I change what background is used?  I can find backgrounds in data/config/settings.json but I can't figure out how to specifically change the ones used in a battle.  I'm playing a mod with many absolutely lovely/brilliant backgrounds, so brilliant in fact I can't see a lot of what's happening in battle and would love to simply have battles be like the simulator, or at least toned down some/a lot.  In that vein any tips on how to tone down (turn off) the UI in combat?  I have a small screen (1366x768) and I like the mechanics of target selection but when it's a capital ship the weapons info blankets the screen.  I looked at the api but .graphics has nothing and .ui has mysteriously promising ValueDisplayMode (of which I intuitively choose minimal :)).
Logged

pyg

  • Lieutenant
  • **
  • Posts: 59
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1593 on: May 15, 2014, 01:08:32 PM »

Well the question about backgrounds I could have answered myself with a little effort.  The battle background is the same as the system and easily changed.  Sorry for the dumb/lazy question.  It might not be pretty but plain black looks more what imagine space would look like anyway.  I'm guessing the combat UI is not really moddable right?
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1368
    • View Profile
    • GitHub Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1594 on: May 15, 2014, 01:16:17 PM »

You can change the colors of various UI elements in settings.json but the look is hardcoded.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1779
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1595 on: May 15, 2014, 01:55:29 PM »

Sorry for the dumb/lazy question.
I don't think your question was dumb or lazy. I think it was just so open ended it made it difficult to answer. There are several ways to change backgrounds. To answer your question thoroughly we'd have to describe each of them. In your situation I would have just modified the images themselves, making them darker.

I don't know much about UI modding, but there's always F11, which will toggle the interface during battle.

pyg

  • Lieutenant
  • **
  • Posts: 59
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1596 on: May 17, 2014, 06:36:00 PM »

Sorry for the dumb/lazy question.
I don't think your question was dumb or lazy. I think it was just so open ended it made it difficult to answer. There are several ways to change backgrounds. To answer your question thoroughly we'd have to describe each of them. In your situation I would have just modified the images themselves, making them darker.

I don't know much about UI modding, but there's always F11, which will toggle the interface during battle.

You are overgenerous.  It was at least lazy as I didn't try anything first.  I replaced some backgrounds with all black and darkened some, both to the effect I wanted.  I'm going to shrink some stars next.  In terms of UI modding what I had in mind is something between F11 and full on UI.  I really like the stuff on the edge and the flux/hull indicators on friends and foes.  Most of the rest could go, especially all the crap on the bottom left as it confuses the edge indicators for me.  I didn't really expect the UI to be moddable, I just hoped that I was wrong.

@LazyWizard: Thanks for that, I might try and black out/hide some of the stuff I don't need.
Logged

Sundog

  • Admiral
  • *****
  • Posts: 1779
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1597 on: May 18, 2014, 08:24:02 AM »

You are overgenerous.  It was at least lazy as I didn't try anything first.
Meh. Maybe. I'm sure you're better qualified to decide whether or not something you did was lazy than I am. I can't blame someone just for asking a question though. I've taken enough ridiculously long trips down seemingly short rabbit holes to appreciate the value in asking for directions from the beginning.

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1598 on: May 20, 2014, 12:47:32 PM »

I've run into a weird issue with portraitSprites and fleet Commanders.

1.  My Commanders all have the "default_portrait" set as their portraitSprite.  Their names are fine, but they don't have portraitSprites set.  Why is that?  Is there something I needed to do when I generated the Fleets?

2.  I'm not sure how to get the male / female-ness of the Commanders.  This doesn't seem to be a straightforward thing to evaluate, but I presume if I can convert the JSONArray of male names to check against, I could determine that via a match.

3.  I'm really getting confused by JSONArray sub-arrays.  I wanted to parse the "portraits" to get a random male/female portrait, but this doesn't work:

Code: java
    private String getPortrait(String factionID){
        try {
            JSONObject json = Global.getSettings().loadJSON("data/world/factions/" + factionID + ".faction");
           
            JSONArray maleFemale = json.getJSONArray("portraits");
            JSONArray male = maleFemale.getJSONArray(0);
            JSONArray female = maleFemale.getJSONArray(1);
            if(MathUtils.getRandomNumberInRange(0,100f) <= 50f){
                JSONObject portraitList = male.toJSONObject(male);
                String Name = portraitList.toString((int)MathUtils.getRandomNumberInRange(0,portraitList.length()-1));
                return Name;
            } else {
                JSONObject portraitList = female.toJSONObject(female);
                String Name = portraitList.toString((int)MathUtils.getRandomNumberInRange(0,portraitList.length()-1));
                return Name;
            }
        } catch (IOException | JSONException ex) {
            return "default_portrait";
        }       
        //return "default_portrait";
    }

At this point I'm tempted to dump all of the JSON data into a class as standard string arrays and do this the hard way, lol.  But surely this isn't such a nasty problem.  I think the main issue here is #1; something is preventing the portraits from being auto-generated...
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25044
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1599 on: May 20, 2014, 12:53:36 PM »

Real quick, re: #3 -
JSONArray maleFemale = json.getJSONArray("portraits");  
Should be:
JSONObject maleFemale = json.getJSONObject("portraits");  

With all that entails for the rest of the code.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1600 on: May 20, 2014, 01:00:57 PM »

OK.  I obviously need to practice this if I'm ever going to get better at using JSON, sigh.

I think I caught #1; it had to do with spawning fleets as Neutral, which doesn't have portraits defined.  Not quite sure I was doing that yet, but I presume I had a good reason, lol.
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25044
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1601 on: May 20, 2014, 01:07:01 PM »

(Re: #2 - this is something I ran into and added to the API a month or so ago.)

OK.  I obviously need to practice this if I'm ever going to get better at using JSON, sigh.

Yeah, just a question of having a firm grasp on the actual format, I think.
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 5078
  • naively breaking things!
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1602 on: May 20, 2014, 04:36:24 PM »

My "good reason" was about avoiding some file clutter, apparently; I was using Neutral to spawn the fake-fleets I use to lower memory consumption (kind of not really needed any more, but I still like the feature of not knowing what's in a fleet) and I guess when the fleets change Faction that doesn't reset the Commanders.  Easy fix for the core problem in the end, but I still need to work on dealing with JSON stuff for a couple of other things I want to try out :)
Logged
Please check out my SS projects :)
Xeno's Mod Pack

celestis

  • Captain
  • ****
  • Posts: 285
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1603 on: May 21, 2014, 12:19:07 PM »

In faction JSON files fleets are composed of records with 2 numbers:
Code
	"fleetCompositions":{
"scout":{
"displayName":"Scout",
"maxFleetPoints":11,
"daysWorthOfSupplies":[30, 50],
"lyWorthOfFuel":[40, 60],
"extraCrewPercent":[80, 80],
"marinesPercent":[20, 20],
"ships":{
"tempest_Attack":[1, 1],
"wasp_wing":[1, 1],
},
},
So, I wonder, what does each number stand for?
Code
"tempest_Attack":[1, 1],
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 25044
    • View Profile
Re: Misc modding questions that are too minor to warrant their own thread
« Reply #1604 on: May 21, 2014, 12:26:39 PM »

Minimum/maximum number of ships with that variant.
Logged
Pages: 1 ... 105 106 [107] 108 109 ... 753