|
Nicodareus Wanderer
Joined: 24 Jun 2008 Posts: 68 Location: Texas
|
Posted: Tue Jul 01, 2008 8:45 pm
[2.29] Saving classes out to xml |
Process:
Step 1: Open CMud and 'x' out of the sessions listing to the default window.
Step 2: Open the package editor and create a class folder
Step 3: Export the class folder to XML
Step 4: Import the XML
The importing creates a new window module for the imported data. This does -not- happen when importing aliases/triggers/etc. This happens whether or not there are any actual settings in the class folder (Aliases, triggers, etc) |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jul 01, 2008 10:09 pm |
I could not reproduce this.
In Step 3 I exported the class folder by right-clicking on the class in the tree and select "Export selection to XML". In step 4 I didn't get any duplicate class.
You might post the XML that you exported within [CODE] tags here in the forum so I can look at exactly what is being exported. |
|
|
|
Nicodareus Wanderer
Joined: 24 Jun 2008 Posts: 68 Location: Texas
|
Posted: Tue Jul 01, 2008 10:27 pm |
Just following the above method on an untitled window with creating a few triggers inside of a class folder, I ended up with this:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<window name="untitled" host="0" usesession="false">
<uid>{189D4896-7EAC-4B2B-A43D-3D30FD973F19}</uid>
<packages>untitled</packages>
<class name="gdhgdhfghdgh">
<trigger priority="20">
<pattern>dghdghdghdg</pattern>
</trigger>
<trigger priority="30">
<pattern>ghdghdghdgh</pattern>
</trigger>
<trigger priority="40">
<pattern>dfghdfghdfgh</pattern>
</trigger>
<trigger priority="50">
<pattern>dghdgfhdfgh</pattern>
</trigger>
</class>
</window>
</cmud>
|
Now if I use notepad to strip it down to this, it works fine:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<class name="gdhgdhfghdgh">
<trigger priority="20">
<pattern>dghdghdghdg</pattern>
</trigger>
<trigger priority="30">
<pattern>ghdghdghdgh</pattern>
</trigger>
<trigger priority="40">
<pattern>dfghdfghdfgh</pattern>
</trigger>
<trigger priority="50">
<pattern>dghdgfhdfgh</pattern>
</trigger>
</class>
</cmud> |
If I export a class folder from within a class folder (Containing all of the same data as the original class folder) I get this:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<window name="untitled" host="0" usesession="false">
<uid>{189D4896-7EAC-4B2B-A43D-3D30FD973F19}</uid>
<packages>untitled</packages>
</window>
</cmud> |
And the results are the same no matter if I right click and go to export as xml or if I go to Edit->Export selection as XML.
Seems to me like it's trying to Export All as if from the file menu when a class folder is selected and it's just not doing much of anything if a class folder within a class folder is selected. |
|
|
|
Nicodareus Wanderer
Joined: 24 Jun 2008 Posts: 68 Location: Texas
|
Posted: Tue Jul 01, 2008 11:12 pm |
I just had my gal at home try this on her comp and she has the same issues with it, so it is reproducable on at least 1 other computer. I know it should be negligible that I'm running CMud Pro.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Jul 01, 2008 11:24 pm |
In your original instructions you said you were just exporting the CLASS folder. But your XML shows that you are exporting the entire package and window. That's why I asked *exactly* HOW you were exporting the class. If you right-click on the class folder and select "Export selection" then you don't get this problem because it only outputs the class and not the whole window. Or maybe you are right-clicking on the window name and calling this a "class" by mistake.
The reason you get a duplicate when you export the entire window because you are exporting the "Untitled" window. The "Untitled" window is recreated each time you run CMUD and is assigned a new unique identifier (thats the UID field show in your XML export). When the UID field doesn't match anything in your settings, then a new window/module is created. Since CMUD assigns a new UID to the Untitled window each time you run it, then this is going to happen.
Shouldn't happen within a normal session however. So try this in one of your real sessions. When you export the window you'll see the UID for that window in the XML output. When you import that file, CMUD will see the matching window UID and won't create any new window. |
|
|
|
Nicodareus Wanderer
Joined: 24 Jun 2008 Posts: 68 Location: Texas
|
Posted: Tue Jul 01, 2008 11:34 pm |
Quote: |
In your original instructions you said you were just exporting the CLASS folder. But your XML shows that you are exporting the entire package and window. That's why I asked *exactly* HOW you were exporting the class. If you right-click on the class folder and select "Export selection" then you don't get this problem because it only outputs the class and not the whole window. |
That's just it.. I'm -not- exporting the Entire package/window.. I am right-clicking on the CLASS folder and exporting it. I've also tried this by going to Edit->Export to XML. The XML I showed you is what I get for exporting -only the class folder- This is also the same process I walked my gal at home through. I guarantee you we are both doing it correctly. This also doesn't even take into consideration the fact that my second post also describes that Export selection to XML on a class within a class is even more broken than just trying to do it on a class folder within a normal window.
Quote: |
The reason you get a duplicate when you export the entire window because you are exporting the "Untitled" window. The "Untitled" window is recreated each time you run CMUD and is assigned a new unique identifier (thats the UID field show in your XML export). When the UID field doesn't match anything in your settings, then a new window/module is created. Since CMUD assigns a new UID to the Untitled window each time you run it, then this is going to happen. |
I've tried this within MUD sessions as well and get the same exact result as above. I will try it again to confirm. --- Confirmed. I just created a new class in the session for my own MUD to hold my macro keys and this is what I get in the exported XML file:
Code: |
<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
<window name="MSAOozora" usesession="false">
<uid>{442AC464-2837-4298-8E4D-E90F41DA34D3}</uid>
<packages>English Keypad|English Directions|MSAOozora</packages>
<class name="Test">
<macro key="KEY0">
<value>out</value>
</macro>
<macro key="MULT">
<value>p</value>
</macro>
<macro key="DIV">
<value>in</value>
</macro>
</class>
</window>
</cmud> |
So it's just as broken inside of a normal session as it is in an untitled session.
Also, if you'll notice, in my second post I -did- telly ou how I was exporting the data. The fact of the matter is that it's exporting the data wrong.
Quote: |
And the results are the same no matter if I right click and go to export as xml or if I go to Edit->Export selection as XML.
Seems to me like it's trying to Export All as if from the file menu when a class folder is selected and it's just not doing much of anything if a class folder within a class folder is selected. |
|
|
|
|
Nicodareus Wanderer
Joined: 24 Jun 2008 Posts: 68 Location: Texas
|
Posted: Wed Jul 02, 2008 12:55 am |
Here you go:
http://www.mediafire.com/?jtkngonnnjm
Watch that (Preferably in as big of a window as you can) to see my process. I know it has an ugly banner plastered across it, but you can still see what needs to be seen. (And I don't feel like paying 40 - 300 bucks for screen cap software right now.)
Here's another one I threw together real quick to show what happens when you try to save out a class folder stored inside another class folder:
http://www.mediafire.com/?ngoukgxd5nz |
|
|
|
Nicodareus Wanderer
Joined: 24 Jun 2008 Posts: 68 Location: Texas
|
Posted: Wed Jul 02, 2008 8:05 pm |
I've just tried my process on a 3rd computer now. Both of the same problems exist on it as well. It'd help if some other people running 2.29 would give it a try as well.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jul 02, 2008 8:10 pm |
Yes, in your second message you mentioned that you were right-clicking, but it wasn't perfectly clear what you were right-clicking on. From what you posted it looked like you were right-clicking the window instead of the class, and we have had enough terminology confusion that this wasn't clear.
But when I looked at the actual file being exported by right-clicking the Class and selecting Export Selection I was able to confirm the problem. There are two problems here that I have fixed for v2.30. The first problem was that exporting a class was actually exporting the entire window/module instead of just the class.
The other bug was that when importing it was sometimes getting confused as to whether to what module and class to import into. If you clicked on a class and then right-clicked a window/module and selected import, then it was importing the file into the class that was previously clicked on, causing some nested classes to be created. I think this bug was responsible for a lot of problems when importing XML. Hopefully 2.30 fixes all of these problems correctly. Thanks for your patience with this. |
|
|
|
Nicodareus Wanderer
Joined: 24 Jun 2008 Posts: 68 Location: Texas
|
Posted: Wed Jul 02, 2008 9:02 pm |
No problem. I'm just glad it's fixed. Like I said, it wasn't something I was too worried about personally, but I'm sure alot of people would like to be able to save out their class folders.
Personally I was just trying to prove that I wasn't a complete idiot :P |
|
|
|
|
|