Help?

I’m sorry if this isn’t the right place to post a question, but I’m having a problem. I’m very, very new at using this program - I downloaded it yesterday. The problem is that I cannot have a conversation with an NPC when I run the debug mode. Is that normal? I get the message “You cannot talk to him” both on the game I’m trying to design and the sample game “Lighthouse” that I downloaded because I had hoped it would help with the problem. But I get the same message on both, no matter what command I try. What am I doing wrong?

No. You’re doing something odd with your code.

I had a quick search for “Lighthouse” and didn’t spot it. If you’ll provide a link to that batch of code, I’ll take a quick look at it and try to give you an answer.

That message is printed when it makes no sense to talk to the in-game object. The most likely explanation is that you haven’t made your NPC an Actor object. If it’s just an ordinary object, you’ll see that message.

For “Lighthouse”, go to users.ox.ac.uk/~manc0049/TADSGuide/intro.htm and download the source codes, the file is in there.

I did make the NPC an actor object: I’ve tried both “Actor” and “Person” but get the same results. Other than trying to ask/tell them anything, they behave exactly like they should. I’ve found that the NPCs only react to the command "ASK FOR ". You can greet them, but if you try to discuss any topic, the message “You cannot talk to him/her” appears.

By way of preliminary, I should perhaps acknowledge that NPCs, and in particular NPC conversations, are one of the more advanced aspects of TADS 3. (One of at least a dozen advanced aspects…) You might find it useful to spend some time laying out the basics of your game (rooms and objects) before attempting to create an NPC.

The method of embedding NPC conversations as Topic objects within the NPC object is well illustrated in “Lighthouse.” When I run that game, here’s the transcript I get. If you’re not getting this output, the most likely explanation is that you’ve been tinkering with the code without being entirely sure what you’re doing.

One of the most common (and difficult to spot!) errors in T3 code is putting the wrong number of + signs before an object declaration. If you look at the code for “Lighthouse,” you’ll see +++ before the HelloTopic, for example, but only ++ before an AskTopic. That structure is not intuitively obvious, but it’s essential.

Hope this helps! If not, please post a transcript of your play session with “Lighthouse” and let us know what modifications you’ve made in it.

Actually, I think I found the source of the problem…

I believe I have ruined my ‘actor.t’ file, because all games refuse to accept the NPCs as people you can have a conversation with. The ‘notAddressableMsg’ is what comes up when I try to speak with anyone. I don’t remember what I did to the actor file, and I also can’t figure out how to repair it. I tried downloading the entire program onto my sister’s computer and sending myself the ‘actor’ file, but when I tried to put it into the game it was automatically changed to what I’ve already got written down. Should I just redownload the entire TADS program and try again?

That would be a sensible procedure, yes.

For reference, you should never edit any of the library files, for several reasons. First, even if your edits accomplish your immediate objective, they will quite likely have undesirable side effects later on, in other areas of your game. Second, any modifications you make will show up in later games that you write, even if you don’t remember that you made them. Third, the library code is quite complex and interwoven, and you’re liable to break something. Fourth, your library may no longer work as described in the documentation.

If you feel that you must edit the library … what I always do is begin any edits (in the Inform 6 library – I’ve never hacked the T3 library) with a comment that documents what you’re doing. My comments on library edits always begin with the line:

//JA hack:

By searching for the character string “JA hack” I can instantly find any changes that I’ve made.

Any class in the library can be modified in your own code. That’s the safe way to make changes. Just create your own class that inherits from the library class, such as:

MyActor: Actor // insert your new or replacement code here... ;
There are other ways to do it, but that should work.

The question of how you put a file into the game (in Workbench) is also non-trivial. I don’t remember the details, but quite possibly the behavior you’re describing happened because your game was still referencing your previous (edited) version of actor.t rather than the “original” version that you added at a different point in Workbench’s browser. This is a guess on my part, but it’s not an unreasonable guess.

Thanks for all the help~ I’ll remember not to goof around with the libraries anymore, and I’ve uninstalled everything off my computer to try and restart completely.

There’s a stand-alone download of the adv3 library on the TADS page. It contains all the library files.