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
Qaiia
Wanderer


Joined: 06 Apr 2007
Posts: 59

PostPosted: Mon Apr 30, 2007 2:52 pm   

[1.30] zMUD => cMUD script conversion for GSIV
 
I recently put together a suite of scripts for Simutronics' Gemstone IV (see here) and am in the process of porting them to cMUD so I can upgrade.

All of the scripts and gauges work (almost) properly, except two, my Compass and the Wound/Scar indicator.

I'll cover the compass first. This is the code:

Code:
#CLASS {compass};
#ALIAS ShowExits {#call %btnenable(northwest,%ismember(nw,%1));#call %btnenable(north,%ismember(n,%1));#call %btnenable(northeast,%ismember(ne,%1));#call %btnenable(west,%ismember(w,%1));#call %btnenable(east,%ismember(e,%1));#call %btnenable(southwest,%ismember(sw,%1));#call %btnenable(south,%ismember(s,%1));#call %btnenable(southeast,%ismember(se,%1));#call %btnenable(down,%ismember(d,%1));#call %btnenable(up,%ismember(u,%1));#call %btnenable(out,%ismember(out,%1))};
#TRIGGER {j} {ShowExits {%2};#var roomMoved 1} "" {gsl};
#BUTTON 14 {NW} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {northwest} {3};
#BUTTON 15 {N} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {north} {3};
#BUTTON 16 {NE} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {northeast} {3};
#BUTTON 17 {W} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {west} {2};
#BUTTON 18 {} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {} {} {Separ} {} "" {} {} {center} {2};
#BUTTON 19 {E} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {east} {2};
#BUTTON 20 {SW} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {southwest};
#BUTTON 21 {S} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {south};
#BUTTON 22 {SE} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {southeast};
#BUTTON 23 {U} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {up} {3};
#BUTTON 24 {O} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {out} {2};
#BUTTON 25 {D} {} {} {} {} {} {} {Size} {24} {14} {} {} {} {30} {} {Separ} {} "" {} {} {down};
#CLASS 0


Now, the compass code works somewhat properly upon first login (and I mean only the first login). All nonexistent room exits will cause their associated buttons to completely disappear (instead of just darken, like in zMUD), but the buttons cram to the left rather than retain their positions. I change rooms, and nonexistent exits cause more buttons to disappear. New exits do not cause the buttons to reappear, and all active buttons are skewed to the left rather than being in the pattern they retain in zMUD. I disabled compatibility mode on the ShowExits alias to no avail. Thoughts?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Apr 30, 2007 3:54 pm   
 
%btnenable was bugged - it's possible it still is. It won't turn a button back on once it's been turned off. The positioning thing is due to how CMUD handles disabled settings, I think.

So, that said, disabling the button probably isn't what you want to do in this situation. I'm not sure if multistate buttons can have different colours for different states, and if they'd work properly in this situation anyway. It's worth a look. If not, you could probably use %btncol to recreate the old dimming behaviour, and then have the button script check whether the exit is valid when it's clicked.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


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

PostPosted: Mon Apr 30, 2007 6:04 pm   
 
Yep, %btnenable is still bugged. It's on the bug list, but I'll bump up the priority a bit.
Reply with quote
Qaiia
Wanderer


Joined: 06 Apr 2007
Posts: 59

PostPosted: Mon Apr 30, 2007 8:39 pm   
 
Thanks, I'll take a look at %btncol, it looks like it will suit my needs just fine. Once I get this fixed, I'll move on to the Wound/Scar indicator.
_________________
Citrus: The Juicy Alternative
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