what am I doing wrong?

darkgoddessnight
31 Oct 2006, 02:02
alright, so I am still working on character creation...long process, but I don't have much else to fill my time...and I am stuck. I am doing the hair now and I am trying to make it that if you are bald, that you don't go on to hair length...I mean, if you are bald your hair length is pretty obvious right? but it isn't working and I know I am doing something wrong.

Here is my code:

define procedure <aquarianhair1>
set string <choice[userid]; null>
set string <valid[userid]; null>
msg <What color is your hair? 1-$objectproperty(aquarian_hair1; total)$|n>
for <i; 1; $objectproperty(aquarian_hair1; total)$> msg <%i%. $objectproperty(aquarian_hair1; %i%)$|n>
enter <choice[userid]>
for <i; 1; $objectproperty(aquarian_hair1; total)$> {
if ( #choice[userid]# = %i% ) then set string <valid[userid]; true>
}
if ( #valid[userid]# <> true ) then {
msg <That is not a valid choice.|n>
do <aquarianhair1>
}
else {
property <player%userid%; haircolor=$objectproperty(aquarian_hair1; #choice[userid]#)$>
if property <player%userid%; haircolor=none> then do <aquarianeye1> else do <hairlength>
}
end define

define object <aquarian_hair1>
invisible
properties <1=white; 2=aqua blue; 3=azure blue; 4=blue gray; 5=blue green; 6=dark blue; 7=dark green; 8=deep

blue; 9=deep green; 10=gray green; 11=pale blue; 12=pale green; 13=sea green; 14=silvery blue; 15=silvery gray; 16=silver

green; 17=none; total=17>
end define

the problem is, it just keeps going on to hair length no matter what I do, I tried brackets, I tried %, I've tried everything! *starts pulling out her hair* pretty soon I am going to be bald myself lol

please help, thankyou
Shadow*

I think Im Dead
31 Oct 2006, 14:36
Your problem comes in the else section. You are setting the haircolor to a value, then checking if it isn't set and trying to do two different things accordingly. Change the code in your ELSE section to...

Then from the hairlength, move onto eyecolor and whatnot.


property <player%userid%; haircolor=$objectproperty(aquarian_hair1; #choice[userid]#)$>
do <hairlength>


darkgoddessnight
31 Oct 2006, 15:16
Thanks :D