Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
XonDK
Apprentice


Joined: 01 Dec 2006
Posts: 178

PostPosted: Tue Jan 03, 2012 7:10 am   

Is there a way to import only part of a full export? [possible feature request?]
 
so I'm remaking my system.

and I have bits and pieces, laying around of my old system, but those bits and pieces contain things I'd rather not import mixed together with things I want imported.
So I was wondering is there a way for cmud to only take certain parts of an xml export document?


Last edited by XonDK on Tue Jan 03, 2012 2:49 pm; edited 1 time in total
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jan 03, 2012 2:13 pm   
 
Only by editing the XML document, which is not recommended. It is incredibly easy to mess up the XML that way. One lost or misplaced opening or closing tag will ruin it.
Reply with quote
XonDK
Apprentice


Joined: 01 Dec 2006
Posts: 178

PostPosted: Tue Jan 03, 2012 2:45 pm   
 
*nudge zugg* feature request....
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jan 04, 2012 1:17 pm   
 
How do you see this working? I'm having trouble imagining how you could specify what part you wanted to import without knowing what is in the package.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Wed Jan 04, 2012 2:23 pm   
 
I could see it being done by class... but if you have it all in a class, just shove that into a new package and export that.
_________________
Discord: Shalimarwildcat
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed Jan 04, 2012 6:01 pm   
 
I could see it displaying something like the tree in the settings editor, with a check mark beside each setting. I'm not sure what the point of this would be, though. It's no easier to uncheck certain settings during the import than to delete them after the import...
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Wed Jan 04, 2012 7:54 pm   
 
In order to have a tree-list, Cmud would effectively have to import the whole file anyway; all you would be doing is specifying which elements become active and get saved to the package file. I guess that would work, though. The biggest problem I can think of is that it would require a new state--"imported but not loaded". That might actually be interesting--it would let you examine the contents of a package or import file before deciding whether to fully load it. One current problem with sharing packages is that you can't examine the code without actually loading it, and potentially executing something you didn't want.
Reply with quote
XonDK
Apprentice


Joined: 01 Dec 2006
Posts: 178

PostPosted: Thu Jan 05, 2012 10:43 am   
 
sounds like a good idea Rahab.
Reply with quote
DraxDrax
Apprentice


Joined: 22 Mar 2009
Posts: 149

PostPosted: Thu Jan 05, 2012 9:03 pm   
 
Just import all of your settings while you are offline, then go through those settings and delete whatever you don't want.

Removing settings before they are installed isn't actually any easier than removing them after they've been installed.
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Thu Jan 05, 2012 10:48 pm   
 
that wont keep onLoad events from firing
_________________
Discord: Shalimarwildcat
Reply with quote
DraxDrax
Apprentice


Joined: 22 Mar 2009
Posts: 149

PostPosted: Thu Jan 05, 2012 11:10 pm   
 
shalimar wrote:
that wont keep onLoad events from firing


Yes, it will.

An onLoad event will fire when settings are first loaded from a package file (extension .pkg). They will not fire when settings are imported from an XML document (extension .xml).
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Thu Jan 05, 2012 11:55 pm   
 
I was thinking more of packages downloaded from the library, then imported ones.
After including it to your session, offline or not, any onLoad event would fire, unless there is the new state Rehab mentioned.
_________________
Discord: Shalimarwildcat
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Fri Jan 06, 2012 2:19 am   
 
Onload events won't fire if you use File -> View package instead of File -> Open.
Reply with quote
wrym
Magician


Joined: 06 Jul 2007
Posts: 349
Location: The big palace, My own lil world

PostPosted: Fri Jan 06, 2012 5:30 am   
 
I wouldn't recommend and don't my self download packages into my production sessions, it is a simple matter to create a new "test" session load a package look at it export/edit/save as and then use it in my own sessions.

Backtracking to the original question, you can in fact select several elements, ctrl+click and the right click and export selection to xml. As for editing the .xml files, I do realize initially it can be overwhelming, but I am unaware of any reason to completely avoid it. I have scripted many mini scripts in xml then imported them and exported edited, and imported an even larger number, and in a number of cases script suggestions have been posted in xml on the zuggsoft forums.

If you already have an xml package and you only want a little bit of it you can select and copy the complete element, start tag through the end tag copy it then paste it into the package editor. If you have selected an invalid or malformed chunk of code cmud will give you a nice error message and abort importing without screwing up your scripts.

As a final note there are several text editors that have xml/html highlighting that are of great benefit to new and experienced xml/html people, personally I use notepad++ and I forget which plugin does syntax checking and highlighting.
_________________
"To the engineer, all matter in the universe can be placed into one of two categories: (1) things that need to be fixed, and (2) things that will need to be fixed after you've had a few minutes to play with them" - Scott Adams, The Dilbert Principle
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
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

© 2009 Zugg Software. Hosted by Wolfpaw.net