Skip to content

Error in loading all object types documented as"Supported types of objects" in notebook "Handcrafting a game.ipynb" #360

Closed
@tanmana5

Description

@tanmana5

Trying to execute the line of code in "Handcrafting a game.ipynb", following the table "Supported types of objects" in notebook markdown, to initiate a new "stove" object:

stove_obj = M.new(type='stove', name="stove")

This gives the following traceback:


KeyError Traceback (most recent call last)
in <cell line: 1>()
----> 1 note = M.new(type='oven', name="note") # Provide the type and the name of the object.
2 note.infos.desc = "Bravo! You can read." # Text to display when issuing command "examine note".
3
4 supporter = M.new(type='s') # When not provided, names are automatically generated.
5

2 frames
/usr/local/lib/python3.10/dist-packages/textworld/generator/vtypes.py in getitem(self, vtype)
179 """ Get VariableType object from its type string. """
180 vtype = vtype.rstrip("'")
--> 181 return self.variables_types[vtype]
182
183 def contains(self, vtype):

KeyError: 'oven'

The same error is thrown with object type "oven". How can we extend the currently supported object types to "stove", "oven", or other new types?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions