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
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Dec 12, 2008 6:56 pm   

Variable List?
 
Is there a way to get all of the variables used in a package, class or sub-class? I reinstalled CMUD because of a pointing issue. I backed up the CMUD data files to keep all of my settings and then used those to overwrite the new ones. All of my settings and triggers are there for the DSL "general" package. But all of the individual sessions lost all of their data. Since the individual sessions have completely new packages it seems, I need to put the variables back in them that the triggers won't automatically create. I could go through and one by one see what variables I need. However, I was hoping there might be an easier way for CMUD to simply list the variables used in a package.

Edit: I opened the old package with the new and dragged everything over so it should be okay. But it would still be nice to know if there was a variable list.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Dec 12, 2008 7:56 pm   
 
There isn't any "simple" list. But if you go into the Package Editor and select the package tab that you want, then in the View menu, turn off the "Group by Class" option and then click on the Vars filter button on the left. This will show all variables no matter what subclass they are in (the subclass will be shown in the second column of the tree view). Now you can click on the first variable, then shift-click on the last variable to select all of them and then right-click and select Copy to copy all of them to the clipboard. This will copy all of the XML code into the clipboard, but you can paste this into another editor and clean it up to get a list of just the variable names.

Edit: Or, you can open a blank session, then go to the Package Editor and File/Open your package file. Then type #VAR on the command line to list all variables.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Fri Dec 12, 2008 8:38 pm   
 
Hrm, I don't think I was clear enough, sorry. I mean the variables referred to, by triggers an aliases and such. Since if my general package is fine, it will have it's variables anyways. What I want to know is what variables I need for the other package that are referred to by the general one. I'm thinking there problem isn't?

Edit: For future reference, how do I change where CMUD points to its data files?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Fri Dec 12, 2008 9:21 pm   
 
Oh, I see what you mean. No, there isn't any way to do that. It's actually a very difficult problem to solve in a scripting language like zScript that allows runtime execution (like via #EXEC) and indirect variable access. For example, you can do this:
Code:
a=b
#show @{@a}

and that actually displays the value of @b. So you can't even just search for @b references. That's why CMUD doesn't have any sort of "Rename variable" command. It's possible to do it in compiled languages (C, Delphi, etc), but very difficult in interpreted scripting languages.
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