Programming NPCs in TADS 3

Does anyone know of a way/place I could see sample TADS 3 source code for some fairly complicated NPCs? The kind where they travel around and do actions autonomously… I have vague concepts of where and how I might code that, but some sample source would probably substantially reduce my experimentation time…
Thanks!

PS I am aware of the ActorState model, and I know there are ScriptedTravelTo and NestedActorAction methods… just putting it all together for a potentially dynamic character still seems hazy to me without having dove in and gotten my hands dirty…

1 Like

The “Creating dynamic characters in TADS 3” and " NPC Travel in TADS 3" articles should be a good starting point if didn’t read them already:

https://www.tads.org/articles.htm

3 Likes

Thanks, NC… I think I have read those before. When I was posting I temporarily forgot about AgendaItems. I’m sure I’ll be able to work it all out, I just thought it would still be helpful to see some sample source of NPCs that travel around on their own and perform autonomous actions, not necessarily in response to anything the PC does.
Is there anywhere on the Net that a person can look at the source code of some existing text adventure games?

Searching IFDB might be your best bet…?

1 Like

You could try the IF Archive at: http://ifarchive.org/indexes/if-archive/games/source/tads/ - at a first glance, All Hope Abandon (zip) might be of interest, since Eric Eve usually has well-implemented NPCs in his games, and of course he’s one of the most proficient TADS authors (probably the most proficient).

1 Like

This looks like a great place to start! Thanks!

An point related to this issue is that if archive’s /games/source/tads has both TADS 2 and 3 sources, perhaps for historical reasons, and in some cases the description don’t clarify if it’s tads2 or tads3 sources.

Best regards from Italy,
dott. Piergiorgio.

You might be interested in the source code for my game It, which featured a group of girls who play Sardines semi-autonomously. http://ifarchive.org/if-archive/games/source/tads/it_src.zip Check out the modifications to the Person class and the AgendaItem stuff in lib.t, and the individual characters in yvonne.t and tiana.t. I did my best to make the code comments illuminating, though the code itself isn’t always very readable.

2 Likes

Thank you so much! I’ll try to read this as soon as I can! (Not always easy to find reading time as a new father : ) )

I’ve just barely started reading some of the modifications to Person… I can already tell it’s going to be very beneficial!