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
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Tue Apr 09, 2013 2:27 pm   

Question regarding variables and multiple sessions
 
Before I start, forgive my newbness :)

I'm playing a MUD that allows you to play 3 characters at once, and am working on a status line to display certain information about the other characters. As an example, I have a character named Pork, and am storing his current HP in the variable @porkhp based off a trigger from the MUD prompt. This works, but only in the Pork session. I try and #show @porkhp in the other sessions and nothing comes up. I know that I could have the trigger make the variable in another session, but that just seems messy. Is there a way to make @porkhp a variable that all sessions can call upon?

Hope that made sense.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Apr 09, 2013 9:11 pm   
 
Try using @//windowname/porkhp. In most cases, stuff inside a window cannot be seen by stuff that exists outside that window. If that doesn't work, your only other option is to move the variable out into a module.
_________________
EDIT: I didn't like my old signature
Reply with quote
skeen77
Novice


Joined: 25 Oct 2010
Posts: 31

PostPosted: Wed Apr 10, 2013 12:12 am   
 
MattLofton wrote:
Try using @//windowname/porkhp. In most cases, stuff inside a window cannot be seen by stuff that exists outside that window. If that doesn't work, your only other option is to move the variable out into a module.


Hmm.. I was thinking about moving it into a module (still a new concept to me), but was worried there was going to be issues because all 3 characters have the same prompt layout, so wouldn't there be problems with them all trying to define @porkhp ?
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