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
acaykath
Wanderer


Joined: 03 Aug 2005
Posts: 84

PostPosted: Sat Jun 30, 2007 1:52 am   

Character Selection Trigger
 
I am attempting to make a trigger that will let me choose a character from a list and will automatically set the relavent variables for my scripts based on the character I choose as well as logging in automatically. It doesn't seem to fire...

Code:

Pattern:
By what name do you wish to be known~?
Code:
#VAR Actions "p:Select Character:|o:1|Acaykath|Vexatin|Chrysolite"
name=%pick Actions
@name


It compiles fine, but doesn't seem to fire, with or without the ~ before the ?
Reply with quote
Progonoi
Magician


Joined: 28 Jan 2007
Posts: 430

PostPosted: Sat Jun 30, 2007 2:12 am   
 
I think its

By what name do you wish to be known~?

#var Actions "p:Select Character:|o:1|Acaykath|Vexatin|Chrysolite"
%char=%pick Actions
%char

Imo you should use %char here instead but its late and I'm a bit drunk so I may be wrong :P


Prog
_________________
The Proud new owner of CMud.

--------------------------------
Intel Core i5-650 3,2GHz
4 DD3 RAM
GTX 460 768MB
Win 7 Home Premium 64x
--------------------------------
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sat Jun 30, 2007 2:12 am   
 
There are a couple of errors in your script you should be using %pick(@actions)


Try this *cmudifyied* paste it into your command line and hit enter

#TRIGGER "LogIn" {By what name do you wish to be known~?} {
$action="p:Select Character:|o:1|Acaykath|Vexatin|Chrysolite"
name=%pick($action)
#EXECUTE @name
} "" {prompt|nocr}
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Jun 30, 2007 2:27 am   
 
Prognoi is right, %char would be a much simpler way to do this. On the sessions menu, you can copy and then paste the session to create a copy of it. You can then change the character names in the session properties and use %char in your settings where it's needed.

Using this method, all your characters will use exactly the same packages. This may or may not be what you want - you may find it better to have separate packages for each character with character-specfic stuff in, and then one shared package that all the sessions have.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
acaykath
Wanderer


Joined: 03 Aug 2005
Posts: 84

PostPosted: Sat Jun 30, 2007 5:02 am   
 
Before I reinstalled windows, I actually had seperate packages, but I didn't know how to access a variablefrom across packages and without that, I couldn't run multiple characters at the same time, as well as some other functionality, which if mentioned would put my characters at risk of being hacked by anyone who knew how to exploit my command triggers :)

Parenthesis, and trigger on promt fixed it. Thanks :)
Reply with quote
Fang Xianfu
GURU


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

PostPosted: Sat Jun 30, 2007 11:16 am   
 
The way I would do this would be to have separate packages for each different session, and each session would be a specific character. Anything specific to that character would go in that character's packages.

I'd create another package containing a global module (if you click on the module, global is one of the options). This means that settings anywhere can see the contents of the module. Anything I wanted shared between characters would go in this module, and the package would be added to the list of packages for that session on the files tab of the edit session dialog.

The shared flag for the shared package would need to be off, I think. This means that each session would load its own instance of the package instead of all using the same memory. This is important if your shared package contains things that need to be preserved for each character while they're running (like hp etc) but don't need to save0 across sessions (like character name).

When CMUD looks for a variable, first it checks the current module or window. For triggers, this is the window that fired the trigger. For everything else, it's whatever contains the setting. After that it will search other modules (but not windows - windows are private) of the current package, and then global or external modules of another package. So as long as your shared module is global (it will be by default) and you don't have settings with the same name anywhere else, CMUD should be able to find it. Variable names (and some other setting names) turn blue in the package editor when that setting can see the respective variable, and double-clicking on the variable's name will take you to the variable or whatever that the setting sees.
_________________
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 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