 |
Saggles Newbie
Joined: 28 Apr 2008 Posts: 2
|
Posted: Mon Apr 28, 2008 12:35 pm
[2.22] Importing with XML |
Why does exporting into XML have to include these tags?
| Code: |
<window name="Saggles.mud" dockwith="3694" usesession="false">
<uid>{AFEBD6A3-BB73-4E57-9CBC-2F3134BB2335}</uid>
<packages>English Keypad|English Directions|Test|Saggles.mud</packages> |
To illustrate my point, I'll give examples as to how I used to work with ZMud.
In the Zmud settings editor, I used to select individual classes, export into a .txt file, and work on the settings there for easy coding and such (such as the find and replace function). Following the fixes, I'd just delete the corresponding class folder from the .mud file, and reimport the text file I had made my changes in. Unfortunately, with Cmud, the XML files include the little tags above, so when I import said XML file into CMud after making my changes, it creates another "Tristram.mud" tab in the Settings folder, creates another tab in the session window(s), and I lose the input bar for the original. The new tab, however, has the input bar, but all the output of the mud goes to my first tab.
I'll provide a copy of what I'm importing if requested, but I'd like to keep that to a minimum as it contains some sensitive data about how my system works.
..and being an Aetolian player, systems are everything. >.> |
|
|
|
 |
Larkin Wizard

Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Mon Apr 28, 2008 2:45 pm |
You can export a specific set of settings (for lack of a better term) by selecting it in the tree view and choosing "Export Selection to XML" on the context menu. The window, uid, packages, etc are needed to completely rebuild a package and can be very useful when giving code to someone else or restoring a session from a full backup. They are very useful, but you have to know when to use them and when to tailor your XML to only replace what you mean to update.
I'd recommend that you learn to use the XML tab for your modules and/or class folders. Copy/paste code from/to that tab for making your code changes.
Personally, I don't export my code, edit it, and then import it. I either edit it with the Package Editor (which is, after all, its function) or edit my scripts on disk before importing them (but my scripts are always written from scratch and never taken from an export). |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Apr 28, 2008 3:46 pm |
You can also just highlight whatever you want to edit, and hit Ctrl+X to cut it. Then go into your text editor and hit Ctrl+V. When you're done, cut it all again, go back to the package editor, and paste. Job done.
|
|
|
|
 |
Saggles Newbie
Joined: 28 Apr 2008 Posts: 2
|
Posted: Mon Apr 28, 2008 11:40 pm |
Hm, fair enough. On hindsight, I hadn't even thought of the XML tab in the settings editor. But ultimately, and I know Zugg had said that this is a planned feature for a future version of Cmud, I wanted to use find/replace for handy mindless bulk editing of code.
Thanks for the quick replies! |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Apr 29, 2008 5:51 pm |
I wasn't able to reproduce the problem reported by the original poster.
I right-clicked on a Window object containing several triggers and aliases. I selected Export to XML and saved it to test.xml. Then I opened test.xml in an external editor and changed the value of one of the aliases. Then I went back to CMUD (which was still running) and selected File/ImportXML and selected the test.xml file.
In my case, it did *not* create a new window. It properly modified the alias within the window with it's new value.
So I would need to know the exact steps that you used to export/edit/import the XML. It is very important not to mess with those extra XML tags that you mentioned. In particular, the UID tag is what CMUD uses to determine whether you are importing a new window or changing an existing window. So do not change that tag or remove it. |
|
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|