Global code overriding local code

happyturk2 Yet another stupid question. Starting to feel like a real idiot here. u_u

I added to the 'look' code in the global logic(90) to cover a few new inventory objects, and for some reason, the ('get','anyword') code in logic.90 is now overriding whatever code I may have in individual logics to handle picking up objects. IE, I get the response 'You can't get that here!' no matter what I'm trying to pick up, or where.

At first I thought it was a stupid mistake like not matching parentheses or something when I was adding to 90, but I went over it ten times and everything's in order.  The parser recognizes the words for the objects I'm trying to get, because other commands using those words work fine. It's very specifically that one command.

Of course, I'll probably figure it out ten seconds after I hit 'post'. That's usually how it works.

And, incidently... had to use a different name to post this under because despite the fact that I logged in, it's not recognizing it. Says that the name's in use by another member(I know! That's me! >_<) and says I can't edit my own profile. -_o  Off topic, but it's getting irritating.
sonneveld Have you tried putting that "get anyword" check right at the end of the global logic?  I thought it was meant to be a catch all.. ie, the logic code checks for all other instances before finally checking "get anyword"

The way the said command works is that it will keep on checking the combination of words until there's an actual proper match and then it just returns false for the remaining entries.  (it sets flag 4, said accept, as a check)

so if you check "get anyword" before anything else, then said will assume it's found a match and then return false for the remaining checks (even if they would match!)

that's hows sierra's games check for anything it doesn't understand.. it just checks for "said(anyword)" right after any other said evaluation.

- Nick
happyturk2 No, 'get anyword' is at the end of the global logic, and the specific code for, say, 'get book' is in the appropriate room's logic, in all cases. Correct me if I'm wrong here, but doesn't it call the room's logic first, then the debug logic if debug is on, and only -then- the global logic 90?

If that's the way it works(and it seems to be, based on logic.0) then it should stop when it gets to 'get book' or whathaveyou in the room's logic and never actually call logic 90.

And again, it's not isolated to any one specific room; the same behavior's being exhibited in every room where there's an object to be picked up.

This is why I'm confused; because it seems to a global problem caused by something more overreaching than any one room's individual logic, yet those individual logics are called before anything global should have any say in the matter.

So yeah. I'm officially baffled.
happyturk2 Correction: Of course it still calls logic 90, but the response should have been parsed, so anything in the if (isset(f2) && v9 == 0 && !isset(f4)) { } block should be passed over, including the 'get anyword'. Semantics, and the result is the same in this case as if it hadn't been called, but it was still a glaring error on my part to say that 90 wouldn't be called.

Either way, the problem remains. -_o
sonneveld so you're saying said ("get", "book") is matched, a get book message is printed and then said ("get", "anyword") is matched, so a get anyword message is printed?

- Nick
happyturk2 No, 'get book' isn't matched, which is the problem. It -should- be matched, the code is there, but it prints the 'get anyword' message instead and takes no action regarding inventory.

And there is no case in any of my get code bits where nothing is returned or printed; every if() has an else, every angle is covered. It should be returning -something- from the local code, but it's going directly to the global as if it hadn't found a match.

The words file is up to date, it understands the words themselves.

Bleh.
sonneveld hrmm.. have you tried just "anyword", "book"?
happyturk2 Not -quite- sure what you mean. If you mean have I put 'anyword' 'book' into the code to see if it would catch it, no, I haven't. But other commands regarding 'book' do work, IE, 'look' 'book'.  No other commands seem to be affected.
happyturk2 ....sigh.

Okay. Nevermind. All of the logics were compiled up to date, that was the first thing I tried when the problem first showed up, but for some reason, recompiling each individual room that was having the problem seems to have fixed it.

I have no idea why, and that bugs me.
sonneveld It's happened to me before too.  What we need is some way of storing the date of the compiled logic and then comparing it with the logic source.  That way, you could ask agi studio to compile all new sources.

The way it's normally done is to compile source into object files and then compare the date of the individual object files.  Unfortunately, agi studio just saves the compiled logics straight into volume resources..

what would be great is if agi studio compiled into sep. obj files or even just stored the date of the compiled object files into an ini file for comparison..

- Nick
sonneveld I've noticed a lot of problems people have are just save games not being compatible any more or files not being compiled..  maybe agi studio could have a warning.. "warning.. object file has been changed, detected save games might not work"

maybe

- nick
happyturk2 Actually, I wasn't using saved games anymore at this point. And what's really messed up is that I did recompile everything and it didn't work... then it did.

*problem*
*recompile everything*
*problem still there*
*come on board, tear hair out, analyze code*
*recompile again with nothing changed*
*problem gone*

-_o
sonneveld I know it's not a savegame problem.. just saying that it's one of several strange problems that newcomers shouldn't have to deal with.

- Nick
Joel Couldn't you do that, in theory, without having intermediate object files? I assume the modified date of the vol file will change when you compile...just compare the last modified dates of all the logic source files to the last modified date of the vol file and recompile as necessary.
Joel yeah, of course it would be a problem if you added a different kind of resource -- I guess it depends on when you do the check
sonneveld True and umm.. true. :)

I just thought we could make use of tools available like make, just get AGI Studio to produce a simple make file, and then make could determine which files to recompile.

- Nick
sonneveld btw happyturk, feel free to ask as many questions as you like.  Nobody will think you're an idiot.  We've all had problems while trying to create a game.

- Nick