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


Joined: 01 Jul 2002
Posts: 3
Location: USA

PostPosted: Mon Oct 27, 2003 8:06 pm   

variable useage
 
I am writing a semi-automated auto-rolling script for a mud which pretty well obfuscuates the values for stats, so I translated the values back, and am trying to calculate against that. the actual meat of the script (everything besides setting variables to counteract the text for values stuff), and the output follow.

#EC @stat_str
#EC @stat_dex
#EC @stat_int
#EC @stat_wis
#EC @stat_con
#EC @stat_chr
#EC @stat prestat
stat = @stat_str + @stat_dex + @stat_wis + @stat_int + @stat_con + @stat_chr
#EC @stat poststat
#IF (@stat < 18) {n}
stat_str = 0
stat_con = 0
stat_dex = 0
stat_wis = 0
stat_chr = 0
stat_int = 0
stat = 0


STR : You have a well-defined, muscular physique.
2
DEX : You are nimble and flexible.
INT : You figure things out a little faster than most.
WIS : You have outstanding judgment--you are wise beyond your years.
2
CON : You never get sick and can run miles without tiring.
4
CHR : People enjoy your company.


Do these stats look satisfactory to you? [y/n]: 2
0
0
2
4
0
0 prestat
2 + 0 + 0 + 2 + 4 + 0 poststat
n

the problem I'm having here is I'm getting the actual math statement instead of an evaluated sum. Thanks in advance (And afterwards of course) to anyone who can tell me how I'm misusing the variable.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Mon Oct 27, 2003 11:59 pm   
 
Either use the %eval function, or the #MATH command.
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