I'm trying to figure out a way to allow the player to input something into a string and the string save that information. I don't think I've been successful as of yet.
Is the input string command what I should be working with to make this happen? If so, I must be using it wrong. This is what I got...
script,alminegate,begin
suspend player
show textbox (1191)
wait for textbox
clear string (4)
append number (4,135)
show textbox (1194)
wait (15)
advance text box
input string (5, 2)
if (string compare (4,5) == true) then (
show textbox (1193)
wait for textbox)
else (
show textbox (1)
wait for textbox)
clear string (5)
resume player
end
It's actually 3, sorry. I allowed only two to be entered briefly to test something and forgot to put it back to 3. Even with three it doesn't work for me though.
The problem is with stringcompare. It turns out that it return -1 (which is the value freebasic uses for 'true') instead of 1 which is the value of the 'true' constant. Get rid of the "== true". While this is a bug in stringcompare which I'll fix, in general writing "== true" is not a great idea, because it's pointless and there might be more commands with this problem.
If you're using numbers, you might be better off using "number from string." This command reads numbers the way that "input string" reads words, except that you're storing the number directly into a variable.
input string (4,3,true,false,195,175)
youranswer := number from string (4,-1)
if (youranswer==myanswer) then(
#eliminate the complicated middleman
)
end