Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.9.1a is out! (05/10/19); Blog post: Painting the Stars (02/07/20)

Author Topic: Is it possible for mods to read .json files?  (Read 1398 times)

Ghoti

  • Captain
  • ****
  • Posts: 283
    • View Profile
    • Email
Is it possible for mods to read .json files?
« on: September 10, 2012, 12:56:06 PM »

I'm planning to make a station that breaks down weapons and ships to make new weapons and ships. I will need to make a list of items and what those items break down into. I don't like putting that data inside the script. I'd rather have it in a JSON file. Is that possible?
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16012
    • View Profile
Re: Is it possible for mods to read .json files?
« Reply #1 on: September 10, 2012, 01:08:56 PM »

No. Something I'd like to add to the API at some point, though.
Logged

Ghoti

  • Captain
  • ****
  • Posts: 283
    • View Profile
    • Email
Re: Is it possible for mods to read .json files?
« Reply #2 on: September 10, 2012, 01:15:56 PM »

We can add and read settings though can't we? Or would that be a horrible idea?  ;D
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 16012
    • View Profile
Re: Is it possible for mods to read .json files?
« Reply #3 on: September 10, 2012, 01:33:27 PM »

Well:

public interface SettingsAPI {
   public float getFloat(String key);
   public boolean getBoolean(String key);
}

That doesn't seem sufficient :)
Logged

Ghoti

  • Captain
  • ****
  • Posts: 283
    • View Profile
    • Email
Re: Is it possible for mods to read .json files?
« Reply #4 on: September 10, 2012, 01:36:50 PM »

oh yah... Well. I guess this should be moved to suggestions then. I guess  :-[
Logged