• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

HlynkaCG

Recruit
38 Badges
Nov 27, 2017
8
0
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: The Old Gods
  • Tyranny - Tales from the Tiers
  • Stellaris: Federations
  • Tyranny - Bastards Wound
  • Cities: Skylines - Green Cities
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • BATTLETECH - Digital Deluxe Edition
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Cities: Skylines Industries
  • BATTLETECH: Flashpoint
  • Stellaris: Megacorp
  • Cities: Skylines - Campus
  • Stellaris: Ancient Relics
  • BATTLETECH: Season pass
  • BATTLETECH: Heavy Metal
  • BATTLETECH
  • Cities: Skylines
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Stellaris
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Stellaris: Synthetic Dawn
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
I have a fair bit of experience modding other games (Skyrim, DCS, Far Cry, etc...) and I'm now starting to dabble in BattleTech. I have a question regarding the game's JSON files. Is it possible to declare a dynamic string? If so, how? In pseudo code what I want to do would look something like this...

my_dynamic_string {
if (condition A met) return "String A"
else if (condition B met) return "String B"
else return "String C"
}

and then elsewhere in the JSON have...

string_variable = my_dynamic_string
...would set string_variable to option A, B, or C as appropriate. If someone here could point me in the right direction it would be much appreciated.
 
No, the JSON format has static data structures only.

Presumably you could create a similar effect by writing code to replace some of the DLL routines, though. Much more work, and I don't know how best to get started with that sort of thing since I haven't done it myself yet.