Stargrove
December 1st, 2024, 19:36
I have created an extension that will take JSON data from travellermap.com (for example: https://travellermap.com/data/spinward%20marches/2124) which would give you this:
{"Worlds":[{"Name":"Lunion","Hex":"2124","UWP":"A995984-D","PBG":"810","Zone":"","Bases":"NS","Allegiance":"ImDd","Stellar":"G5 V","SS":"K","Ix":"{ 5 }","Ex":"(C8H+3)","Cx":"[7E3B]","Nobility":"BEF","Worlds":11,"ResourceUnits":4896,"Subsector":10,"Quadrant":5,"WorldX":-108,"WorldY":-56,"Remarks":"Hi In Cp Ht","LegacyBaseCode":"A","Sector":"Spinward Marches","SubsectorName":"Lunion","SectorAbbreviation":"Spin","AllegianceName":"Third Imperium, Domain of Deneb"}]}
You can then copy/paste it into a field on my form and after pressing a button it will be processed into a new System entry. However, there is some oddity with the Hex Location and Bases being processed into their respective fields properly. I can see in the db.xml that the <hexlocation> tag is populated properly and the <bases> XML tag is populated properly. The issue seems to show up when you tab through the newly created system record where that triggers something in the MGT2E ruleset to fill in all the extra data to the right of the UWP fields (Starport, Size, Atmosphere, etc) which will then erase the Hex Location and Bases data that my code filled in from the JSON.
If I just import the data to fill in the record and restart FGU, I can see the proper data in the db.xml file:
<id-00003>
<allegiances type="string">Third Imperium</allegiances>
<bases type="string">N S</bases>
<domain type="string"> Domain of Deneb</domain>
<hexlocation type="string">2124</hexlocation>
<name type="string">Lunion</name>
<sector type="string">Spinward Marches</sector>
<subsector type="string">Lunion</subsector>
<system type="string">G5 V</system>
<trade_codes type="string">Hi In Cp Ht</trade_codes>
<travel_code type="string">G</travel_code>
<uwp type="string">A995984-D</uwp>
</id-00003>
But, as soon as I open up the record and tab through all the fields, the Hex and Bases data disappears. I can get it to finally stick by manually entering it but would obviously prefer to not have to do that after the data import. I am also seeing that Bases will no longer hold more than one entry, and Trade Code entries are getting deleted and cannot be re-added and the new entries get deleted.
The extension works well, and it could be a great tool for these annoying issues. I am unsure what is happening under the ruleset's hood, but something is not working properly. I don't think I really need help with my extension, per se, just for someone to look at what is happening with the ruleset.
{"Worlds":[{"Name":"Lunion","Hex":"2124","UWP":"A995984-D","PBG":"810","Zone":"","Bases":"NS","Allegiance":"ImDd","Stellar":"G5 V","SS":"K","Ix":"{ 5 }","Ex":"(C8H+3)","Cx":"[7E3B]","Nobility":"BEF","Worlds":11,"ResourceUnits":4896,"Subsector":10,"Quadrant":5,"WorldX":-108,"WorldY":-56,"Remarks":"Hi In Cp Ht","LegacyBaseCode":"A","Sector":"Spinward Marches","SubsectorName":"Lunion","SectorAbbreviation":"Spin","AllegianceName":"Third Imperium, Domain of Deneb"}]}
You can then copy/paste it into a field on my form and after pressing a button it will be processed into a new System entry. However, there is some oddity with the Hex Location and Bases being processed into their respective fields properly. I can see in the db.xml that the <hexlocation> tag is populated properly and the <bases> XML tag is populated properly. The issue seems to show up when you tab through the newly created system record where that triggers something in the MGT2E ruleset to fill in all the extra data to the right of the UWP fields (Starport, Size, Atmosphere, etc) which will then erase the Hex Location and Bases data that my code filled in from the JSON.
If I just import the data to fill in the record and restart FGU, I can see the proper data in the db.xml file:
<id-00003>
<allegiances type="string">Third Imperium</allegiances>
<bases type="string">N S</bases>
<domain type="string"> Domain of Deneb</domain>
<hexlocation type="string">2124</hexlocation>
<name type="string">Lunion</name>
<sector type="string">Spinward Marches</sector>
<subsector type="string">Lunion</subsector>
<system type="string">G5 V</system>
<trade_codes type="string">Hi In Cp Ht</trade_codes>
<travel_code type="string">G</travel_code>
<uwp type="string">A995984-D</uwp>
</id-00003>
But, as soon as I open up the record and tab through all the fields, the Hex and Bases data disappears. I can get it to finally stick by manually entering it but would obviously prefer to not have to do that after the data import. I am also seeing that Bases will no longer hold more than one entry, and Trade Code entries are getting deleted and cannot be re-added and the new entries get deleted.
The extension works well, and it could be a great tool for these annoying issues. I am unsure what is happening under the ruleset's hood, but something is not working properly. I don't think I really need help with my extension, per se, just for someone to look at what is happening with the ruleset.