I have seen lots of topics about defining constants with tables, but I have seen nothing about defining a thing with a table. I want to create an empty table that I can populate at runtime. The table is contained in a thing, a spell book.
A spell book is a kind of readable thing.
A spell book has a Table of Known Spells.
Table of Known Spells
Name Cost Notes
"spell name" "1" "desc"
with 40 blank rows
I’ve found nothing in the docs. I get the error on defining a spell book. I’ve tried has a table..., is defined by Table, contains a Table, etc.
How do I declare a thing with a table in it? Later, I will copy data from a ref table into this table, but I have to have the table exist first.
btw, Do I really need the first line to contain placeholders, like I’ve done here?
Unfortunately, you can’t create tables automatically (without resorting to some I6 hacking). But you can define an empty table like this:
A spell book has a table name called the known spells.
The known spells of the grimoire is the Table of Grimoire Spells.
Table of Grimoire Spells
name (text) cost (number) notes (text)
with 10 blank rows.
That should work. Let me consider this.
A spell book contains a LINK to a the table with the link-name of known spells.
Now, I want to call the table Table of Known Spells, so that would change your code to
A spell book has a table name called the known spells.
The known spells of the [grimoire??} is the Table of Known Spells.
Table of Known Spells
name (text) cost (number) notes (text)
with 10 blank rows.
Does the text in parentheses tell the parser what type (kind) to expect: text, number, and text?
Is grimoire take a kind (spell book) and make it a specific object? (which I don’t want).
I haven’t tried it yet, but would this work?
A spell book has a table name called the known spells, called Table of Known Spells.
If the intention is that all spell books by default share the same table, it would look like this.
A spell book has a table name called the known spells.
The known spells of a spell book is usually the Table of Known Spells.
But if they always have the same table, there’s really no point in making this link at all. Just define the table and reference it directly when needed.
No, I have a two ref tables from which a unique spell book would draw. The player has this unique spell book–and spells are transferred to it from the ref tables–but other spell books are available to buy or find.