new author- needs help- TADS3

I am new to authoring, and i am designing a game using TADS 3. I can do a few things pretty well (i have the entire game area mapped out with most of the items), but i am having trouble with one particular item.

without giving too much away about the game, i am trying to make an openable container that doesnt exactly open, it breaks open (like hiding a key inside of a dragons egg). not only that but the player must use a specific item to break it.

i humbly ask for youse guys’ help, any suggestion will help me greatly. i am new to authoring, and i have so much fun programming this. anyone have ideas?

I would suggest defining the egg (or whatever it is) as BasicOpenable, Thing. This will let it keep track of its open/closed status, but it won’t respond to OPEN/CLOSE commands.

The library doesn’t have a BREAK X WITH Y action (only BREAK X), so you’ll probably want to create one. If you haven’t created an action of this kind before, have a look at How to Create Verbs in the Technical Manual, the “Verb with two objects” section. Then define dobjFor(BreakWith) on the egg so that it responds correctly to BREAK EGG WITH SLEDGEHAMMER (or whatever your game uses). You’ll need to call “makeOpen(true)” here, so that the egg now knows it is open.

If you have trouble, I’ll run up some example code for you.

thank you for your help, i really appreciate it. ill look into what you said (the bit about defining verbs will be helpful).

to raise curiousity, i am writting a horror type game, sort of a mix between the movies ‘Saw’ and ‘Identity’. i have the layout done, as well as most of the objects.

i have tried following the manuals steps for creating verbs, though i have not figured itout. so far, i have-

DefineTIAction(BreakWith);
VerbRule (BreakWith)
‘break’ dobjList ‘with’ singleIobj
:BreakAction
verbPhrase= ‘break (item i want to break is here) with (item i want to break it with is here)’
;
modify Thing
dobjFor(BreakWith)
{
verify()
{
illogical (‘Hmm… looks like you might need something else to smash this with’);
}
}
iobjFor(BreakWith)
{
verify()
{
illogical (‘Hmm… what can I break with this?’);
}
}
;

i have that creating the verb, and then on the item i want broken, i have-

actionDobjBreakWith()
{'game text here.’;
}

so far, all it does is say that ‘breaking that would serve no purpose’

Am i missing something here?

Just looking at your code (I don’t have TADS handy for testing), changing your VerbRule to this should work:

VerbRule (BreakWith) 'break' dobjList 'with' singleIobj : BreakWithAction verbPhrase= 'break (what) with (what)' ;

Previously, you had

: BreakAction

so the game was understanding BREAK EGG WITH HAMMER simply as BREAK EGG.

ok, cool. i got the game to respond to the command, though how do i make the game recognize that the egg can be broken by the hammer? it still says the illogical text even if i have the hammer in inventory (i get the illogical text from the dobjFor(BreakWith) line)

While I don’t know this for sure, the actionDobjBreakWith() looks suspicious and I doubt if TADS knows how to call it automatically. For very least you’ll have to override the verify() function for the egg. Try this:

[code]dobjFor( BreakWith )
{
verify() {}

action()
{
"Smash! ";
}
}[/code]

And you’ll have to override the verify() in the hammer’s iobjFor( BreakWith ) as well.

Actually, this part is fine. This:

dobjFor(BreakWith) { action() { // whatever } }
is only a complicated macro for this:

actionDobjBreakWith() { // whatever }
(I can’t seem to find the place in the docs where this is explained, though.)

Nitku is right: your egg is a Thing, so it will inherit Thing’s illogicality, unless you explicitly override it.