View Issue Details

IDProjectCategoryView StatusLast Update
0003444Multi Theft Auto : San AndreasScriptingpublic2008-05-24 07:17
Reporterlil_ToadyAssigned Tolil_Toady 
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version1.0 
Summary0003444: make loadMapData not take into account the first xml node and saveMapData only save children of the specified parent element

loadMapData takes into account the root xml node, and saving the map saves the parent element specified in the specified xml load, so after a few loading/saving this xml:

<vehicle blabla />

eventually you will get

<vehicle blabla />

TagsNo tags attached.


child of 0002949 closed Map editor issues 



2008-04-27 07:38

administrator   ~~0007663

loadMapData creating a <map/> element is expected. I think the issue is only with saveMapData here.


2008-04-27 08:18

administrator   ~~0007665

I've thought about this carefully and i think the best solution is to add another parameter and a slight syntax change:

element/bool loadMapData ( xmlnode node, element parent, [createMapElement=true] )
If you choose to create a map element, the function will dump all XML elements under a new map root as it is now, and return the created map element.
If this is specified to be false, the function will dump all XML elements directly under the parent element and return true.

xmlnode/bool saveMapData(xmlnode node, element baseElement, [createRootNode=true] )
If you choose to create the root node, then the base element will be created as a subnode to the specified xmlnode, and all elements created under that. It will return the base element's new node.
If you specify not to create a root node, the base element will not be created and all children of the base element will be dumped directly into the specified XML node.

Issue History

Date Modified Username Field Change