@Jamz: yep I've been able to generate an uuid4, but your GUIDs seems rather different, or rencoded, they're formed with alphanumeric characters, not only hex characters.
@Phergus: you're right (and Jamz as a consequence). I didn't think of it, but yeah anyway token GUIDs are reassigned upon dropping the rptok file. I still may need to generate valid GUID in the future though, as I plan to inject tokens directly into a cmpgn file, and I'm trying to figure out how I can make it work.
As for Jamz's remark about generating stuff externally, I totally agree with the argument, but for now, for me the existing alternative is not acceptable, refactoring stuff is way too painful manually. I could not do it in MT macros, as I'm not Wolf42's sidekick
.
If MT would accept json data with post commands, I would certainly use it (well it would probably still python feeding the data) but at least it would ensure the correct data serialization/deserialization among multiple java version and I wouldn't need to care about MT internal specifics.
FYI, my work is kinda working... from a simple json structure, I can rebuild from scratch a set of cmpgn and rptok files.
Code: Select all
# An eclipse phase 2nd edition framework
campaign_props='''[
{"name": "aptitudes", "showOnSheet": true, "value": "COG {cognition} | INT {intuition} | REF {reflex} | SAV {savvy} | SOM {somatics} | WIL {willpower}"},
{"name": "pools", "showOnSheet": true, "value": "Ins {insight} | Mox {moxie} |Vig {vigor} | Flex {flex}"},
{"name": "initiative", "showOnSheet": true, "value": "{(reflex + intuition)/5}"},
{"name": "lucidity", "showOnSheet": true, "value": "{willpower*2}"},
{"name": "insanity", "showOnSheet": true, "value": "{lucidity*2}"},
{"name": "trauma", "showOnSheet": true, "value": "{lucidity/5}"},
{"name": "infection", "showOnSheet": true, "value": "{psi*10}"}
]
''
tokens='''
{ "_type" : "Character",
"name" : "Amal",
"attributes": [
{"somatics":15},
{"reflex": 20},
{"savvy": 15},
{"intuition": 20},
{"cognition": 15},
{"willpower" : 15}
],
"pools": [
{"insight":1},
{"moxie":0},
{"vigor":4},
{"flex": 1},
{"ego_flex": 1}
],
"skills": [
{"melee":55},
{"psi":0}
]
}
'''
If I want to change the name of a property, it's a matter a seconds to rebuild the campaign and all the tokens.
Anyway, I really do appreciate your help, thank you !