i need the know how... to script a stat roller

Posted by Silence on Tue 03 Apr 2007 08:49 PM — 14 posts, 39,752 views.

#0
i cant grasp the concept of scripting yet and i need a stat roller to roll decent stats... heres the approach i took

Your roll: 9, 16, 17, 13, 18, 8

is what you get when you roll, 18 being max 1 being min
i need to write something to where i dont except anything under 17 because sitting and typin reroll for hours aint my thing...

so i grabbed that expression and put it into a trigger like so

Your roll: %1, %2, %3, %4, %5, %6

with the output as

if %1 < 17 and
if %2 < 17 and
so on and so forth
then
reroll
else if
PUT IN YOUR STATS NOW

and obviously this doesnt work... so can i get some help?
USA #1
There has been post after post about stat rollers; I'd suggest searching the forum for more information. You're very likely to find exactly what you want.
#2
i found something and now my trigger looks like this....

trigger> Your roll: *, *, *, *, *, *

output> if (%1 + %2 + %3 + %4 + %5 + %6) > 105 then
Send "Y"
else
Send "reroll"
end if

i think it worked once and nvr again so can i get some help?
#3
ok i changed it again now the output looks like this...

if (%1 + %2 + %3 + %4 + %5 + %6) < 105 then
Send "reroll"
else
Send "assign stats"
end if


and i still have to type reroll randomly some times the trigger will work once sometimes it will work like its supposed to and sometimes it doesnt work at all... what am i missin?
Australia Forum Administrator #4
Quote:

... sitting and typin reroll for hours aint my thing


Perhaps you should lower the threshold a bit? You don't mind the computer sitting and rerolling for hours, I take it? What about lag on the game as your client tries 10 million times to get those fantastic stats?

Anyway, to find why it doesn't work you would need to post your exact trigger, and the exact output you got from the MUD, which did not cause it to fire.
#5
Everyone else in the mud has these stats and they all use rollers...

<triggers>
<trigger
custom_colour="2"
enabled="y"
keep_evaluating="y"
match="Your roll: *, *, *, *, *, *"
send_to="12"
sequence="100"
>
<send>if (%1 + %2 + %3 + %4 + %5 + %6) &lt; 105 then
Send "reroll"
else
Send "assign"
end if</send>
</trigger>
</triggers>

theres the trigger the assign part is just to let me know that its hit the right dice. and as far as output from the mud its just random sets of numbers that as far as i can tell r lower than 105 but only certain ones set off the trigger heres a few that set it off

Your roll: 9, 15, 13, 16, 11, 13
Your roll: 9, 13, 12, 14, 8, 8
Your roll: 8, 12, 15, 18, 13, 15

now heres a few that didnt

Your roll: 12, 8, 14, 8, 15, 9
Your roll: 11, 13, 9, 10, 15, 16
Your roll: 18, 18, 10, 17, 14, 12

and now lookin at the numbers it seems to only be triggerd when the first number is lower than 10 but that could be coincidence.
#6
after a few more tests i see that it does only go off when the first variable is under 10 but i dont know why or how to change this. so can i get a bit more help?

===========================================================

I also tried this trigger

<triggers>
<trigger
custom_colour="2"
enabled="y"
match="Your roll: *, *, *, *, *, *"
send_to="12"
sequence="100"
>
<send>if %1 &lt; 17 and
%2 &lt; 17 and
%3 &lt; 17 and
%4 &lt; 17 and
%5 &lt; 17 and
%6 &lt; 17 then
Send "reroll"
else
Send "assign"
end if</send>
</trigger>
</triggers>

which does nothing at all =/
Amended on Tue 03 Apr 2007 11:00 PM by Silence
Australia Forum Administrator #7
You are on the track. Looking at your actual post, you have 2 spaces here:


"Your roll:  *, *, *, *, *, *"


Note 2 spaces after the colon?

Thus, only low rolls will match (eg. (space)9).

You need to make it:


"Your roll: *, *, *, *, *, *"
#8
IT WORKED!! haha thanks a lot man. im sure ill have a lot more questions in the future. but for now ta-ta =D
Australia Forum Administrator #9
Message to MUD admins - random stats are a bad idea

Quote:

Everyone else in the mud has these stats and they all use rollers ...


To everyone that operates a MUD with random initial stats - do you see why this isn't really working? If what Silence says is true, your players don't end up with random stats at all, they end up with 17, 17, 17, 17, 17, 17.

Now that's not random is it? What is worse, in order to get these "perfect" scores, they are wasting hours of CPU time, and pushing your network bandwith usage through the roof.

What I suggest you do is pre-allocate reasonable stats for new players, probably based on class. The whole idea, really, is to get "good" stats for your class, so that a mage might want lots of int, and a warrior lots of str.

So, simply have pre-defined tables, one per class. So if they choose a warrior you give them maybe +2 (from the base stat) on str, but -2 on int. Altogether, the total should add up to the same so no particular class is at a disadvantage.

The random system is basically unfair - it means casual players - those that don't use stat rollers - either get a low roll, through no fault of their own, or a high roll, although they have done nothing to deserve it.

Amended on Tue 03 Apr 2007 11:06 PM by Nick Gammon
#10
its the truth... i dont know if you have heard of Legends of Warcraft mud but Necrolyte the head admin and main coder there had the right idea for random stats... it was coded so that you can only have 3 email address's per ip and u only get 5 rerolls per acct... it seems harsh when tryin to create a new character but it gives everyone the same chance
USA #11
What I plan on in my MUD is not a stat roller, but you get a certain amount of points on creation that you can allocate to stats. And in the game, you are able to increase stats further.
USA #12
Random rollers are ok too, if they're based on a total number of points allocated randomly. Essentially you have the program randomly allocate the points. You still have the roller issue but it's less of a problem; still, the best thing is to do what Zeno suggested and to give everybody the same number of points and let them figure it out. It's what's fairest.
USA #13
Personally, one of the few stat rollers I've ever liked has been for ZAngband. I'm not sure if Angband uses anything similar, since I've never played around with that. Pretty much it asks you to give a weight from 1-100 to each stat, and then it rolls x number of times, picking the one that comes closest to that spread. The weighting is important, since if you put 100 in each stat, it will try to make them even. This way, you'll at least get stats you're ok with, and no one winds up at the absolute maximum for every stat.