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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Feb 11, 2007 6:51 am   

[1.24] #T+
 
If you have lots of settings with the same name and use the "#T- setting type" format to disable them, it works fine as long as there's not a class with the same name. If there's a class, the class will always be disabled or enabled no matter what the type is set to.
Reply with quote
cypren
Wanderer


Joined: 03 Nov 2000
Posts: 59

PostPosted: Sun Feb 11, 2007 6:58 am   
 
Confirmed.

It would be really helpful if we could use explicit path specifiers (i.e. the //Package/Class/Var format) to explicitly specify what it is we want to target with this command and many others (such as #ADDITEM). This becomes even more critical with the high probability of multiple packages with duplicate variable names being introduced through the package library.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Feb 11, 2007 7:20 am   
 
The idea I think is that packages should be self-contained - ideally, they shouldn't be referencing things that're outside the current package.

There are some situations where this isn't practical, though - for example, if you have a large number of preference variables that the user can change to modify, say, the verboseness of your script's output, your user will want a way of preserving these settings when new versions of your package are released. The easiest way to do this is by having a separate Config package that'll store all those preference variables and that won't be replaced when the user patches the script.

I was looking at alternatives to that method, though, since it's annoying, if not impossible to use without this syntax and I only really wanted my scripts to have one main package and then many optional packages, for simplicity. The best thing I've come across so far is using a structured file created by the #file command. It's not ideal because the only way for the script that's importing the file to know the number of records in the file is for the script that exports the file to record it in the file itself. It's a bit of a bugger really. I still reckon we need a %PackageIsLoaded function, too :(
Reply with quote
shalimar
GURU


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

PostPosted: Sun Feb 11, 2007 7:38 am   
 
Well.. i thought thats where the package dependancies ideas came from... there would be no need for one package to depend on another if they were fully contained. But i would expect packages that did have dependancies to list those other packages as a prerequisate.
_________________
Discord: Shalimarwildcat
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sun Feb 11, 2007 3:22 pm   
 
I posted this in another thread but it is relevant here as well.

Code:
#var test 0 _nodef {%title-%char/data}


This allows you to create a separate structure for each session WITHIN the current package.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Mon Feb 12, 2007 1:43 pm   
 
The problem I saw with #T+/- was that I had two class folders called "Update" in two separate packages. I was expecting that the #T+/- would enable/disable the Update in the current package, but I found that it toggled the folder in my -other- package instead.

The main reason I use #T- name trigger in my scripts is because it doesn't create a new class folder if the setting (usually an alarm) doesn't exist. The "trigger" type was the only type that worked for me in zMUD, too, meaning that other type strings had an adverse or no effect.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Feb 12, 2007 1:55 pm   
 
Oh, they work just fine as long as there's no class with the same name. "Event" and "module" even work too and they aren't documented.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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