While trying to mod in a new Laser weapon to get a hang of using the fx folder, I got this error when loading up the mod:
Spoiler
Fatal: A JSONObject text must begin with '{' at 1 [character 2 line 1]
Check starfarer.log for more info.
It seemed simple enough to solve, the only .json in the mod is the mod_info.json; The mod had worked before adding in this 'Laser weapon' update, but I checked anyway - '{' is right where it's supposed to be - the first character; just to make sure I checked all the text files, but they're all alright as well.
It occurred to me that this may have been a problem caused by the editor I use, but it appeared alright in all the other text editors I used.
I am stumped as to what the problem could be, as I can't find anything wrong with the update files, but since the mod worked beforehand it must be something to do with them; If anyone has an Idea as to what the problem might be, I'd appreciate the help.
Here are the relevant file texts affected/concerning the update causing the error:
The .log -
Spoiler
18587 [Thread-6] INFO com.fs.starfarer.loading.WeaponSpecLoader - Loading weapon [C:\Program Files (x86)\Fractal Softworks\Starfarer\starfarer-core\..\mods\First_Mod\data\weapons\particlewavebeam.wpn]
18587 [Thread-6] INFO com.fs.starfarer.loading.LoadingUtils - Loading JSON from [C:\Program Files (x86)\Fractal Softworks\Starfarer\starfarer-core\..\mods\First_Mod\data\weapons\particlewavebeam.wpn]
18606 [Thread-10] INFO com.fs.starfarer.loading.scripts.ScriptStore - Compiling script [data.scripts.plugins.BattleObjectivesFleetPointsPluginImpl]
18637 [Thread-10] INFO com.fs.starfarer.loading.scripts.ScriptStore - Compiling script [data.scripts.plugins.BattleObjectivesFogOfWarPluginImpl]
18656 [Thread-6] INFO com.fs.profiler.Profiler - ID Calls Duration Percent
18658 [Thread-6] INFO com.fs.profiler.Profiler - --------------------------------
18666 [Thread-6] ERROR com.fs.starfarer.combat.D - org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
at org.json.JSONTokener.syntaxError(JSONTokener.java:423)
at org.json.JSONObject.<init>(JSONObject.java:184)
at org.json.JSONObject.<init>(JSONObject.java:311)
at com.fs.starfarer.loading.LoadingUtils.?00000(Unknown Source)
at com.fs.starfarer.loading.LoadingUtils.?00000(Unknown Source)
at com.fs.starfarer.loading.WeaponSpecLoader.new(Unknown Source)
at com.fs.starfarer.loading.WeaponSpecLoader.new(Unknown Source)
at com.fs.starfarer.loading.SpecStore.o00000(Unknown Source)
at com.fs.starfarer.loading.G.o00000(Unknown Source)
at com.fs.oOOO.A.?00000(Unknown Source)
at com.fs.starfarer.combat.D.o00000(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$2.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
18671 [Thread-10] INFO com.fs.starfarer.loading.scripts.ScriptStore - Compiling script [data.scripts.world.BaseSpawnPoint]
18719 [Thread-10] INFO com.fs.starfarer.loading.scripts.ScriptStore - Compiling script [data.scripts.world.SectorGen]
18876 [Thread-10] INFO com.fs.starfarer.loading.scripts.ScriptStore - Compiling script [data.missions.turningthetables.MissionDefinition]
18950 [Thread-10] INFO com.fs.starfarer.loading.scripts.ScriptStore - Compiling script [data.missions.forthegreaterlud.MissionDefinition]
The .wpn - [really just a gravbeam edit]
Spoiler
{
"specClass":"beam",
"id":"particlewavebeam",
"type":"ENERGY",
"size":"MEDIUM",
"displayArcRadius":550,
"turretSprite":"graphics/weapons/graviton_beam_turret_base.png",
"turretGlowSprite":"graphics/weapons/graviton_beam_turret_glow.png",
"hardpointSprite":"graphics/weapons/graviton_beam_hardpoint_base.png",
"hardpointGlowSprite":"graphics/weapons/graviton_beam_hardpoint_glow.png",
"turretOffsets":[15, 0],
"turretAngleOffsets":[0],
"hardpointOffsets":[23, 0],
"hardpointAngleOffsets":[0],
"fringeColor":[5,135,175,255],
"coreColor":[200,225,255,255],
"glowColor":[25,215,255,255],
"width":20.0,
"textureType":["graphics/fx/particlewavefringe.png","graphics/fx/particlewavecore.png"],
"textureScrollSpeed":260.0,
"pixelsPerTexel":5.0,
"pierceSet":[PROJECTILE_FF,PROJECTILE_NO_FF,PROJECTILE_FIGHTER],
"fireSoundOne":"beam_medium_intro",
"fireSoundTwo":"beam_medium_loop",
}
The weapon_data.csv - [Copy-pasted straight from the excel sheet.]
Spoiler
Particle Wave Beam particlewavebeam 2 3000 725 250 75 25 10 KINETIC 50 0.85 0.2
The mod_info.json -
Spoiler
{
"id":"strifen_wip_mod",
"name":"Strifens' WIP",
"version":"0.1.4",
"description":"Adds Strifens' WIP Mod-stuff to your game",
"gameVersion":"0.52a",
"totalConversion":"false",
"replace":[
],
}
Edit:
The Problem seems to have been some rather strange behavior on the part of Libre Office, trouble with BOMs and the Corruption of .wpn files
Case Solved