Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: I need help with mod.  (Read 6513 times)

Zmey

  • Ensign
  • *
  • Posts: 8
    • View Profile
I need help with mod.
« on: March 26, 2017, 04:18:05 AM »

Hey guys! I need help with my mod. I mixed some contents from other mods and use it to make my own faction but there is a small error which I dont know how to repair.
Spoiler
7336 [Thread-4] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [DIRECTORY: D:\Starsector\starsector-core\..\mods\Red Alliance (data/world/factions/RED Alliance.faction)]
7418 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - org.json.JSONException: Unterminated string at 2136 [character 0 line 96]
org.json.JSONException: Unterminated string at 2136 [character 0 line 96]
   at org.json.JSONTokener.syntaxError(JSONTokener.java:423)
   at org.json.JSONTokener.nextString(JSONTokener.java:249)
   at org.json.JSONTokener.nextValue(JSONTokener.java:349)
   at org.json.JSONObject.<init>(JSONObject.java:195)
   at org.json.JSONTokener.nextValue(JSONTokener.java:352)
   at org.json.JSONObject.<init>(JSONObject.java:210)
   at org.json.JSONTokener.nextValue(JSONTokener.java:352)
   at org.json.JSONObject.<init>(JSONObject.java:210)
   at org.json.JSONObject.<init>(JSONObject.java:311)
   at com.fs.starfarer.loading.LoadingUtils.?00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.o00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.o00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.new(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.super.super(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.?00000(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]
Could someone help me with it?

[attachment deleted by admin]
Logged

Inventor Raccoon

  • Captain
  • ****
  • Posts: 452
  • Digging through trash for a hydroflux catalyst
    • View Profile
Re: I need help with mod.
« Reply #1 on: March 26, 2017, 04:49:23 AM »

Hey guys! I need help with my mod. I mixed some contents from other mods and use it to make my own faction but there is a small error which I dont know how to repair.
Spoiler
7336 [Thread-4] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [DIRECTORY: D:\Starsector\starsector-core\..\mods\Red Alliance (data/world/factions/RED Alliance.faction)]
7418 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - org.json.JSONException: Unterminated string at 2136 [character 0 line 96]
org.json.JSONException: Unterminated string at 2136 [character 0 line 96]
   at org.json.JSONTokener.syntaxError(JSONTokener.java:423)
   at org.json.JSONTokener.nextString(JSONTokener.java:249)
   at org.json.JSONTokener.nextValue(JSONTokener.java:349)
   at org.json.JSONObject.<init>(JSONObject.java:195)
   at org.json.JSONTokener.nextValue(JSONTokener.java:352)
   at org.json.JSONObject.<init>(JSONObject.java:210)
   at org.json.JSONTokener.nextValue(JSONTokener.java:352)
   at org.json.JSONObject.<init>(JSONObject.java:210)
   at org.json.JSONObject.<init>(JSONObject.java:311)
   at com.fs.starfarer.loading.LoadingUtils.?00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.o00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.o00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.new(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.super.super(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.?00000(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]
Could someone help me with it?
In the RED Alliance.faction file, at line 96, you forgot to add a comma or something. You might want to post those few lines.
Logged

Zmey

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: I need help with mod.
« Reply #2 on: March 26, 2017, 05:11:53 AM »

Download file, I copied that from oryginal file (hegemony.faction) and changed only ships and names and thats all. I just dont know why it says that line 96 is bad when everything is alright.
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile
Re: I need help with mod.
« Reply #3 on: March 26, 2017, 05:55:58 AM »

And as Inventor Racoon said, you are missing a comma line 96...
Logged
 

Zmey

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: I need help with mod.
« Reply #4 on: March 26, 2017, 06:21:52 AM »

Look
Spoiler
{
   id:"redallaince",
   "color":[245,150,30,255],
   "displayName":"Red Alliance",
   "displayNameWithArticle":"the Red Alliance",
   "logo":"graphics/factions/RED_flag.png",
   "crest":"graphics/factions/RED_crest.png",
   "shipNamePrefix":"RED",
   "shipNameSources":{
      "RED":1,
   },
   "names":{
      "modern":1,
   },
   "illegalCommodities":[
      "drugs",
   ],
   "internalComms":"hegemony_internal",
   #"tariffFraction":0.4,
   #"tollFraction":0.1,
   #"fineFraction":0.25,
   "portraits":{
      "standard_male":[
         "graphics/portraits/portrait_hegemony01.png",
         "graphics/portraits/portrait_hegemony02.png",
         "graphics/portraits/portrait_hegemony05.png",
         "graphics/portraits/portrait_mercenary01.png",
         "graphics/portraits/portrait_mercenary03.png",
         "graphics/portraits/portrait13.png",
         "graphics/portraits/portrait15.png",
         "graphics/portraits/portrait23.png",
      ],
      "standard_female":[
         "graphics/portraits/portrait_hegemony03.png",
         "graphics/portraits/portrait_hegemony04.png",
         "graphics/portraits/portrait_mercenary02.png",
         "graphics/portraits/portrait16.png",
      ],
   },
   "ranks":{
      "ranks":{
         "spaceCommander":{"name":"Commander"},
      },
      "posts":{
         "patrolCommander":{"name":"Patrol Commander"},
         "fleetCommander":{"name":"Fleet Commander"},
         "baseCommander":{"name":"Base Commander"},
      },
   },
   "custom":{
      "offersCommissions":true,
      "engagesInHostilities":true,
   },   
   "shipRoles":{
      "interceptor":{
         "lighting_wing":10,
         "fallback":{"fighter":1},
      },
      "fighter":{
         "azgard_wing":10,
         "butcher_wing":3,
         "fallback":{"interceptor":1},
      },
      "bomber":{
         "ancord_wing":10,
      },
      
      "fastAttack":{
         "longinus_advanced":10,
         "panther_advanced":5,
         "fallback":{"combatSmall":1},
      },
   
      "escortSmall":{
         "longinus_advanced":10,
         "gepard_advanced":5,
         "panther_advanced":5,
         "fallback":{"combatSmall":1},
      },
      "escortMedium":{
         "almire_i_advanced":5,
            "heron_b_advanced":5,
         "fallback":{"combatMedium":1},
      },
      
      "combatSmall":{
         "longinus_advanced":5,
         "gepard_advanced":3,
         "panther_advanced":8,
         "fallback":{"escortSmall":1},     <----- 96 line there is everything alright but still it gives me that error.
      },
      "combatMedium":{
         "almire_i_advanced":5,
         "heron_b_advanced":5,
         "almire_ii_advanced:4,
         "fallback":{"combatSmall":1},
      },
      "combatLarge":{
         "almire_i_advanced":10,
         "almire_ii_advanced":6,
         "heron_b_advanced":6,
         "almire_iii_advanced":4,
         "yoshura_advanced":6,
         "fallback":{"combatMedium":2},
      },
      "combatCapital":{
         "yoshura_prime_advanced":5,   
         "almire_iii_advanced":8, 
         "galactica_vegance":3,
         "dreadnought_vanguard":3,
         "fallback":{"combatLarge":2},
      },
      
      
      # hybrid ships with good combat and cargo capacity
      "combatFreighterSmall":{
         "fallback":{"freighterSmall":1},
      },
      "combatFreighterMedium":{
         "fallback":{"combatFreighterSmall":2},
      },
      "combatFreighterLarge":{
         "fallback":{"combatFreighterMedium":2},
      },
      
      "civilianRandom":{
         "fallback":{"freighterSmall":1},
      },
   
      # carriers
      "carrierSmall":{
         "fallback":{"carrierMedium":0.5},
      },
      "carrierMedium":{
         "heron_b_advanced":10,
         "fallback":{"carrierSmall":2},
      },
      "carrierLarge":{
         "galactica_vegance":10
         "fallback":{"carrierMedium":2},
      },
   
      # freighters and such
      "freighterSmall":{
         "fallback":{"freighterMedium":0.5},
      },
      "freighterMedium":{
         "emerald":10,
         "fallback":{"freighterSmall":2},
      },
      "freighterLarge":{
         "atlas_Standard":10,
         "fallback":{"freighterMedium":2},
      },
      
      "tankerSmall":{
         "dram_Light":10,
         "fallback":{"tankerMedium":0.5},
      },
      "tankerMedium":{
         "topaz":10,
         "fallback":{"tankerSmall":2},
      },
      "tankerLarge":{
         "prometheus_Super":10,
         "fallback":{"tankerMedium":2},
      },
      
      "personnelSmall":{
         "fallback":{"personnelMedium":0.5},
      },
      "personnelMedium":{
         "valkyrie_B_advanced":10
         "fallback":{"personnelSmall":2},
      },
      "personnelLarge":{
         "fallback":{"personnelMedium":3},
      },
      
      # utility ships
      "tug":{
         "ox_Standard":10,
         "fallback":{"utility":1},
      },
      "crig":{
         "crig_Standard":10,
         "fallback":{"utility":1},
      },
      "utility":{
         "crig_Standard":10,
         "ox_Standard":10,
      },
   },
   "doctrine":{
      # ship distribution
      "interceptors":6,
      "fighters":8,
      "bombers":4,
      "small":8,
      "fast":2,
      "medium":10,
      "large":6,
      "capital":5,
      
      # as fraction of combat ships of same size
      "escortSmallFraction":1,
      "escortMediumFraction":1,
      
      "combatFreighterProbability":0.1,
      
      "minPointsForCombatCapital":10,
      "minPointsForLargeCarrier":30,
      
      "smallCarrierProbability":0.25,
      "mediumCarrierProbability":0.25,
      "largeCarrierProbability":0.25,
      
      # officers
      "officersPerPoint":0.35,
      "officerLevelPerPoint":0.3,
      "officerLevelBase":5,
      "officerLevelVariance":0.25,
   },   
   "traits":{
      "admiral":{
         
      },
      "captain":{
         "steady":10,
         "aggressive":10,
      },
   },
},
[close]
Error:
Spoiler
5418 [Thread-4] INFO  com.fs.starfarer.loading.LoadingUtils  - Loading JSON from [DIRECTORY: D:\Starsector\starsector-core\..\mods\Red Alliance (data/world/factions/RED Alliance.faction)]
5494 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - org.json.JSONException: Unterminated string at 2136 [character 0 line 96]
org.json.JSONException: Unterminated string at 2136 [character 0 line 96]
   at org.json.JSONTokener.syntaxError(JSONTokener.java:423)
   at org.json.JSONTokener.nextString(JSONTokener.java:249)
   at org.json.JSONTokener.nextValue(JSONTokener.java:349)
   at org.json.JSONObject.<init>(JSONObject.java:195)
   at org.json.JSONTokener.nextValue(JSONTokener.java:352)
   at org.json.JSONObject.<init>(JSONObject.java:210)
   at org.json.JSONTokener.nextValue(JSONTokener.java:352)
   at org.json.JSONObject.<init>(JSONObject.java:210)
   at org.json.JSONObject.<init>(JSONObject.java:311)
   at com.fs.starfarer.loading.LoadingUtils.?00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.o00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.o00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.new(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.super.super(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.?00000(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]
I really dont know what to do.
Logged

ANGRYABOUTELVES

  • Admiral
  • *****
  • Posts: 592
  • AE ALTADOON GHARTOK PADHOME
    • View Profile
Re: I need help with mod.
« Reply #5 on: March 26, 2017, 06:29:46 AM »

I noticed two missing commas on these lines.

   "galactica_vegance":10

   "valkyrie_B_advanced":10
Logged

Zmey

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: I need help with mod.
« Reply #6 on: March 26, 2017, 06:47:08 AM »

And as Inventor Racoon said, you are missing a comma line 96...
Added, I'm still getting same error
org.json.JSONException: Unterminated string at 2136 [character 0 line 96]

I noticed two missing commas on these lines.

   "galactica_vegance":10

   "valkyrie_B_advanced":10
Added.
Logged

Elaron

  • Ensign
  • *
  • Posts: 43
    • View Profile
Re: I need help with mod.
« Reply #7 on: March 26, 2017, 08:07:27 AM »

In this section:

Code
      "combatMedium":{
         "almire_i_advanced":5,
         "heron_b_advanced":5,
         "almire_ii_advanced:4,
         "fallback":{"combatSmall":1},
      },

This line:
Code
         "almire_ii_advanced:4,

Is missing the closed quote.

If you're not using it already, download Notepad++ and use it to edit such files with the language set to JSON for proper syntax highlighting. Makes debugging these kinds of things far easier.
Logged

Zmey

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: I need help with mod.
« Reply #8 on: March 26, 2017, 08:48:05 AM »

In this section:

Code
      "combatMedium":{
         "almire_i_advanced":5,
         "heron_b_advanced":5,
         "almire_ii_advanced:4,
         "fallback":{"combatSmall":1},
      },

This line:
Code
         "almire_ii_advanced:4,

Is missing the closed quote.

If you're not using it already, download Notepad++ and use it to edit such files with the language set to JSON for proper syntax highlighting. Makes debugging these kinds of things far easier.

Thank you.

Spoiler
3294 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Ship hull variant [freighterSmall] not found!
java.lang.RuntimeException: Ship hull variant [freighterSmall] not found!
[close]
How can I repair it? (I gave download link below)



[attachment deleted by admin]
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: I need help with mod.
« Reply #9 on: March 26, 2017, 12:55:52 PM »


Spoiler
3294 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Ship hull variant [freighterSmall] not found!
java.lang.RuntimeException: Ship hull variant [freighterSmall] not found!
[close]
How can I repair it? (I gave download link below)


You're trying to tell the code that it should be looking for a variant of a ship called "freighterSmall", which is a tag used in the Faction file to start a list of ships that the game treats as "small freighters" for that faction. You need to find the line where you're calling this variant and correct it to a valid one.

EDIT: Don't take this the wrong way, but is English your first language?
Logged

Zmey

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: I need help with mod.
« Reply #10 on: March 27, 2017, 05:15:04 AM »


Spoiler
3294 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.RuntimeException: Ship hull variant [freighterSmall] not found!
java.lang.RuntimeException: Ship hull variant [freighterSmall] not found!
[close]
How can I repair it? (I gave download link below)


You're trying to tell the code that it should be looking for a variant of a ship called "freighterSmall", which is a tag used in the Faction file to start a list of ships that the game treats as "small freighters" for that faction. You need to find the line where you're calling this variant and correct it to a valid one.

EDIT: Don't take this the wrong way, but is English your first language?
English is not my first language and I'm not good with writting codes.
I repaired it by myself.

But somehow it does other mad stuff... Could someone help me or make it work?
I now says this
Spoiler
2634 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - org.json.JSONException: A JSONObject text must end with '}' at 5566 [character 3 line 276]
org.json.JSONException: A JSONObject text must end with '}' at 5566 [character 3 line 276]
   at org.json.JSONTokener.syntaxError(JSONTokener.java:423)
   at org.json.JSONObject.<init>(JSONObject.java:190)
   at org.json.JSONObject.<init>(JSONObject.java:311)
   at com.fs.starfarer.loading.LoadingUtils.?00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.o00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.o00000(Unknown Source)
   at com.fs.starfarer.loading.LoadingUtils.new(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.super.super(Unknown Source)
   at com.fs.starfarer.loading.SpecStore.?00000(Unknown Source)
   at com.fs.starfarer.loading.ResourceLoaderState.init(Unknown Source)
   at com.fs.state.AppDriver.begin(Unknown Source)
   at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
   at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
[close]

[attachment deleted by admin]
« Last Edit: March 27, 2017, 08:26:14 AM by Zmey »
Logged

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile
Re: I need help with mod.
« Reply #11 on: March 27, 2017, 02:28:12 PM »

Again, you've missed a closing character from the end of a line. You'll have to go through each of the files you changed last and find which one is missing a " , " or a  " } " at the end of a statement.

Follow the instruction in the error message: It doesn't tell you what file the problem comes from, but it tells you what line, so you don't have to waste time trawling through every line of code. Check each file and go to that line, and see if something's missing.
Logged

Zmey

  • Ensign
  • *
  • Posts: 8
    • View Profile
Re: I need help with mod.
« Reply #12 on: March 28, 2017, 11:15:03 AM »

Thank you all for help.   ;)

I've made this to work... somehow.
Logged

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: I need help with mod.
« Reply #13 on: April 01, 2017, 10:54:52 AM »

Thank you all for help.   ;)

I've made this to work... somehow.

Don't be disheartened buddy! Even experienced coders struggle with Syntax issues from time to time :)
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)