About Us
Products
Purchase
Downloads
Support
Forums
Contact Us
Site
 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
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Wed Aug 26, 2009 6:11 am   

Buttons Disappear of top bar
 
This scripts is for Eternal Darkness. works but could be improved, the problem is that the button, keeps removing itself ,the class is not then not enable. No-idea why it just eludes me. Like some NPC I know.

CLASS {Trail} {enable}
#ALIAS tra {#VAR victim %1;#VAR tra 1;trail @victim}
#VAR tra {1}
#VAR victim {sutex}
#TRIGGER {^You're already in the same room!!} {#if @tra=1 {#bu 1;tra=0}}
#TRIGGER {A magical barrier blocks your way.} {#if @tra=1 {#bu 1;tra=0}}
#TRIGGER {Alas, you cannot go that way...} {#if @tra=1 {#bu 1;tra=0}}
#TRIGGER {You cannot figure it out you practice somemore.} {#IF @tra {trail @victim}}
#TRIGGER {You sense a trail (%w) from here!} {#IF @tra {%1} {#IF @tra {trail @victim}}
#TRIGGER {The %w seems to be closed.} {#if @tra=1 {#bu 1;tra=0}}
#KEY F1 {#bu 1}
#BUTTON 1 {Trail - Off} {#T+ trail;tra=1;#ec trail triggers - enabled} {Trail - On} {#T- trail;tra=0;#ec trail triggers - disabled} {} {1} {} {Size} {70} {20} {} {} {} {116} {47} {} {} "" {} {} {}
#CLASS 0

Also if you could look at this. layout of the ED prompt <4473hp 1337m 1058mv>. Been trying to get this script to work it but have to type GROUP in command line to get this read out which give Min/Max values.

Hit Points Mana Movement Align Exp needed Level
[ 3126/4470 ][ 1337/1715 ][ 1058/1058 ] [ -825] [ 2314867] [163 Th] Sutex

#CLASS {Health Folder} {enable}
#ALIAS myhps {#var currenthealth %1}
#ALIAS mymaxhps {#var maxhealth %1}
#VAR currenthealth {137562}
#VAR maxhealth {137562}
#TRIGGER {<%1hp} {#var myhps %1}
#TRIGGER {|hp: */%1 S} {#var mymaxhps %1}
#BUTTON 1 {} {get heal kit;quaff heal} {} {} {@currenthealth} {} {HEART} {Size} {170} {19} {Pos} {2} {1} {70} {} {Gauge||12|@maxhealth|@maxhealth/4|8} {} "" {Explore} {} {health} {2}
#CLASS 0


This also come be view by tying SCORE in command line..

Name: Sutex [163]
Guild: Kindred Race: TriKreen God: Morthorian
Hit Points: [3134 / 4470] Intelligence: [18] Age: [194]
Mana: [1361 / 1715] Wisdom: [15] Exp Needed: [ 2,314,867 ]
Movement: [1058 / 1058] Dexterity: [20] Total Exp: [ 205,627,133 ]
Alignment: [-825 ] Constitution: [19] Gold: [ 1000 ]
AC: [-231 ] Charisma: [ 7] Gold In Bank: [ 286,913,051 ]
Hitroll: [90 ] Strength: [19] Damroll: [139 ]
InvulPower: [0 ] SpellPower: [ 0]
Exp Bonus: [0 ] Haste: [ 0]
Quest Pts: [ 133 ]
Position: [standing ]
Mount: [nothing ]


This class of mud seems to have very limited scripts , which is why i put up so much detail so maybe other can see a solution. for ther Muds using this type of formatting .

Thanks first post!!.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Wed Aug 26, 2009 9:24 pm   
 
Quote:

#BUTTON 1 {Trail - Off} {#T+ trail;tra=1;#ec trail triggers - enabled} {Trail - On} {#T- trail;tra=0;#ec trail triggers - disabled} {} {1} {} {Size} {70} {20} {} {} {} {116} {47} {} {} "" {} {} {}


The problem is in the toggle-button code. It's contained in the Trail class, which gets turned off when you press the button to make the caption say "Trail - On". At this point, since the button is no longer enabled or is not in an enabled class, the button gets removed from the screen.

A simple fix is to move the button out of the class.
_________________
EDIT: I didn't like my old signature
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Thu Aug 27, 2009 1:27 am   
 
So that's the problem I thought i was be neat putting all of the code related to a class in the same folder. Thanks so much for for the help, would not have thought that was the problem.

The obvious next question is: If buttons have to stay out of their class folders what else has to remain outside their folders. Or is it just buttons
Thanks again.
_________________
Entropy rules
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Aug 27, 2009 4:27 am   
 
They don't have to. It's a matter of scoping. When you disable the Trail you are basically telling zMUD treat everything in this folder like it's off (or in a more extreme sense, like it did not exist). Since this includes the button, that's why the button disappears.

So to answer the question, you keep the things you always want on, outside of the class you disabling. You keep the things you sometimes want on, inside the class your disabling.
_________________
Asati di tempari!
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Thu Aug 27, 2009 4:48 am   
 
Ok thanks for that. i can see possibility.
_________________
Entropy rules
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Sep 04, 2009 7:47 pm   
 
Here the trigger for the Score. In the future its best to post in the forums so that other people may help faster than I may be able to, and others can search for similar solutions.

Code:
#CLASS {Score}
#TRIGGER {Name: (*) ~[(%d)~]} {
  Name = %1
  Stat = %2
  }
#COND {Guild: (%w) Race: (%w) God: (%w)} {
  Guild = %1
  Race = %2
  God = %3
  }
#COND {Hit Points: ~[(%d) / (%d)~] Intelligence: ~[(%d)~] Age: ~[(%d)~]} {
  HP = %1
  MxHP = %2
  Int = %3
  Age=%4
  }
#COND {Mana: ~[(%d) / (%d)~] Wisdom: ~[(%d)~] Exp Needed: ~[ (*) ~]} {
  MP=%1
  MxMP=%2
  Wis = %3
  ExpNeeded = %replace( %4, ', ', '')
  }
#COND {Movement: ~[(%d) / (%d)~] Dexterity: ~[(%d)~] Total Exp: ~[ (*) ~]} {
  Mv=%1
  MxMv=%2
  Dex=%3
  TotalXP = %replace( %4, ', ', '')
  }
#COND {Alignment: ~[(%n) ~] Constitution: ~[(%d)~] Gold: ~[ (%d) ~]} {
  Align=%1
  Con=%2
  Gold = %replace( %3, ', ', '')
  }
#COND {AC: ~[(%n) ~] Charisma: ~[ (%d)~] Gold In Bank: ~[ (*) ~]} {
  AC = %1
  Cha=%2
  Bank = %replace( %3, ', ', '')
  }
#COND {Hitroll: ~[(%d) ~] Strength: ~[(%d)~] Damroll: ~[(%d) ~]} {
  Hit=%1
  Str=%2
  Dam=%3
  }
#COND {InvulPower: ~[(%d) ~] SpellPower: ~[ (%d)~]} {
  InvulPower=%1
  SpellPower=%2
  }
#COND {Exp Bonus: ~[(%d) ~] Haste: ~[ (%d)~]} {
  XPBonus = %1
  Haste=%2
  }
#COND {Quest Pts: ~[ (%d) ~]} {QPts=%1}
#COND {Position: ~[(%w) ~]} {Position = %1}
#COND {Mount: ~[(*) ~] } {Mount=%1}
#CLASS 0
_________________
Asati di tempari!
Reply with quote
Sutex-Kindred
Apprentice


Joined: 26 Aug 2009
Posts: 141

PostPosted: Sat Sep 05, 2009 2:32 am   
 
Excellent. Thanks so much.
As to posting ; questions of a script mud/client related topic go in general discussion. Yes?
and of course finished work like the one you so kindly work out for me go in the Finished scripts section, which well be there now.

Cheers.
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