xetra11 Posted July 12, 2016 Share Posted July 12, 2016 Hello Peoples!I need to create a XMLEditor within T3D and visualize it with a GUI and make it functional there as well. Therefore I need some informations regarding the backend library "tinyxml" which is already available and how to get backend logic into the scripts.My prerequisite is the "Coin Collection Tutorial" which gave me a good, crude understanding in how the Script and GUI works.In fact I just want to ask if it is trivial to accomplish following specifications: - Load an xml file out of the project folder- visualize it in a tree dom within the GUI- manipulate those tree nodes- and save it as a new XML / update the old XML afterwards I would appreciate any guidance you guys can give me to have a quicker start, since I only have 2 weeks left for that task.EDIT: To make things clear - I don't need a guide how to use the api of tinyxml or streams in c++ etc. I more need a entry point on where to add a new class to create my api and how to connect it to the gui scriptsgreets Charlie! 8-) Quote Link to comment Share on other sites More sharing options...
Johxz Posted July 12, 2016 Share Posted July 12, 2016 Hi!From good rlranft... here you have the documentation, and familiarize yourself with the engine....read the GUI Tutorial and the Scripting Tutorial, http://www.roostertailgames.com/TorqueRef/index.htmlSee this "SimXMLDocument Class Reference"http://docs.garagegames.com/torque-3d/reference/classSimXMLDocument.htmlYou can download the references from here: Torque 3D - Script Manual.chmSome examples:function write(%client) { %file = new FileObject(); %file.openforWrite("modpath/folder/filename.cs"); %file.writeLine("any text you want to write here"); %file.close(); %file.delete(); } function readXmlExample(%filename) { %xml = new SimXMLDocument() {}; %xml.loadFile(%filename); %xml.pushChildElement("DataTables"); %xml.pushFirstChildElement("table"); while(true) { echo("TABLE:" SPC %xml.attribute("tableName")); %xml.pushFirstChildElement("rec"); while (true) { %id = %xml.attribute("id"); %desc = %xml.getData(); echo(" Shape" SPC %id SPC %desc); if (!%xml.nextSiblingElement("rec")) break; } %xml.popElement(); if (!%xml.nextSiblingElement("table")) break; } }source: http://www.garagegames.com/community/forums/viewthread/100483/1#comment-686373And download the attached old resource "Script_Editor".Script_Editor_1.1b2.rar Quote Link to comment Share on other sites More sharing options...
xetra11 Posted July 12, 2016 Author Share Posted July 12, 2016 Thanks a ton for those tips! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.