Community

AGI Programming => Mega Tokyo AGI Archive => Topic started by: Joey on August 18, 2003, 03:03:20 PM

Title: strange problem
Post by: Joey on August 18, 2003, 03:03:20 PM
this is really messed up. in dq2, i used this code.

if (said("talk","man")) {
  print("hello.");
}

i have this somewhere below the draw(o0); command.
when i play the game and type talk man, it says i do not understand your request. i added the commands in the words.tok file. i dont know whats wrong. any ideas?
Title: Re:strange problem
Post by: Kon-Tiki on August 18, 2003, 03:06:24 PM
Check if it's between the f(5)-brackets or not. You've probably placed it a few lines too high.

-Kon-Tiki-
Title: Re:strange problem
Post by: Joey on August 18, 2003, 03:09:36 PM
ok ill look. but i placed it below the if (said("examine")) {
command, and the examine command works fine. ill look again though.
Title: Re:strange problem
Post by: Xqzzy Rcxmcq on August 18, 2003, 08:12:03 PM
Just wondering, do you have any ("talk","anyword")
arguments in that room's logic? If so, make sure that "talk","man" is ABOVE ("talk","anyword")
 
Title: Re:strange problem
Post by: Joey on August 19, 2003, 08:28:05 AM
i dont have that in my logic i dont think. im gonna look at it today and try and see whats wrong.
Title: Re:strange problem
Post by: Joey on August 19, 2003, 03:32:41 PM
hmmm, what i noticed is all commands in the logic wont work that have if(said("talk","word")) { or something like that. cause i did the if(said("talk","man")) { and that didnt work, then i also put in if(said("open","door")) { that also didnt work. when i tried each command, it said i do not understand your request. but if i keep it as a work like if(said("open door")) { it works. i dont get it. the words are in the words.tok file. whats wrong with it?
Title: Re:strange problem
Post by: Nick Sonneveld on August 19, 2003, 09:10:13 PM
yes but are "open" and "door" separate words in the dictionary?

- Nick
Title: Re:strange problem
Post by: Joey on August 21, 2003, 07:02:17 PM
i think so. talk and man are separate words in the words.tok file.
Title: Re:strange problem
Post by: Joel on August 21, 2003, 08:08:03 PM
well, if the words weren't in the words.tok file, the logic wouldn't compile.

Did you try putting the line

Code: [Select]
reset(input_parsed);
before the if statement that's not working and seeing if that makes a difference? that will at least tell you if there's another said test causing your new one to be ignored.

Also have you tried putting some output to the screen right before the said test (via display, I believe -- definitely don't use print cause if it works you'll have your work cut out for you exiting the game gracefully)? An incrementing variable might be nice (it would let you see that you are actually getting to that code every interpreter cycle).
Title: Re:strange problem
Post by: Joel on August 21, 2003, 08:10:03 PM
and, of course, when in doubt, go simple -- do these tests work in other logics? if you have a logic with nothing in it but these said tests, will it work then?
Title: Re:strange problem
Post by: Joey on August 22, 2003, 08:24:10 AM
i dont know what it is. whatever
if(said("word","word")) {

command i put in, when i type it in it says i dont understand your request and i tried having 2 below each other. ill mess with it a little later.
Title: Re:strange problem
Post by: Kon-Tiki on August 22, 2003, 08:53:07 AM
Check the placement of curly brackets. It's an easy thing to look over, but one wrongly-placed curly bracket can mess up the entire code. I really suggest checking the new.room-curly brackets. It feels like the problem's somewhere around there.

-Kon-Tiki-
Title: Re:strange problem
Post by: Joey on August 22, 2003, 07:46:26 PM
ok thanks kon tiki. i will look at that. and tomorrow i am going to try to get a majority of the game finished cause im gonna be home alone all day so it will be nice and quiet and no one will be telling me to get off the computer. so hopefully i wont get too many bugs and will be able to fix any i get.
Title: Re:strange problem
Post by: Joel on August 23, 2003, 01:12:26 AM
did you try what I suggested? those things will give you a better idea of what to look for and will hopefully save you some of the tedious time that you'll spend checking the matching of your curly braces.
Title: Re:strange problem
Post by: Joey on August 23, 2003, 09:08:37 AM
im gonna everything. im gonna get it fixed today.
Title: Re:strange problem
Post by: Joey on August 23, 2003, 07:20:51 PM
maybe it would be easier if I showed you the logic  :P. here. i attached it.
Title: Re:strange problem
Post by: Joel on August 23, 2003, 08:56:02 PM
there's nothing wrong with that code that I can find. I created a blank game from the template game and pasted that code as a new logic in that game, then added all the appropriate words, and it worked fine.

so, do this:

Code: [Select]
if (said("examine")) {
  print("There is a man at the ticket counter, and a door that reads "
        "'bathroom'. Hey, is that shit on the ground near the bathroom door?");
}

// don't know the number off the top of my head;
// you should use defines anyway
reset(input_parsed);

if (said("talk","man")) {
   print("Hello.");
}

and see if that changes anything.
Title: Re:strange problem
Post by: Joey on September 27, 2003, 05:55:05 PM
GRRR! this did not work either! how come in other games they dont need that command? and where exactly do i put the command? i tried putting it in numerous places and it wont work. i dont know whats wrong. and what about those numbers you were talking and the defines thing? i have #include defines.txt at the top and thats it. i dont know whats up here.
Title: Re:strange problem
Post by: Eigen on September 28, 2003, 10:09:46 AM
Joey, try putting the logic you attached into a new fresh game and see if it works. If it works then you know something in some other logic causes this.

Or maybe you've edited something in logic.000 or logic.090


-Eigen
Title: Re:strange problem
Post by: Joey on September 28, 2003, 02:14:52 PM
well if it worked with joel, it would work if i created a new game, so it must be something in a logic file. any ideas?
Title: Re:strange problem
Post by: Andrew_Baker on September 29, 2003, 08:33:37 PM
Yeah, check your other logics like Logic.000 to see if they are calling any logics that are parsing your commands before your current room logic is.  And I can't stress enough that you add some debug logic into your rooms, so by going into debug mode, you'll get a display of what's going on.
Title: Re:strange problem
Post by: Joey on September 30, 2003, 01:39:37 PM
im not so sure what you mean. what do you mean by see if other logics are parsing?
Title: Re:strange problem
Post by: Joel on September 30, 2003, 07:04:14 PM
Joey, would you mind sending me the game with full source? Of course, under the promise that I'll delete the entire thing immediately once I'm finished looking for your problem and that I won't release it to anyone else.

And do rebuild your vol files if you decide to do that, and let me know you've done it here, because I probably won't check the e-mail I've got listed here unless I know it's coming.

If you do that, I'll try to figure out exactly what's causing the bug.