string and variable snags
endymion
07 Feb 2004, 08:58Im not a coding genius so maybe this one is obvious and im just not seeing it...if someone could lend a hand i'd appreciate it...
Im trying to set up a question/answer stage at the start of the game where i ask the user for class, race, and gender, and then determine their max hp and max mana and stuff before the game starts. Im having a problem with the strings for that. I had used command-set string variable cos thats what the help file says to use, but it gives me an error that says 'runtime error 35601, element not found'...am i doing something wrong with the string ? the variable name is 'class' and the variable itself is 'player.class'...
Im trying to set up a question/answer stage at the start of the game where i ask the user for class, race, and gender, and then determine their max hp and max mana and stuff before the game starts. Im having a problem with the strings for that. I had used command-set string variable cos thats what the help file says to use, but it gives me an error that says 'runtime error 35601, element not found'...am i doing something wrong with the string ? the variable name is 'class' and the variable itself is 'player.class'...
Farvardin
07 Feb 2004, 09:23maybe you could look for the source code of this game :
http://www.axeuk.com/cgi-bin/review.cgi?game=magic
I think at the begining it's doing what you're looking for...
http://www.axeuk.com/cgi-bin/review.cgi?game=magic
I think at the begining it's doing what you're looking for...
Anonymous
07 Feb 2004, 09:51
am i doing something wrong with the string ? the variable name is 'class' and the variable itself is 'player.class'...
Sounsd to me like you are trying to use dot notation (as you would in Visual Basic to set/read a property for instance) you can't do that in Quest.
You can declare a variable in quest by setting it to an initial value...
set string <PlayerClass;string here>
and to alter it you use EXACTLY the same statement - except the 'string' part is optional/..
set string <PlayerClass;string here>
or
set <PlayerClass;string here>
are both acceptable to alter a string variable.
But I think you're attempting to make a string a property of an object-to do that in Quest you would use in your object definition something like...
define object <dragon>
properties <name=Puff>
end define
you may then access this by reading the property not with 'dragon.name' -(which I THINK is what you are trying to do with your use of 'player.class' above) but with the Quest syntax '#dragon:name#' -the hashes are obligatory to read a string property.
Hope this helps
Al (MaDbRiT)
endymion
07 Feb 2004, 10:35OK i went ahead and changed all the whatever.something to dotless versions...now im getting an error message that says "cannot open (mygamename) too many }"...does this have something to do with the change?
Anonymous
07 Feb 2004, 13:40
OK i went ahead and changed all the whatever.something to dotless versions...now im getting an error message that says "cannot open (mygamename) too many }"...does this have something to do with the change?
Certainly shouldn't have anything to do with changing your variables to an acceptable syntax as such, though it is quite possibly a typing error made while making the changes.
Usually getting this error means you literally have more closing brackets than opening ones in your code - i.e. one (or more) } doesn't have a matching {, but this error was sometimes thrown up by a bug in QDK in the past. if you are using QDK which version do you have?
If you can't solve the problem yourself, e-mail your .asl file to me I'll see if I can spot/fix the problem for you.
Al (MaDbRiT)
endymion
07 Feb 2004, 14:36I fixed the problem...i had a bunch of open items in my various menus with nothing filling them. I just wrote them on paper and deleted them till I needed to fill them in...seemed to fix the problem.
Now the problem im running into is getting messages to go to the help box...i guess the help box doesnt normally show up during the game? I don't want to give away too much of what im trying to do but is there a way to make messages in the help menu show up during the game using the send "text" to help menu command?
Now the problem im running into is getting messages to go to the help box...i guess the help box doesnt normally show up during the game? I don't want to give away too much of what im trying to do but is there a way to make messages in the help menu show up during the game using the send "text" to help menu command?