Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TAKE ALL Crashes with Container Limits #34

Closed
tajmone opened this issue Jul 26, 2021 · 2 comments
Closed

TAKE ALL Crashes with Container Limits #34

tajmone opened this issue Jul 26, 2021 · 2 comments
Labels
⚙️ Arun Arun interpreter 💀 bug Something isn't working

Comments

@tajmone
Copy link
Contributor

tajmone commented Jul 26, 2021

ALAN 3.0beta8 build 2220

Attempting TAKE ALL will crash the adventure is the picked items exceed the Hero's Container Limits Count by at least two more items than maximum allowed.

E.g. here the Hero has a limit of max two objects, when picking the third one it will print the warning, but on the fourth it crashes:

Bedroom
There is a ball, a bottle, a letter and a pie here.

> take all
(ball) You pick up the ball.

(bottle) You pick up the bottle.

(letter) You pick up the letter. You can't carry more than two items!

(pie)

As you enter the twilight zone of Adventures, you stumble and fall to your
knees. In front of you, you can vaguely see the outlines of an Adventure that
never was.

APPLICATION ERROR: Interpreter recursion.

<If you are playing this piece of Interactive Fiction, please help the author to
debug this programming error. Send an exact transcript of the commands that led
to this error to the author. Thank you! If you *are* the author, then you have
to figure this out before releasing the game.> 

The above transcript was generated from the following adventure:

The hero IsA actor
  Container
    Limits Count 2
      then "You can't carry more than two items!"
End the hero.


The Bedroom IsA location
End the Bedroom.

The ball IsA object at Bedroom.
End the.

The bottle IsA object at Bedroom.
End the.

The letter IsA object at Bedroom.
End the.

The pie IsA object at Bedroom.
End the.


Syntax take = take (obj)*
  Where obj IsA object
    else "You can only handle objects."

Add to every object
  Verb take
    Does
      "You pick up $+1."
      Locate obj in hero.
  End verb.
End add to.

Start at Bedroom.
@tajmone tajmone added 💀 bug Something isn't working ⚙️ Arun Arun interpreter labels Jul 26, 2021
tajmone added a commit to alan-if/alan-bugs-testbed that referenced this issue Jul 26, 2021
Add test adventure and solution for the bug affecting Container Limits:
if TAKE ALL attempts to take items in excess of a container's Limits
Count, ARun crashes at the second exceeding item.

(See: alan-if/alan#34)
@tajmone
Copy link
Contributor Author

tajmone commented Jul 26, 2021

Live Tests

I've created a dedicated test for this:

https://github.com/alan-if/alan-bugs-testbed/tree/master/container-limits

I'm also going to do some further tests, because there's some fishy about how container count limits actually work when the player is carrying a container (e.g. a bag). I think I've noticed some inconsistencies that it's worth testing and pointing out.

@tajmone
Copy link
Contributor Author

tajmone commented Jul 26, 2021

Related Bug

Possibly this is a related bug, since it concerns using ALL when a parameter fails and then there are more, which leads to crashing:

The Room IsA location
End the Room.

The bucket IsA object at Room
  Container.
End the.

The stone IsA object at Room
End the.

The letter IsA object at Room
End the.


Syntax put = put (obj1)* 'in' (obj2)
  Where obj1 IsA object
    else "You can only handle objects."
  And obj2 IsA object
    else "You can only handle objects."
  And obj2 IsA container
    else "You can't put anything in $+2."

Add to every object
  Verb put
    When obj1
      Does
        "You put $+1 into $+2."
        Locate obj1 in obj2.
  End verb.
End add to object.

Start at Room.

Which produces:

Room
There is a bucket, a stone and a letter here.

> put all in bucket
(bucket) You put the bucket into the bucket. Putting the bucket in itself is
impossible.

(stone)

As you enter the twilight zone of Adventures, you stumble and fall to your
knees. In front of you, you can vaguely see the outlines of an Adventure that
never was.

APPLICATION ERROR: Interpreter recursion.

<If you are playing this piece of Interactive Fiction, please help the author to
debug this programming error. Send an exact transcript of the commands that led
to this error to the author. Thank you! If you *are* the author, then you have
to figure this out before releasing the game.>

tajmone added a commit to alan-if/alan-bugs-testbed that referenced this issue Aug 12, 2021
Now that the bugs and inconsistent behaviors of Contain Limits mentioned
in alan-if/alan#34 have been all fixed in build 2241, update the bug
status to 'solved' in main README (we'll keep the old tests, just in
case).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Arun Arun interpreter 💀 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant