Graphic Adventure Creator (GAC) programming

Discuss all aspects of programming here. From 8-bit through to modern architectures.
User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Graphic Adventure Creator (GAC) programming

Post by lurkio » Sun Jan 07, 2018 6:23 pm

Continuing a discussion about programming a text adventure game in Graphic Adventure Creator (GAC)...
Commodore wrote:In room 1, there is a blaster to collect. This is then needed in room 10 when confronted with a monster. I have been able to make the code work to kill the monster, but if the blaster was left in room 1, I want the protagonist to die, but I can't seem to achieve this. Any help greatly appreciated:

Code:

Local Conditions Room 10:

1. if ( VERB 16 and NOUN 9 ) MESS 20 WAIT END (inspect hatch, description given)

2. if ( VERB 30 and Noun 9 ) SET 11 MESS 21 WAIT END (Open Hatch, marker 11 set, monster loose)

3. if ( set? 11 and 9 in 1 ) mess 24 hold 1500 exit end (this is the line that does not work)

4. if ( set? 11 and carr 9 ) mess 23 wait end (will you use your blaster?)

5. if ( Verb 28 and noun 2 ) mess 25 wait end. (monster Dead)
Nothing obvious leaps out at me. Can you upload or PM me the actual game file?

:?:

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Sun Jan 07, 2018 6:37 pm

Thanks for such a quick reply Lurkio, yes this is a better location.

Now, if only I had listened to you a few months back and done all this on my PC using BEEB EM! Unfortunately, I have been using GAC on my real Model B, and saved it as a data file on my Smart SPI card thingy. As such, I don't have a clue which slot it inhabits.
If we could work it out I'd send it over no problem. Maybe easiest if I just send the whole thing over?

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Sun Jan 07, 2018 6:40 pm

Commodore wrote:Now, if only I had listened to you a few months back and done all this on my PC using BEEB EM! Unfortunately, I have been using GAC on my real Model B, and saved it as a data file on my Smart SPI card thingy. As such, I don't have a clue which slot it inhabits.
If we could work it out I'd send it over no problem. Maybe easiest if I just send the whole thing over?
When you say "the whole thing", do you mean the whole BEEB.MMB file? How big is it?

:?:

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Sun Jan 07, 2018 6:42 pm

Well I did mean that at first, but if I only sent the GAC part, hopefully, that should include my adventure?

Looks like it's slot 131 from our previous discussions. I'll just go and extract card out of my Beeb's nether regions!

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Sun Jan 07, 2018 6:47 pm

Commodore wrote:Well I did mean that at first, but if I only sent the GAC part, hopefully, that should include my adventure?
If you're still using the same BEEB.MMB file we were setting up here --
-- then it should be in slot 131.

:?:

Aha! Looks like we just crossed posts!

:roll:

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Sun Jan 07, 2018 6:59 pm

I think this should be it Lurkio.
Attachments
I2-r1.ssd
(58.25 KiB) Downloaded 14 times

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Sun Jan 07, 2018 7:15 pm

Commodore wrote:I think this should be it Lurkio.
Thanks. Got it.

Not yet sure why the snake doesn't kill, but I noticed another problem: the object numbers in your game don't match up with the noun numbers, which means you'll have to write GET (and DROP) conditions for every single takeable object in your game separately. This isn't ideal for you as a programmer! See the "GET AND DROP" section at the end of Appendix A in the manual for a better scheme.

Also, you shouldn't include the words "All but one hatch is closed tightly shut. One is ajar" in the description for Room 10 because that won't be true once the player has fully opened the hatch.

:idea:

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Sun Jan 07, 2018 7:24 pm

lurkio wrote:
Commodore wrote:I think this should be it Lurkio.
Thanks. Got it.

Not yet sure why the snake doesn't kill, but I noticed another problem: the object numbers in your game don't match up with the noun numbers, which means you'll have to write GET (and DROP) conditions for every single takeable object in your game separately. This isn't ideal for you as a programmer! See the "GET AND DROP" section at the end of Appendix A in the manual for a better scheme.

:idea:
Thanks Lurkio, glad you got it, and it seems to be working -well as much as it does work that is!

I thought I had probably mucked up with the objects and nouns as you mentioned, I'll certainly have a check of appendix A.
Out of all the 8 bit machines I've owned, it is the BEEB that has made me want to actual try some programming.

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Sun Jan 07, 2018 7:25 pm

Commodore wrote:Thanks Lurkio, glad you got it, and it seems to be working -well as much as it does work that is!
Also, you shouldn't include the words "All but one hatch is closed tightly shut. One is ajar" in the description for Room 10 because that won't be true once the player has fully opened the hatch.

:idea:

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Sun Jan 07, 2018 7:26 pm

lurkio wrote:
Commodore wrote:I think this should be it Lurkio.
Also, you shouldn't include the words "All but one hatch is closed tightly shut. One is ajar" in the description for Room 10 because that won't be true once the player has fully opened the hatch.

:idea:
I could maybe modify that by saying that they are all shut, but one has scorch marks around the outside. That should draw sufficient interest in it?
Ah, although then I suppose the same will be true, they won't all be shut. Is that what you meant?
So really a description should be as brief as possible, and then further description comes after Examine/inspect/look etc. If that's the case, in the ideal programming world, I would create two descriptions, one before it's opened, and one after it's been opened, just in case somebody goes back to look again? I can see that makes a beautiful end product, but that's some work!
I am keen to try and write as good a game as I possibly can, so all input is gratefully received.

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Sun Jan 07, 2018 8:25 pm

I don't actually think that IF ( 9 IN 1 ) is the correct way to implement this particular puzzle -- I think IF NOT (CARR 9) would probably be better -- but nevertheless the condition should still work as it is.

I've played around with your game file (B8) by trying to add new conditions (High, Low, and Local) that include IF ( 9 IN 1 ), but none of them work, even though they should.

So I think that either you've come across some obscure bug in GAC, or there's been some file corruption at some point along the way.

I don't really know what to suggest. I think the only solution might be to manually type in the whole game again! Or maybe Print all the data in the game to a file, using BeebEm, and then see if you can manually paste the lines of code back into GAC, one at a time. (Pasting into BeebEm is tricky though because BeebEm prepends a superfluous newline character to your text before it gets injected into the virtual Beeb..!)

But before you start doing any of the above, you should first start a new blank game, load in the QuickStart game file (QS), and create a simple two-room test game where you use the IF obj IN rm condition to print some short message (or whatever) -- just to make sure that IF obj IN rm really does work if you create a new game from scratch.

:(

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Sun Jan 07, 2018 8:37 pm

lurkio wrote:I don't actually think that IF ( 9 IN 1 ) is the correct way to implement this particular puzzle -- I think IF NOT (CARR 9) would probably be better -- but nevertheless the condition should still work as it is.

I've played around with your game file (B8) by trying to add new conditions (High, Low, and Local) that include IF ( 9 IN 1 ), but none of them work, even though they should.

So I think that either you've come across some obscure bug in GAC, or there's been some file corruption at some point along the way.

I don't really know what to suggest. I think the only solution might be to manually type in the whole game again! Or maybe Print all the data in the game to a file, using BeebEm, and then see if you can manually paste the lines of code back into GAC, one at a time. (Pasting into BeebEm is tricky though because everything you try to paste gets an extra "unwanted" newline character prepended to it..!)

But before you start doing any of the above, you should first start a new blank game, load in the QuickStart game file (QS), and create a simple two-room test game where you use the IF obj IN rm condition to print some short message (or whatever) -- just to make sure that IF obj IN rm really does work if you create a new game from scratch.

:(
Thanks Lurkio, as always you have been very helpful. I think your suggestion for the code for that puzzle makes much more sense. It is in fact the kind of thing that I was grasping for, but I couldn't quite find the commands!

Surely if there was a bug in GAC, somebody would have spotted it by now? Weren't some professional release titles written using it back in the 80s? I reckon file corruption. I don't trust that dodgy SD card. I'm going to buy a new one, and copy it and use the current one as emergency back up only.

I probably will go for the retyping option, but I'll start in room 10, to see if I can get that to work. I may also try it on my C64 version, or even the Speccy (assuming I can find one that works!). (I'll try the two room adventure idea first though).

I'll keep you posted on my progress.
Was my coding very clunky? I expect it was.

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Sun Jan 07, 2018 9:09 pm

I recommend studying the code for the example game in the manual, ADVMAN, thoroughly.

Also, I think you can load and examine the DATA file for any GAC game, commercial ones included. That's what I did when I hacked Plane Crash. See also the DATA file in Alien Jailbreak.

:idea:

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Mon Jan 08, 2018 12:28 am

I'll take a look Lurkio. Thanks for the pointers.

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Mon Jan 08, 2018 1:46 pm

Well I tried a simple 2 room adventure on the BEEB, and it did not work with IF NOT (CARR 1) etc etc

I then tried the same thing on my C64 ( I forgot how I love those datasette units!!). When I eventually got GAC and QS loaded!!! I found the same problem exists with GAC on the C64.

I will now go up the loft to see if I can find a working Spectrum...... I may be some time....

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Mon Jan 08, 2018 1:56 pm

Commodore wrote:Well I tried a simple 2 room adventure on the BEEB, and it did not work with IF NOT (CARR 1) etc etc
So now you're saying that if you start a new GAC adventure from scratch on the Beeb, and then load QS, and then add a rule to test the condition IF NOT (CARR obj) -- it fails?

(By the way, I hope you're doing all this in BeebEm now, rather than on your real Beeb.)

:?:

UPDATE. Here's a simple two-room GAC adventure (filename LTEST01) that demonstrates that IF NOT CARR 1 in a High Priority condition works:
:idea:

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Mon Jan 08, 2018 3:05 pm

lurkio wrote: So now you're saying that if you start a new GAC adventure from scratch on the Beeb, and then load QS, and then add a rule to test the condition IF NOT (CARR obj) -- it fails?
That is what happened, yes.
(By the way, I hope you're doing all this in BeebEm now, rather than on your real Beeb.)
Well given that it was only a few lines, I used my real BEEB.

:?:
UPDATE. Here's a simple two-room GAC adventure (filename LTEST01) that demonstrates that IF NOT CARR 1 in a High Priority condition works:
Ah! Well that changes things! I did do it in Local Conditions though. Should still work though? All I got was what now?
  • GAC-LTEST01.ssd.zip
:idea:

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Mon Jan 08, 2018 3:07 pm

Unfortunately, my Spectrum was not playing ball:

R: Tape Loading Error

so I never found it if the same problem occurs with GAC on that machine.

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Mon Jan 08, 2018 3:18 pm

Just tried it again on the BEEB in Conditions (Local), and it worked. I realised that I needed to give a command, and then it would trigger the death message. So why did it not work in B8?

I'm back in business. Thanks Lurkio! It's working in Local conditions, which is what I prefer.

Unfortunately, when I try using the file you attached I just get Mistake and then Bad Program, or vice versa.

Many thanks for your help Lurkio. At least now I feel that I may one day be able to finish this adventure. I certainly want to look at your suggestions and improvements. It's only a silly game to test it out and set a puzzle for my boys as a bit of fun.

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Mon Jan 08, 2018 4:07 pm

Commodore wrote:Unfortunately, when I try using the file you attached I just get Mistake and then Bad Program, or vice versa.
The file I attached is a .SSD disc-image of GAC, including my test game LTEST01. (The .SSD is called LTEST01.ssd, but it's really just a copy of GAC.)

You need to unzip the .zip file and then load the extracted .SSD file (LTEST01.ssd) into BeebEm. Then boot it as usual. When GAC has booted, choose option 1 to launch the adventure editor, and then choose option T to load my test game: the filename to type in is LTEST01

:idea:

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Mon Jan 08, 2018 6:09 pm

lurkio wrote:
Commodore wrote:Unfortunately, when I try using the file you attached I just get Mistake and then Bad Program, or vice versa.
The file I attached is a .SSD disc-image of GAC, including my test game LTEST01. (The .SSD is called LTEST01.ssd, but it's really just a copy of GAC.)

You need to unzip the .zip file and then load the extracted .SSD file (LTEST01.ssd) into BeebEm. Then boot it as usual. When GAC has booted, choose option 1 to launch the adventure editor, and then choose option T to load my test game: the filename to type in is LTEST01

:idea:
Thanks Lurkio, and apologies for being so dimwitted. I am still getting used to the BBC way of doing things.

I unzipped the file, copied it to my desktop, and then put it in a slot on my card. I then did *DIN359 and then *EXEC !BOOT
That is when I got the errors. At the top of the screen I could see some other lines which included reference to loading GAC, and then O., and then the mistake and bad program messages. Probably something else I did!

Anyway, I'm looking forward to carrying on with B8 tomorrow.

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Mon Jan 08, 2018 6:13 pm

Commodore wrote:I unzipped the file, copied it to my desktop, and then put it in a slot on my card. I then did *DIN359 and then *EXEC !BOOT
That is when I got the errors. At the top of the screen I could see some other lines which included reference to loading GAC, and then O., and then the mistake and bad program messages.
Try booting the .SSD in BeebEm. Does it work for you in BeebEm?

:?:

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Mon Jan 08, 2018 8:48 pm

I'll give it a go tomorrow and report back Lurkio.

Commodore
Posts: 120
Joined: Wed Sep 20, 2017 4:56 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Commodore » Tue Jan 09, 2018 1:48 pm

OK, so I have got LTEST01 to work on BEEB EM. That's good, because that is the first time I've used BEEB EM, and it went quite easily. Thanks for that Lurkio.

On the back of solving the SNAKE puzzle (eventually!), I added a few bits to that room, including (well mostly) a little easter egg.

I then, buoyed with new found programming confidence, went back to room 1 and tried to make a bit more of a challenge on the flight deck.

As we have some control desks (which if you touched brought doom to the ship), and we have a main computer that controls the ship, I thought it would be nice to have it so that if the computer is not activated (a marker set) the ship goes out of control when you touch the controls, but if it has been activated you can tell it to stop. Well I managed that part eventually, but I wanted it so that you couldn't just ignore it once you've touched the controls, by just going to the next room for example. So, I tried telling it that if N, S , E or W was entered after the marker was set, that they didn't work as normal; problem is, I found I couldn't override them.

So how could I achieve this? Any ideas?

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Wed Jan 17, 2018 12:04 am

Commodore wrote:
lurkio wrote:... I've played around with your game file (B8) by trying to add new conditions (High, Low, and Local) that include IF ( 9 IN 1 ), but none of them work, even though they should ... So I think that either you've come across some obscure bug in GAC ...
Surely if there was a bug in GAC, somebody would have spotted it by now?
You'd think. But I've now tried my two-room test adventure game in a couple of different copies of GAC (creating the game from scratch each time), and the bug really does seem to be there.

You can try my test game online here:
Download here:
When the game starts, you're in Room 2. Enter the command LOOK. You should see a message about the gun being in the other room. Now go EAST to Room 1 and GET GUN. Then go WEST to Room 2 again and DROP GUN. Go EAST back to Room 1 and LOOK. This time, the message fails to be printed!

The game consists of two rooms and a gun. When the gun is lying in the room that you're not in, and you type a command such as LOOK that doesn't cause you to move, then a message should be printed on screen telling you the gun's in the other room. And that is indeed what happens when the gun's in Room 1 and you type LOOK in Room 2, but the message fails to appear when the gun's in Room 2 and you type LOOK in Room 1 -- even though the code is almost exactly the same for both rooms!

Local Condition for Room 1:
  • Code: Select all

    IF ( 1 IN 2 ) MESS ( 1 ) LF HOLD ( 500 ) END
Local Condition for Room 2:
  • Code: Select all

    IF ( 1 IN 1 ) MESS ( 1 ) LF HOLD ( 500 ) END
It seems that the IF ( obj IN room ) test in GAC is unreliable!?

:?:

User avatar
Lardo Boffin
Posts: 1226
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Lardo Boffin » Wed Jan 17, 2018 9:01 am

I think there may be a few inconsistencies with GAC, especially when an adventure gets complex. I have been playing around with it recently and found that a high priority message which was based on a Counter having a set value was always being triggered at the start of the game (i.e. the first room). I have tried to recreate this with a simple example but can't so it is possible it was my code but I spent a lot of time going through and could not see why it would be.

As an aside I have found that if you need to insert a new line into High, Low or Local Conditions it is possible to do so without a lot of re-typing.

Assuming you have: -

Line 1 IF ( 5 EQU? 8 AND SET? ( 5 ) ) MESS ( 1 ) END
Line 2 IF ( AT ( 2 ) ) 5 CSET 8 SET ( 5 ) END

(This was my test trying to recreate the high priority message issue above.)

If you need to add a condition between lines 1 and 2 you edit line 1 and type: -

Line 1 IF ( 5 EQU? 8 AND SET? ( 5 ) ) MESS ( 1 ) END MESS ( 2 ) END

And then when you go back and look through the lines in order you have: -

Line 1 IF ( 5 EQU? 8 AND SET? ( 5 ) ) MESS ( 1 ) END
Line 2 MESS ( 2 ) END
Line 3 IF ( AT ( 2 ) ) 5 CSET 8 SET ( 5 ) END

Given that lines are processed in order this may be a useful trick.
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Viglen twin 40/80 5.25" discs, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master, Datacentre + HDD, pi co-proc

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Wed Jan 17, 2018 12:55 pm

Lardo Boffin wrote:... Given that lines are processed in order this may be a useful trick.
That is indeed a useful trick! Thanks.
Lardo Boffin wrote:I think there may be a few inconsistencies with GAC, especially when an adventure gets complex.
Yes, in the past I too have seen what I thought were inconsistencies in GAC, but I'd never been able to pin one down till I found the bug in my previous post. It's made me lose all confidence in GAC, to be honest. I used to think GAC was the best Beeb text adventure utility for beginners, but now I'm really not sure.

I've now tried creating the same test game in two different copies of Beeb disc GAC, and also in Beeb/Elk tape AC (which is a tape-only version of GAC that can do multi-part games), and the bug is present in all three. My test game is easy to create from scratch as it consists only of the following:
  • The quickstart data that you can load from file QS, which comes with GAC and AC.
  • Two Low Priority rules for GET and DROP that appear at the end of Appendix A in the GAC manual.
  • Two rooms, called Room 1 and Room 2, that connect to each other.
  • One noun and one corresponding object, for the gun.
  • One message ("The gun is in the other room").
  • Two Local Conditions, one each for Room 1 and Room 2, as given in my previous post.
Btw, Stardot-user tautology has written a GAC-decompiler/interpreter called "grackle" in C, and he's found that his interpreter somehow has the same bug that I discovered in Beeb GAC!:
:?:

User avatar
tautology
Posts: 369
Joined: Wed Sep 01, 2010 2:26 pm
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by tautology » Wed Jan 17, 2018 9:48 pm

lurkio wrote:Btw, Stardot-user tautology has written a GAC-decompiler/interpreter called "grackle" in C, and he's found that his interpreter somehow has the same bug that I discovered in Beeb GAC!:
:?:
Yeah; after a while of digging back through my notes, my code and several manuals (for which there's a printing error in about the IN command in the Amstrad CPC manual) I found out, it's not affected by the bug; I was just testing it wrong.

The perils of quickly checking things before racing out to work...

User avatar
Lardo Boffin
Posts: 1226
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by Lardo Boffin » Wed Jan 17, 2018 10:11 pm

I think I may have another issue with GAC, unless I am missing something really obvious. :?:

I am trying to do something WITH something. In the example in the SSD (
with_test.ssd
(67.5 KiB) Downloaded 19 times
) I am trying to shoot a werewolf with a silver bullet. Seems traditional! Load the file called TEST.

But it doesn't work.

I have 3 messages
1) It dies
2) It rips you to shreds
3) - (this is part of the debugging message)

I have 2 nouns
1) Werewolf
2) Silver

I have all the QS verbs plus
20) shoot

I have 1 room.

The local conditions are: -

IF ( VERB ( 20 ) AND NO1 = 1 AND NO2 = 2 ) MESS ( 1 ) END
PRIN ( VBNO ) MESS ( 3 ) PRIN ( NO1 ) MESS ( 3 ) PRIN ( NO2 ) END

If I type: -
SHOOT WEREWOLF WITH SILVER
I get told I can't.

It then prints out: -
20-1-2
which are verb 20, noun 1 being 1 (werewolf) and noun 2 being 2 ( silver)

So that looks correct to me!

I have also tried: -
IF ( VBNO = 20 AND NO1 = 1 AND NO2 = 2 ) MESS ( 1 ) END
Which doesn't work.

Giving up on verbs completely for the moment I tried: -
IF ( NO1 = 1 AND NO2 = 2 ) MESS ( 1 ) END
Still not working! :evil:

This works: -
IF ( NO2 = 2 ) MESS ( 1 ) END

as does

IF ( NO1 = 1 ) MESS ( 1 ) END

and

IF ( VERB ( 20 ) AND NO1 = 1 ) MESS ( 1 ) END

and

IF ( VERB ( 20 ) AND NO2 = 2 ) MESS ( 1 ) END

So clearly it has an issue with NO1 = # AND NO2 = # for some reason.

Has anyone got one of these condition sets working? While the puzzle I am trying to implement is not adventure critical it would be nice to put it in.
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Viglen twin 40/80 5.25" discs, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
BBC Master, Datacentre + HDD, pi co-proc

User avatar
lurkio
Posts: 1744
Joined: Tue Apr 09, 2013 11:30 pm
Location: Doomawangara
Contact:

Re: Graphic Adventure Creator (GAC) programming

Post by lurkio » Wed Jan 17, 2018 11:56 pm

tautology wrote:... several manuals (for which there's a printing error in about the IN command in the Amstrad CPC manual)
Well, well, well. Inspired by this comment on the grackle github, it occurred to me that Beeb GAC might be suffering from the same problem that's reported there -- i.e. that the two operands of the IN operator might be the wrong way round in the manual, where they appear in this order: obj IN room

So I tried changing the Local Condition for Room 1 (see my previous post) from
  • Code: Select all

    IF ( 1 IN 2 ) MESS ( 1 ) LF HOLD ( 500 ) END
to
  • Code: Select all

    IF ( 2 IN 1 ) MESS ( 1 ) LF HOLD ( 500 ) END
-- essentially just swapping the operands around -- and it worked!

So it looks like there might be an error in the Beeb GAC manual (as well as in the CPC GAC manual as tautology implied) -- or the manual is right but there's a bug in the implementation of the GAC engine:
  • Untitled.png
Looks like o IN r isn't what GAC actually implements; what GAC implements is r IN o.

:?:

Btw, this might also explain Commodore's problem, which was the point of the original post in this thread.
Commodore wrote:Just tried it again on the BEEB in Conditions (Local), and it worked. I realised that I needed to give a command, and then it would trigger the death message. So why did it not work in B8?
I tried changing the Local Condition for Room 10 in B8 from IF ( ... 9 IN 1 ) to IF ( ... 1 IN 9 ) and suddenly that bit of the game worked as intended!

:idea:

UPDATE: And here it is, straight from the horse's mouth (Sean Ellis, creator of GAC) -- proof that there is indeed a bug in the final released version(s) of GAC:
The order of operands for the “in” operator seem to have been flipped around. What is the reason for that? (The initial manuals showed it as “o in r – Is object o in room r?”, but later errata said it was actually “r in o” instead.)

No reason – that was a straight bug that we didn’t catch until it was too late.
Wish I'd found that link earlier!

#-o

Lardo Boffin wrote:IF ( VERB ( 20 ) AND NO1 = 1 AND NO2 = 2 ) MESS ( 1 ) END
Try the following instead -- it works for me, for some reason!:
  • Code: Select all

    IF ( NO2 = 2 AND NO1 = 1 AND VERB ( 20 ) ) MESS ( 1 ) END
This works too:
  • Code: Select all

    IF ( NO2 = 2 AND NOUN ( 1 ) AND VERB ( 20 ) ) MESS ( 1 ) END
:idea:
Last edited by lurkio on Thu Jan 18, 2018 3:49 pm, edited 5 times in total.

Post Reply