manve1 Posted January 3, 2013 Share 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? Link to comment
manve1 Posted January 3, 2013 Author Share Posted January 3, 2013 I mean which function do i use Link to comment
Jaysds1 Posted January 3, 2013 Share 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. Link to comment
manve1 Posted January 3, 2013 Author Share 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" /> Link to comment
Castillo Posted January 3, 2013 Share 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 ) Link to comment
manve1 Posted January 3, 2013 Author Share Posted January 3, 2013 It didn't change the xml file, any ideas why it didn't? Link to comment
manve1 Posted January 3, 2013 Author Share Posted January 3, 2013 Thank you Castro and Solidsnake14 Link to comment
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