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
miracle
Newbie


Joined: 23 Feb 2009
Posts: 4

PostPosted: Thu Feb 26, 2009 12:18 pm   

stat roller
 
this is how the stat roll screen looks like

Reroll!
STR : You have an average strength.
DEX : You are very nimble and have a natural talent for acrobatics.
INT : You're a few cards short of a full deck.
WIS : You usually make sound decisions.
CON : You are in good health.
CHR : You have an annoying personality.

Do these stats look satisfactory to you? [y/n]:


I like to ask for assistance to program a script which will detect the MAX stats for STR, DEX and CON. The description of these are STR : Your strength is amazing! and DEX : You could dodge sunlight! and CON : Illness is a foreign thing to you!

If that can be done, i am real glad.

cheers!
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Thu Feb 26, 2009 4:56 pm   
 
Ok, this code should do what you wish in a fairly trivial manner.

Code:
#CLASS {Reroll}
#TRIG {Reroll!} {#T+ StatCheck;#VAR RR_Total {0}}
#VAR RR_Total {0}
#CLASS {Reroll|StatCheck}
#TRIG {STR ~: Your strength is amazing!} {#ADD RR_Total 1}
#TRIG {DEX ~: You could dodge sunlight!} {#ADD RR_Total 1}
#TRIG {CON ~: Illness is a foreign thing to you!} {#ADD RR_Total 1}
#TRIG {Do these stats look satisfactory to you~? ~[y~/n~]~:} {#IF (@RR_Total > 2) {y} {n};#T- StatCheck}
#CLASS 0
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
miracle
Newbie


Joined: 23 Feb 2009
Posts: 4

PostPosted: Sun Mar 01, 2009 12:43 pm   stat roller - reply
 
Tried using your recommended script. It worked strangely. As triggered, it accept YES when the 3 conditions are fulfilled. But weirdly, there was another subsequent reroll and the reply was "NO" and subsequently the reply was "Your stats has been chosen". Seem like there's some kind of lag. U know why?

>>
Reroll!
STR : Your strength is amazing!
DEX : You could dodge sunlight!
INT : You have an average intelligence.
WIS : You usually make sound decisions.
CON : Illness is a foreign thing to you!
CHR : You have an annoying personality.


Do these stats look satisfactory to you? [y/n]:
y

Reroll!
STR : You have a well-defined, muscular physique.
DEX : You are nimble and flexible.
INT : You're a few cards short of a full deck.
WIS : You have outstanding judgment--you are wise beyond your years.
CON : You rarely get sick, and you heal quickly.
CHR : People enjoy your company.


Do these stats look satisfactory to you? [y/n]:
n

Your stats have been chosen. Now to which racial background do you belong?
Level Limits
# Race ma cl wa th dr mk ba so pa ra ps
0 ) Human 50 50 50 50 50 50 50 50 50 50 50
Reply with quote
miracle
Newbie


Joined: 23 Feb 2009
Posts: 4

PostPosted: Mon Mar 02, 2009 12:28 am   stat roller additional notes
 
hi,

allow me to explain myself clearly on the char creation menu as below:


The registry shows no adventurer by that name. Are you new? [y/n] y
So you are new to the Realms. Let us help you get started.
Do you want ANSI color codes? y

-= ANSI enabled =-

We are now generating your attributes...
STR : You have an average strength.
DEX : You have good balance.
INT : You are a brilliant and inventive thinker.
WIS : You have excellent judgment.
CON : You are in good health.
CHR : You are very popular and seem to have a silver tongue.

Do these stats look satisfactory to you? [y/n]:


At this point, when i input "n", the Reroll screen appears.

Do these stats look satisfactory to you? [y/n]: n

Reroll!
STR : You are slightly favored in tug-o-war games.
DEX : You are nimble and flexible.
INT : You are a bit of a slow learner.
WIS : You sometimes learn from your mistakes.
CON : You never get sick and can run miles without tiring.
CHR : People enjoy your company.

Do these stats look satisfactory to you? [y/n]:


Do the above sequence affect how the script functions itself? It seems to me that there was a lag in a keystroke between the system picked up the chosen stats, as mentioned in previous reply.

cheers.
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Mon Mar 02, 2009 1:35 am   
 
Honestly there shouldn't be. What MUD is this for and I'll log into it and try it myself, and debug it if needed.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Mon Mar 02, 2009 4:23 pm   
 
Ok, all that was needed was to make it a Prompt Trigger for the final trigger. Here is the adjusted work. Though I can't seem to get that in a roll, so I'm unable to test the yes answer ;)

Code:
#CLASS {Reroll}
#VAR RR_Total {0}
#TRIGGER {Reroll!} {
  #T+ StatCheck
  #VAR RR_Total {0}
  }
#CLASS 0
#CLASS {Reroll|StatCheck}
#TRIGGER {STR ~: Your strength is amazing!} {#ADD RR_Total 1}
#TRIGGER {DEX ~: You could dodge sunlight!} {#ADD RR_Total 1}
#TRIGGER {CON ~: Illness is a foreign thing to you!} {#ADD RR_Total 1}
#TRIGGER {Do these stats look satisfactory to you~? ~[y~/n~]~:} {
  #IF (@RR_Total > 2) {y} {n}
  #T- StatCheck
  } "" {nocr|prompt}
#CLASS 0
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Mon Mar 02, 2009 4:36 pm   
 
Ok, using a modified version of the trigger I got this:

Code:
Reroll!
STR : You have a well-defined, muscular physique.
DEX : You could dodge sunlight!
INT : You figure things out a little faster than most.
WIS : You usually make sound decisions.
CON : You are in good health.
CHR : People enjoy your company.


Do these stats look satisfactory to you? [y/n]: n


Reroll!
STR : You have a well-defined, muscular physique.
DEX : You are very nimble and have a natural talent for acrobatics.
INT : You have an average intelligence.
WIS : You have excellent judgment.
CON : You never get sick and can run miles without tiring.
CHR : People enjoy your company.


Do these stats look satisfactory to you? [y/n]: y


Your stats have been chosen.  Now to which racial background do you belong?
                                  Level Limits
#    Race            ma  cl  wa  th  dr  mk  ba  so  pa  ra  ps
0 )  Human           50  50  50  50  50  50  50  50  50  50  50
1 )  Moon Elf        50  30  20  50  50  20  0   50  40  50  40
2 )  Gold Elf        50  35  20  50  50  20  0   50  45  50  40
3 )  Wild Elf        30  35  40  50  50  20  0   30  40  50  40
4 )  Sea Elf         30  30  30  50  50  20  0   30  40  45  40
5 )  Half-Elven      30  35  35  50  35  30  0   30  50  50  40
6 )  Dwarven         0   50  50  35  0   0   0   0   45  30  25
7 )  Gnomish         50  50  30  40  0   0   0   50  0   0   30
8 )  Halfling        20  40  30  50  20  0   0   20  0   30  40
9 )  Half-Orc        0   30  45  50  0   0   45  0   0   0   0 
10)  Half-Ogre       0   30  50  0   0   0   45  0   0   0   0 
11)  Half-Giant      0   0   45  0   0   0   45  0   0   0   0 
12)  Dark Elf        50  50  35  35  10  0   0   50  0   20  40
13)  Orcish          0   30  50  50  0   0   40  0   0   0   0 
14)  Goblin          0   30  50  50  0   0   30  0   0   0   0 
15)  Trollish        0   35  50  35  0   0   45  0   0   0   0 
16)  Dark Dwarven    0   50  50  35  0   0   0   0   0   0   25
17)  Deep Gnomish    30  40  50  35  0   0   0   30  45  30  30
  ma=magic user, cl=cleric,  wa=warrior,th=thief, dr=druid,  mk=monk
  ba=barbarian,  so=sorcerer,pa=paladin,ra=ranger,ps=psionist
Your Race? (for races help type '?') :


Here is the modified version if you're interested. It allows for the 3 best messages I saw in each stat. I would honestly expand this to include all 5 stats and allow the top 3 messages in each stat and require all FIVE to be good ;)
Code:
#CLASS {Reroll}
#VAR RR_Total {3}
#TRIGGER {Reroll!} {
  #T+ StatCheck
  #VAR RR_Total {0}
  }
#CLASS 0
#CLASS {Reroll|StatCheck}
#TRIGGER {STR ~: {Your strength is amazing!|You have a well-defined, muscular physique.|You are slightly favored in tug-o-war games.}} {#ADD RR_Total 1}
#TRIGGER {DEX ~: {You could dodge sunlight!|You are very nimble and have a natural talent for acrobatics.|You are nimble and flexible.}} {#ADD RR_Total 1}
#TRIGGER {CON ~: {Illness is a foreign thing to you!|You never get sick and can run miles without tiring.|You rarely get sick, and you heal quickly.}} {#ADD RR_Total 1}
#TRIGGER {Do these stats look satisfactory to you~? ~[y~/n~]~:} {
  #IF (@RR_Total > 2) {y} {n}
  #T- StatCheck
  } "" {nocr|prompt}
#CLASS 0
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
miracle
Newbie


Joined: 23 Feb 2009
Posts: 4

PostPosted: Tue Mar 03, 2009 1:38 pm   stats roll for 5 attributes
 
hi, thanks for your great advice. I accept your suggestion.
I notice from your last post, you hv written #VAR RR_Total {3} instead of {0}. I wonder which is correct as well.

Ps see if the following script is written correctly.


#CLASS {Reroll}
#VAR RR_Total {0}
#TRIGGER {Reroll!} {
#T+ StatCheck
#VAR RR_Total {0}
}
#CLASS 0
#CLASS {Reroll|StatCheck}
#TRIGGER {DEX ~: {You could dodge sunlight!|You are very nimble and have a natural talent for acrobatics.}} {#ADD RR_Total 1}
#TRIGGER {INT ~: {Your intelligence rivals the ancients!|You are a brilliant and inventive thinker.}} {#ADD RR_Total 1}
#TRIGGER {WIS ~: {Your wisdom equals the sum of many lifetimes!|You have outstanding judgment--you are wise beyond your years.}} {#ADD RR_Total 1}
#TRIGGER {CON ~: {Illness is a foreign thing to you!}} {#ADD RR_Total 1}
#TRIGGER {STR ~: {Your strength is amazing!}} {#ADD RR_Total 1}
#TRIGGER {Do these stats look satisfactory to you~? ~[y~/n~]~:} {
#IF (@RR_Total > 4) {y} {n}
#T- StatCheck
} "" {nocr|prompt}
#CLASS 0
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Wed Mar 04, 2009 4:29 pm   
 
In my last post the value may be 3, but that doesn't matter since it is reset to 0 whenever the script is run. Other than that yes it looks fine, or will when you finish inputting your multiple choice for each stat ;)
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
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