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


Joined: 26 Dec 2001
Posts: 43
Location: USA

PostPosted: Sat May 18, 2002 9:42 pm   

Variables captured to settings of child window?
 
I'm trying to create a child window where my various gauges and other status type info will be displayed separately from my main window. I am having trouble getting the gauges/status bar above to update whenever the variables that are referenced change.

Do I need to add the same triggers to the INFO window that pick up the text in the main window that define the variables in question? Or is there some way to have the main window's triggers match the text, redefine the variables, then transfer those variable amounts to the INFO window?

An example of what I have now that doesn't seem to be working:

MAIN window trigger:
#trigger {^You have &defvar specific defenses}
(picks up the number of defenses I have and puts it into variable "defvar".)

When I check MAIN window variable list, it reports accurately that defvar=eleven or however many I have. But my status bar up in the INFO window doesn't update, nor does defvar appear in the variables up there.

Should I #cap the same trigger pattern up there in addition to the main trigger? Instead of the main trigger? Should I only try to #cap the variables generated by the main window?

Currently taking applications for the position of personal zmud advisor. ICQ 122945954
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat May 18, 2002 11:35 pm   
 
quote:

I'm trying to create a child window where my various gauges and other status type info will be displayed separately from my main window. I am having trouble getting the gauges/status bar above to update whenever the variables that are referenced change.

Do I need to add the same triggers to the INFO window that pick up the text in the main window that define the variables in question? Or is there some way to have the main window's triggers match the text, redefine the variables, then transfer those variable amounts to the INFO window?

An example of what I have now that doesn't seem to be working:

MAIN window trigger:
#trigger {^You have &defvar specific defenses}
(picks up the number of defenses I have and puts it into variable "defvar".)

When I check MAIN window variable list, it reports accurately that defvar=eleven or however many I have. But my status bar up in the INFO window doesn't update, nor does defvar appear in the variables up there.

Should I #cap the same trigger pattern up there in addition to the main trigger? Instead of the main trigger? Should I only try to #cap the variables generated by the main window?

Currently taking applications for the position of personal zmud advisor. ICQ 122945954



Your child windows are not privy to what the other windows are doing, so you need to send everything that gets updated to the correct window.

li'l shmoe of Dragon's Gate MUD
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Fri Jun 21, 2002 7:50 am   
 
quote:
Your child windows are not privy to what the other windows are doing, so you need to send everything that gets updated to the correct window.


how would this be done if we were wanting to timestamp tells in the child window from a trigger like this:

(%w) tells you '%2' -> #if (!%ismember( %1, @test_friends)) {#abort 1}
#if (%ismember( %1, @test_friends)) {
#cap friends_tells
}

were you suggesting %1 and %2 get turned into variables, using #say %1 tells you '%2' at %time, followed by #cap friends_tells ? thats the only way i can see any kind of solution right now, but that causes a loop error so obviously my thinking is wierd

Why oh WHY did I have pass door on...
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jun 21, 2002 11:39 am   
 
There are a number of ways to work it.. The first works for status bars and guages. That is to make them reference your main window. So you might have something like this #ST {Defense @{main.defvar}}. That still wont get updated until a variable in the info window is changed.
The next way is to use the focus character. That provides this in your info window "#ST {Defense @defvar}", and in your main window the trigger gets the line ":info:defvar=@{main.defvar}". This method is prefered as it produces easier script to debug.
To display lines of text similar to the performance of the status window you have to make an alias that first clears the window then echos what you want. You will of course have to use a technique like above to get the info into the info window. Then to display your alias would be something like "#ALIAS Display {#SHOW %e[2J;#ECHO @DisplayStuff}"

Hope that helps.
Reply with quote
seamer
Magician


Joined: 26 Feb 2001
Posts: 358
Location: Australia

PostPosted: Sat Jun 22, 2002 4:40 am   
 
ok, as to my earlier post, i finally got my question solved...for anyone curious, heres the commands i used in the trigger



#if (!%ismember( %1, @test_friends)) {#abort 1}
#if (%ismember( %1, @test_friends)) {
#say %1 sent a tell saying '%2' at %time
#cap friends_tells
#gag
}
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