|
skeen77 Novice
Joined: 25 Oct 2010 Posts: 31
|
Posted: 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. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
skeen77 Novice
Joined: 25 Oct 2010 Posts: 31
|
Posted: 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 ? |
|
|
|
|
|