|
Anonumos Exile Newbie
Joined: 05 May 2008 Posts: 6
|
Posted: Mon May 05, 2008 1:10 am
Inherited Settings (Classes, Packages, and Bears Oh My!) |
I'm having a problem figuring out, for sure, how to manage multiple packages. Or classes. Or modules. Come on, the documentation isn't very clear on this.
My situation:
I play on two different muds, but I have multiple characters on each. There's little point in duplicating triggers and aliases for each character on a server. For example, each mud should have a class for login triggers that is shared among the characters on that mud.
But it's not clear how I go about creating a Session for each character, and having Sessions from one mud or the other use a common "Login" package. When I tried, it seems that the Session is being called by the Login Package, not the other way around. You can see I'm very hazy about the dependency mapping that's going on here.
What I have so far:
As you can guess, Actaeon is the name of my character. I will have other characters, and they should each "call" the HarbingerLogin package. Do I have it set up right? Or am I completely lost? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon May 05, 2008 2:00 am |
No, you don't. Packages are represented in the package editor by tabs. In this case, you have two packages loaded - Actaeon and English Keypad. Which is strange actually, because if you have "show default packages" enabled, then both English Directions and English keypad should show, and if you have it off, neither should. So either the keypad is loaded twice, or directions isn't being loaded, and you'll want to sort that out.
Anyway. You have two packages loaded here, and you need three. You'll find "New Package" on the file menu, which'll create a new package and a new tab in the editor for it. Anything you want to share between characters should go in the global module that's in that package (one'll be created with the package). Then you add this new package to your other characters by rclicking on the session icon in the sessions dialogue (the one that pops up when CMUD starts) and, on the Package Files tab, clicking the green plus icon and finding the package. It'll then get added to the list to be loaded when that session starts.
However, having said all that, there're some things you won't want to share and, really, I think login triggers are one of those things. I assume you're using different sessions for each of your different characters, but even so, login triggers wouldn't be something I'd be comfortable having in a shared package. |
|
|
|
Anonumos Exile Newbie
Joined: 05 May 2008 Posts: 6
|
Posted: Mon May 05, 2008 3:01 am |
Fang Xianfu wrote: |
However, having said all that, there're some things you won't want to share and, really, I think login triggers are one of those things. I assume you're using different sessions for each of your different characters, but even so, login triggers wouldn't be something I'd be comfortable having in a shared package. |
I can see how that would be bad for security, but I am not including the name and password information in these triggers. They make use of the #CH and #PW commands.
The problem I have is that the second mud I play on is still in development. When we get around to changing the login text, I won't want to have to change it individually for each character I may have created. The name/password info is stored in the session. The patterns are not unique though. So I see no problem sharing just that part. |
|
|
|
Anonumos Exile Newbie
Joined: 05 May 2008 Posts: 6
|
Posted: Mon May 05, 2008 4:20 am |
Ok I've been playing around with it. I'm not sure I can explain what I want to do, but I'll try.
The first mud I play allows multi-linking in certain areas of the mud. So I generally have two players online there. Very often I will also be connected to the second mud with one character. So ideally I need to have 3 sessions, 2 of which are sharing one login package, while the third has its own login package. The two login packages are, of course, for each mud.
So right this moment I am connected with two character sessions on the one mud. This means I have two tabs in the main window. When I open the package editor, I can see 3 tabs there. One for each character, and one for the login package. The Login package is currently set to Publish Global. Not sure if that's how it is supposed to be.
I have not been able to figure out how to force the window sessions to use style settings from the login package. It seems to me that I could, but they don't inherit properly. I want to do this because the characters from one mud should have the same styles, and again I hate to have to change that for every character (I have 4 more characters to set up for this one mud).
Additionally I hope to have other packages shared between characters on a mud. Stuff like disarm, autoget, and some alias won't be unique. I'd like to centralize as much as possible. So far it's been difficult enough that I wonder if I'm going about it the right way.
What really really confuses me is that the sessions are also treated as packages. I have to keep telling new sessions not to use existing sessions as packages. That could get very hairy. Indeed, it seems to have caused some crashes already.
Also when I quit on character and wish to "unload" the package, I can't. It's still there as if the other sessions are going to use something from it. It's frustrating.
Any ideas how I really should do this? |
|
|
|
Anonumos Exile Newbie
Joined: 05 May 2008 Posts: 6
|
Posted: Mon May 05, 2008 4:27 am |
Oh dear, and now I tried loading the Keypad package to edit it. 1) It still didn't show up as a tab in the Package Editor (as is shown in the last screenshot above). 2) It now shows up twice in the Package Pulldown and the "enabled" packages list to the right. Also it showed up under one session. I wanted to change it for both sessions. This of course led to another crash.
Seriously? What am I doing wrong? |
|
|
|
gamma_ray Magician
Joined: 17 Apr 2005 Posts: 496
|
Posted: Mon May 05, 2008 12:39 pm |
To edit the keypad stuff, go to View > Show Default Settings. (And then remove the one you loaded, as it was already loaded when you loaded it.)
|
|
|
|
Anonumos Exile Newbie
Joined: 05 May 2008 Posts: 6
|
Posted: Mon May 05, 2008 2:16 pm |
gamma_ray wrote: |
To edit the keypad stuff, go to View > Show Default Settings. (And then remove the one you loaded, as it was already loaded when you loaded it.) |
Ahah! So how do I create more "Default Settings" packages like the keypad? Or is that another red herring for what I wish to do?
What I'm planning I guess, is a package for each character, which will hold the character's window and specialized alias/trigger sets. Then a "Mud Default" package that will hold common alias/trigger sets and display settings that all characters on that mud will use.
This may be my plan so far:
Code: |
|-(session) Actaeon on TME
| |-(window) Actaeon on TME
| |-(module) ActaeonsTriggers
|
|-(session) Anonumos on TME
| |-(window) Anonumos on TME
| |-(module) AnonumosTriggers
|
|-(package) TMEDefaults
| |-(module) Login - will handle sending #ch/#pw commands based on mud-specific trigger pattern
| |-(module) Combat - will handle auto-responses to trip, bash, disarm, etc
| |-(module) CombatGags - will handle gagging battle-spam
| |-(module) SpellBuff - will parse the affects screen and remember current buffs with durations
| |-(settings) WindowStyleDefaults - I'd like this but I can't see how it is done
|
There are several problems I need to solve.
- What options do I have to use to ensure that TMEDefaults is loaded when either of the Sessions load, and only once if both sessions are loaded?
- How do I go about making TMEDefaults load "silently" like the Keypad package does?
- How do I get the session windows to use style settings dictated by TMEDefaults?
It gets even more complicated when I wish to login my character on the other mud:
Code: |
|-(session) Actaeon on TME
| |-(window) Actaeon on TME
| |-(module) ActaeonsTriggers
|
|-(session) Anonumos on TME
| |-(window) Anonumos on TME
| |-(module) AnonumosTriggers
|
|-(package) TMEDefaults
| |-(module) Login - will handle sending #ch/#pw commands based on mud-specific trigger pattern
| |-(module) Combat - will handle auto-responses to trip, bash, disarm, etc
| |-(module) CombatGags - will handle gagging battle-spam
| |-(module) SpellBuff - will parse the affects screen and remember current buffs with durations
| |-(settings) WindowStyleDefaults - I'd like this but I can't see how it is done
|
|-(session) Anonumos on Genesis (yep, same character name, different mud)
| |-(window) Anonumos on Genesis
| |-(module) AnonumosTriggers
|
|-(package) GenesisDefaults
| |-(module) Login
| |-(module) Combat
| |-(module) CombatGags
| |-(module) SpellBuff
| |-(settings) WindowStyleDefaults
|
|
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon May 05, 2008 2:30 pm |
I don't think that window sessions can use style settings on an outside package. You'll have to change the style for each window separately.
Yes, Sessions are packages. They are just like other packages, really. The only difference is in how you use them.
Since I can't tell what you have put in the various packages, I can't tell whether you are doing it right. But it does look like you have successfully created two session packages and an external package. Yes, you should be able to have aliases and triggers like that in an external package which is shared by sessions. If you have multiple sessions using a package simultaneously, you will have to be careful to prevent one session changing variables and other things that the other session wants to use. I haven't actually tried running multiple sessions simultaneously so far, so I hope that others will be able to help more.
On the unloading part, I think you need to give a few more details. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon May 05, 2008 2:43 pm |
Anonumos Exile wrote: |
So ideally I need to have 3 sessions, 2 of which are sharing one login package, while the third has its own login package. The two login packages are, of course, for each mud. |
You seem to be misunderstanding - you should only ever need one login package for each MUD, because the only things the login package will contain are a trigger for #ch and a trigger for #pw, which will be the same for any character that connects to that MUD. So what are you doing that's different to that?
Anonumos Exile wrote: |
So right this moment I am connected with two character sessions on the one mud. This means I have two tabs in the main window. When I open the package editor, I can see 3 tabs there. One for each character, and one for the login package. The Login package is currently set to Publish Global. Not sure if that's how it is supposed to be. |
Yes. "Global" means that all other triggers and aliases and whatnot can find the things in that package. "Local" means that only ones in the same package as the module can. "External" means everything except the current package can.
Anonumos Exile wrote: |
I have not been able to figure out how to force the window sessions to use style settings from the login package. It seems to me that I could, but they don't inherit properly. I want to do this because the characters from one mud should have the same styles, and again I hate to have to change that for every character (I have 4 more characters to set up for this one mud). |
Afaik, there's not currently a way to force one package to inherit its preferences from another. Each window and module has its own preferences - so each window has its own individual styles, and as far as I remember, there's no way (as of yet) to force a window to get its style information from somewhere else.
Anonumos Exile wrote: |
Additionally I hope to have other packages shared between characters on a mud. Stuff like disarm, autoget, and some alias won't be unique. I'd like to centralize as much as possible. So far it's been difficult enough that I wonder if I'm going about it the right way. |
It's mainly difficult because it's a difficult concept to explain. Once you understand it, it's much easier.
Anonumos Exile wrote: |
What really really confuses me is that the sessions are also treated as packages. I have to keep telling new sessions not to use existing sessions as packages. That could get very hairy. Indeed, it seems to have caused some crashes already. |
You need to be very careful with your language when talking about packages (at least when talking to me about packages :P) because it's very easy to confuse. What do you mean, sessions are being used as packages? What are you doing to tell new sessions not to use existing sessions?
Anonumos Exile wrote: |
Also when I quit on character and wish to "unload" the package, I can't. It's still there as if the other sessions are going to use something from it. It's frustrating. |
Do you mean unload that character's package? Because there's no real reason to do that unless you have three megs of ram. You could try Close Session on the file menu, though.
Anonumos Exile wrote: |
Ahah! So how do I create more "Default Settings" packages like the keypad? Or is that another red herring for what I wish to do? |
You add more to the default list using the Packages tab of the Session section of the preferences. You can't specify "only for things connecting to this MUD", so if you put them there, they'll be global for every session, so it might not be what you want.
Also, you shouldn't edit the Keypad and Directions packages directly, because they'll be overwritten when you patch CMUD. You should make copies of them, remove the old ones from the default list, and add your new ones back on.
Anonumos Exile wrote: |
This may be my plan so far: |
One thing - anything that's a tab in the package editor is a package. You've labelled some of them sessions in your tree, and I understand that that was probably for clarity that you had two sessions open - but I just want to make sure you're not working under any false impressions.
Also, the XXXTriggers modules you have will need to either be local, so that they don't fire on text received by the other character, or you could just put the triggers in the "XXX on TME" window instead - windows are settings containers like modules, but things inside them are never visible anywhere else.
Anonumos Exile wrote: |
What options do I have to use to ensure that TMEDefaults is loaded when either of the Sessions load, and only once if both sessions are loaded? |
CMUD will actually do this for you. If you choose Package Preferences from the Edit menu, you'll see there's a checkbox Shared, which is checked by default. This indicates that a package is shared by multiple sessions that you're loading at the same time, and so it'll only be loaded into memory once. This isn't always what you want, though - if the package has variables like, say, hp or mana, the value is going to be different for each character. For things like that, you'll want to uncheck the Shared box so that each characters gets its own value.
Anonumos Exile wrote: |
How do I go about making TMEDefaults load "silently" like the Keypad package does? |
Not sure what you mean. Once you've added it to your session (either by opening it in the package editor or rclicking on the session icon in the sessions dialogue and choosing Edit Session - Package Files and pressing the green plus to add it to the package list for that session) it'll be loaded every time that session opens.
Anonumos Exile wrote: |
How do I get the session windows to use style settings dictated by TMEDefaults? |
This one I'm not sure about.
Anonumos Exile wrote: |
It gets even more complicated when I wish to login my character on the other mud: |
You should actually be able to do it that way just fine. Even if a package is marked as Shared, it's only available to sessions that've got it on their package list. So the sessions connecting to TME will be in their own bubble, with their own packages and a copy of TMEDefaults, and the Genesis session will only look for the GenesisDefaults package. |
|
|
|
Anonumos Exile Newbie
Joined: 05 May 2008 Posts: 6
|
Posted: Mon May 05, 2008 3:30 pm |
Ok, I think I understand what you've written Fang Xianfu. I'll have to reread it tonight when I get back to my cMud installation. Thanks!
I'm sure I'll have more questions tonight when I get back home, but this gives me a direction to go. |
|
|
|
Anaristos Sorcerer
Joined: 17 Jul 2007 Posts: 821 Location: California
|
Posted: Mon May 05, 2008 6:25 pm |
As I stated in another thread, when I moved my package to a new location and tried to load it, CMUD turned the default packages, English Directions and English Keypad into tabs.
|
|
_________________ Sic itur ad astra. |
|
|
|
|
|
|
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
|
|