Re: Riddle Script
I'm putting a riddle in my D-MOD, and I need help with a riddle script. Preferably the same way as in Initiation (not PQ, waaaaay too hard). I've looked through those riddle scripts, but I have no idea how it's done. Can someone explain to me how I can make one like that?
I've looked into the riddle script from initiation (L5ridd2.c)
You should be able to keep most of what's there. You can probably figure out what text to change to support your riddle easily. His consisted of 5 lines.
&rmsg1 = say_xy("`%I can be an important part of most meals,", 10, 90);
&rmsg2 = say_xy("`%though I definately don't add or take taste.", 10, 108);
&rmsg3 = say_xy("`%My shoeless feet are often bare,", 10, 126);
&rmsg4 = say_xy("`%though I usually have four.", 10, 144);
&rmsg5 = say_xy("`%What am I?", 10, 162);
After you change those there is only one more line you need to alter.
if (&trv == 9158765)
Everything in this if statement is what happens when you answer the riddle correctly. But how do you get 9158765 out of table???
He used a formula that you should use to find the numeric value of your answer. In this formula, for each letter (in order) you multiply the previous value by 26, then add the numeric value of the letter that was just inputted. Note that the variable started at 0.
T- 20
A- 1
B- 2
L- 12
E- 5
T
(0 * 26) + 20 = 20
A
(20 * 26) + 1 = 521
B
(521 * 26) + 2 = 13548
L
(13548 * 26) + 12 = 352260
E
(352260 * 26) + 5 = 9158765
Besides what happens when you get the riddle right and some of the other extras put in (like it being destroyable by bombs,) that's pretty much all you need to modify.
You should be able to keep most of what's there. You can probably figure out what text to change to support your riddle easily. His consisted of 5 lines.
&rmsg1 = say_xy("`%I can be an important part of most meals,", 10, 90);
&rmsg2 = say_xy("`%though I definately don't add or take taste.", 10, 108);
&rmsg3 = say_xy("`%My shoeless feet are often bare,", 10, 126);
&rmsg4 = say_xy("`%though I usually have four.", 10, 144);
&rmsg5 = say_xy("`%What am I?", 10, 162);
After you change those there is only one more line you need to alter.
if (&trv == 9158765)
Everything in this if statement is what happens when you answer the riddle correctly. But how do you get 9158765 out of table???
He used a formula that you should use to find the numeric value of your answer. In this formula, for each letter (in order) you multiply the previous value by 26, then add the numeric value of the letter that was just inputted. Note that the variable started at 0.
T- 20
A- 1
B- 2
L- 12
E- 5
T
(0 * 26) + 20 = 20
A
(20 * 26) + 1 = 521
B
(521 * 26) + 2 = 13548
L
(13548 * 26) + 12 = 352260
E
(352260 * 26) + 5 = 9158765
Besides what happens when you get the riddle right and some of the other extras put in (like it being destroyable by bombs,) that's pretty much all you need to modify.
Awesome! Thanks, Rabidwolf! You're the best! Your name is going the credits more times than 1!
