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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Gregorius
Beginner


Joined: 12 Nov 2006
Posts: 16

PostPosted: Sun Nov 26, 2006 8:44 pm   

[1.16] Variables in status window
 
I still dont see the variables work in the status window the way they worked in zmud. If I use the editor, it displays only @variable there and does not show the value of the variable. If I however use the #stwin command, the window shows the value, but if the variable changes, it does not update.

In zmud it was really easy and nice to just put the @hp in there and see the variable update itself inside the status window.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon Nov 27, 2006 8:02 pm   
 
Works fine for me here. What syntax are you using to set the status window? Here is what I just tested that worked fine:
Code:
hp=123
#STWIN {hp: @hp}
-- displays "hp: 123" in the status window
hp=456
-- now displayed "hp: 456" in the status window
Reply with quote
Gregorius
Beginner


Joined: 12 Nov 2006
Posts: 16

PostPosted: Wed Nov 29, 2006 5:38 pm   
 
Just updated to 1.17.

I am using package editor in making the status window. It is the easiest way for me at least.
I have a trigger on prompt, which is on pattern
"id1 (%d) (%d) ... (%d)" with all necessary information i want to see in my status window.
This trigger makes the variables @hp @maxhp and so on.
The variables don't get expanded in the status window. The variables get their right values though, because
status bar is working all fine.

Might be important: Status window in the package editor. When clicking on 'compiled code' gives 'Error compiling script:
syntax error'
All I have in the status window is @hp, which is displayed as '@hp'.

Also tried with a clean install 1.17.
Am I missing something or what?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Nov 29, 2006 6:21 pm   
 
Not sure what to suggest. Here is what I did:

1) Run CMUD and close the Sessions window
2) Click the Settings button to open the settings editor
3) Select New/Statusbar
4) Enter @hp into the value field
5) Checked the "Show in window" option, and unchecked the "Show in status bar" option
6) Clicked Save Changes. Closed the settings editor
7) Opened the Status window and clicked the pin icon to make it stick and not autohide
-- at this point the status window was blank
8) Typed: hp=123
-- now the status window showed "123"

Try this on your system and see if it works. If this works, but it doesn't work with your session, then there is some other problem with your session files.
Reply with quote
Gregorius
Beginner


Joined: 12 Nov 2006
Posts: 16

PostPosted: Thu Nov 30, 2006 1:15 am   
 
Yes. Looks like the status window is working fine...
I found the problem:
When I have a line with plain text in the status window, it doesn't work.
For example I put following lines in the editor to the window:

Spellpoints:
@sp


Gives exactly the same. With no amount of sp, just @sp.

However:

SP: @sp

works fine...

Should there be a somekind of % or whatever to make it work with just plain text in the status window?

Also important thing to make work in the coming public release: Buttons! Multistatebuttons are wonderful if they work correctly :)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Nov 30, 2006 1:29 am   
 
Buttons are on the priority list for the public release.

And yes, there is currently a bug with line breaks in status windows that is probably causing this problem. That's for looking into it a bit more and posting this information.
Reply with quote
Gregorius
Beginner


Joined: 12 Nov 2006
Posts: 16

PostPosted: Thu Nov 30, 2006 1:55 am   
 
Further:

Following also ruins up the stat win:

@hp/@maxp
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Nov 30, 2006 3:06 am   
 
Well yes, because that's ambiguous. Do you want to display the result of dividing @hp by @maxhp? Or do you want to display "/" as a text string? In CMUD you have to be a lot more careful to put quotes around literal strings, or to put {} around strings where you want the variables expanded, or () around expressions you want evaluated.

So if you want the result of the division, then you would use (@hp/@maxhp). If you want to display "/" as a string, then it would be @hp"/"@maxhp or {@hp/@maxhp}
Reply with quote
Gregorius
Beginner


Joined: 12 Nov 2006
Posts: 16

PostPosted: Thu Nov 30, 2006 12:06 pm   
 
I want to display / as a text string.

Following happens with the suggestions you gave:
If status window is set to (@hp/@maxhp), I don't get any result for division, just displayed (1775/1775). With { } does the same.
The problem comes only when adding more lines to the window.

Summing up:


@hp/@maxhp

-Works fine

@hp/@maxhp
@sp/@maxhp

-Doesn't work anymore.

Also something I found out: blank entries in the status window do also matter.

HP: @hp/maxhp

-works as intended. However if I put a blank line (represented as a "_" now) following happens:

HP: @hp/@maxhp
_

-works so far (just a blank line after the thing)

HP: @hp/@maxhp
_
_

-doesn't work anymore with two empty lines in there

My original status bar had some blank lines (just for the looks) and plain text lines, such as "Enchants:" and variables under them.
Thanks for looking into this Zugg.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Nov 30, 2006 5:59 pm   
 
Ahh, OK, well, I had already mentioned that there is a known problem with newlines in the status window, so this is all related to that same problem. Anything that is multiline is going to have this trouble until it is fixed. You need to try and use %cr for line breaks.
Reply with quote
Taz
GURU


Joined: 28 Sep 2000
Posts: 1395
Location: United Kingdom

PostPosted: Thu Nov 30, 2006 10:28 pm   
 
Gregorius: For now paste the following into your status bar contents:

HP: @hp"/"@maxhp%{crlf}%{crlf}SP: @sp"/"@maxsp%{crlf}

tested and working in 1.16 that's assuming you wanted the values and not a division.
_________________
Taz :)
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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