manve1 Posted January 3, 2013 Posted January 3, 2013 Is there a way of changing .xml file while you are in game? For example: If the .xml file had inside: 'here type anything' how could i change the 'here type anything' to anything a player wants to type inside?
Jaysds1 Posted January 3, 2013 Posted January 3, 2013 well, you would need to find the child first. example: > >>> to set what ever is in the rootChild, use what solidSnake posted.
manve1 Posted January 3, 2013 Author Posted January 3, 2013 I have tried to make it to work, but as i am new to the xml functions, i need some help: LUA: addEventHandler('onResourceStart', resourceRoot, function( ) saveS = xmlLoadFile( 'save.xml' ) local save_info = xmlFindChild(saveS, 'turf', 0) xmlNodeSetAttribute( save_info, 'turf', 'nothing new' ) end ) META: SAVE.XML: "No" />
Castillo Posted January 3, 2013 Posted January 3, 2013 addEventHandler('onResourceStart', resourceRoot, function( ) saveS = xmlLoadFile( 'save.xml' ) local save_info = xmlFindChild(saveS, 'turf', 0) xmlNodeSetAttribute( save_info, 'save', 'nothing new' ) end )
manve1 Posted January 3, 2013 Author Posted January 3, 2013 It didn't change the xml file, any ideas why it didn't?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now