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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
ToyMage
Apprentice


Joined: 01 Sep 2005
Posts: 120

PostPosted: Sun Aug 13, 2006 8:05 am   

Multiplay Variable
 
I'm current multiplaying.

And I'm using Variables, however I can't find a way to read variable off another session.

Session 1 - @Party1
Session 2 - @Party2

How do I read Session 2 @Party2 variable when I am in session 1?

#IF (@PARTY2=0) {xxx}
Reply with quote
shalimar
GURU


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

PostPosted: Sun Aug 13, 2006 8:39 am   
 
@sessionname.variablename
_________________
Discord: Shalimarwildcat
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Aug 13, 2006 8:41 am   
 
you prepend the window name to the variable, like this:

#if (@Session 2.party2 = 0) {xxx}

Only works on plain a=b variables and maybe stringlists. Datarecord variables are unable to take advantage of this due to zmud not supporting multiple levels of hierarchy (@window.variable.key) nor supporting the variable keyname syntax (@variable.@key).

Of course, I could be wrong about the data variables, but MAN, that'd be one funky piece of code...
_________________
EDIT: I didn't like my old signature
Reply with quote
Kiasyn
Apprentice


Joined: 05 Dec 2004
Posts: 196
Location: New Zealand

PostPosted: Sun Aug 13, 2006 8:54 pm   
 
data records actually do work!
_________________
Kiasyn
Owner of Legends of Drazon
Coder on Dark Legacy
Check out Talon, an easy IMC connection.
Reply with quote
ToyMage
Apprentice


Joined: 01 Sep 2005
Posts: 120

PostPosted: Sun Aug 20, 2006 7:45 am   
 
ooh okie...

I got a new problem... my Sesssion is also a variable...

Session1=Cleric
Session2=Warrior
Food=Chicken

it works when I type
@Cleric.Food

but it doesn't work when I type
@@Session1.Food.

The variable is not reflect i think
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Sun Aug 20, 2006 7:38 pm   
 
@{@{Session1}.Food}

You can use braces like that to specify the potion that should be looked at by the @.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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