Runtime XML access

Post ideas & suggestions you have pertaining to the game here.
Post Reply
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

This was part of the original typcreate request. Without runtime access to the XML in string form it is not possible to alter content. The most obvious example of why this is needed is to alter tables.

With runtime XML access it would be possible to append to something like &tbCommTraffic; in a way that does not break compatibility if the table changes in vanilla and allows multiple mods to add to the table without stepping on each other's toes.

There are several of these tables that need to be appended to to integrate mod ships into the Commonwealth and CH and it should be possible to append to them rather than replacing them.
Literally is the new Figuratively
User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

This is very true, it would open a lot of new doors if we could read the XML definitions. I guess you request could more or less be satisfied with what I proposed earlier?

~Pixelfck
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2620
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

unfortunately, as George explained (more than once I think), XML is dropped after game load.
So you can typCreate an existing UNID at game load and overwrite it or you can typCreate new stuff during gameplay.

In the particular case of tables, wouldn't a function that retrieves the table data as a list be enough ? From the list you can recreate the XML and typCreate at game load.

Each mod would retrieve the table, add contents to it and typCreate it again, making mods fully compatible with each other.

so somthing like
(typGetTableData tableUNID) --> list
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

I just need to keep XML loaded until the end of <onglobaltypesinit>. It can be dropped before anything is actually instantiated so it wouldn't increase the game's memory footprint.
Literally is the new Figuratively
Post Reply