jfmherokiller avatar

how to modify an object in a table in inform 7

jfmherokiller

Published: 29 Jun 2020 › Updated: 29 Jun 2020how to modify an object in a table in inform 7

how to modify an object in a table in inform 7

I want to share a trick I learned handling inform7 stories when you want to make debug commands

unresolvecheat is an action applying to one topic.

understand "unresolve [text]" as unresolvecheat.
carry out unresolvecheat:
    repeat with X running from 1 to number of filled rows in Table of GameEventIDs:
        choose row X from the Table of GameEventIDs;
        if Name entry exactly matches the text topic understood, case insensitively:
            now Object entry is unresolved;
            break;

the above code functions to modify the property of an event in the table of GameEventIDs
so that the player can attempt it again.

at first I was having trouble because i couldnt figure out how to modify a property of a selected row but then i figured out the answer was Object entry. This is important because X which is what i attempted to use at the start is not the object but the index of the object in the table.

ergo I attempted to make this line work

now X is unresolved;

but it was syntaticly invalid

Leave how to modify an object in a table in inform 7 to:

Written by

Read more #programming posts


Best Posts From jfmherokiller

We have not curated any of jfmherokiller's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From jfmherokiller