ID:1929954
 
(See the best response by Kaiochao.)
Code:
CheckStats()
if(src.strength<=0)
if(src.strength==rand(0,1990))
src.strengthstat="Below Average"
if(src.strength==rand(1990,4990))
src.strengthstat="Average"
if(src.strength==rand(4990,11990))
src.strengthstat="Above Average"
if(src.strength==rand(11990,14990))
src.strengthstat= "High"
if(src.strength==rand(14990,15000))
src.strengthstat="Irresistable"
if(src.endurance<=0)
if(src.endurance==rand(0,1990))
src.endstat="Below Average"
if(src.endurance==rand(1990,4990))
src.endstat="Average"
if(src.endurance==rand(4990,11990))
src.endstat="Above Average"
if(src.endurance==rand(11990,14990))
src.endstat="High"
if(src.endurance==rand(14990,15000))
src.endstat="Irresistable"
if(src.resist<=0)
if(src.resist==rand(0,1990))
src.restat="Below Average"
if(src.resist==rand(1990,4990))
src.restat="Average"
if(src.resist==rand(4990,11990))
src.restat="Above Average"
if(src.resist==rand(11990,14990))
src.restat="High"
if(src.resist==rand(14990,999999))
src.restat="Irresistable"
if(src.willpower<=0)
if(src.willpower==rand(0,1990))
src.willpowerstat="Below Average"
if(src.willpower==rand(1990,4990))
src.willpowerstat="Average"
if(src.willpower==rand(4990,11990))
src.willpowerstat="Above Average"
if(src.willpower==rand(11990,14990))
src.willpowerstat="High"
if(src.willpower==rand(14990,9999999))
src.willpowerstat="Irresistable"
if(src.force<=0)
if(src.force==rand(0,1990))
src.forcestat="Below Average"
if(src.force==rand(1990,4990))
src.forcestat="Average"
if(src.force==rand(4990,11990))
src.forcestat="Above Average"
if(src.force==rand(11990,14990))
src.forcestat="High"
if(src.force==rand(14990,99999999))
src.forcestat="Irresistable"


Problem description:

Basically trying to make this code work in a way that it checks if the said stat is within ranges of 0,whatever and it labels their stat as "Average/Weak/High/etc"

I know rand isn't the right proc to use, but I tried ()(), but I see no change, also tried another method in just trying to check if said stat has a number higher than or less than 0.

Can someone help me fix this issue? Accepting all criticism, It's been too long that I've been coding this sloppy and in this old format. xD



It's suppose to all calculate to Below Average via Finish of Char Creation, but instead, on the statpanel they all read Negative(the default) as if nothing happens and each stat already starts off with 1.

Please help :)

mob
Stat()
..()
statpanel("Vitals")
if(statpanel("Vitals"))
stat(src,"[src] - [src.potential]")
stat(src,"[src]'s Age: [src.age]")
stat("")
stat("")
stat("Health: [FullNum(round(health),100)]%")
stat("Ki: [FullNum(round(ki),100)]%")
stat("Intelligence: [src.doclvl]+")
stat("")
stat("Willpower: [src.willpowerstat]")
stat("Strength: [src.strengthstat]")
stat("Endurance: [src.endstat]")
stat("Force: [src.forcestat]")
stat("Resistance: [src.restat]")
stat("")
Best response
Have you ever heard of inequalities?

A <b: A is less than B?
A > B: A is greater than B?
A <= B: less or equal
A >= B: greater or equal

Normally, if you want to check if a number N is between A and B (or equal to either), this would be the condition:
N >= A && N <= B
A <= N && N <= B // alternate form

In DM, you're given the "in-to" operator, which lets you shorten the above into a more readable form:
N in A to B

Also, the switch() control lets you check for ranges, like so:
switch(strength)
if(0 to 1990) strengthstat = "Below Average"
if(1990 to 4990) strengthstat = "Average"
if(//etc.

edit: sleep-posting
Your syntax for switch() is actually off.

switch(value)
if(1, 5) // 1 OR 5
if(1) // Just 1
if(1 to 5) // 1 to 5
Wow, switch has alot of uses that I am not aware about, and yeah I totally forgot about <= and < in DM, I figured that every inequality sign had to have an equal sign or it'd be "missing an expression".

But thanks man, really appreciate the help.
Actually, are there any up-to-date DM Guides that could help me understand things more ?
The F1 reference in Dream Maker (and the website) is up-to-date, and the actual language guide is pretty reliable for most things. Then there's the whole 'developer' section of the website.
Actual language guide? *Sips tea*.

Go on.
In response to HaxRp
o.o
Woah there.... might need an eye doctor after all these years.