Searching - TADS3.1

I am writing a story that somewhat replicates the old Cave Stories. I can’t seem to find some good code examples for any of this. I’m looking for ways to handle and keep track of hunger, resting, drinking water, eating, fighting creatures, etc… Most of this should be controlled by turn-count and much of it should be random. Can’t seem to find anything like these in the TADS manuals. Looking for any help that I can get.

RonG

If you need to keep track of game state, libGlobal is a good place to stick random variables until you get the urge to refactor your code. libGlobal has a totalTurns property that you can use to check the turn count. You can modify it to have a turnWhenThePlayerAteSomething property as well. Then you can compare the two numbers to calculate something like a hunger index. You would want to put this calculation in a Daemon so that it runs every turn.

But in all candor, drinking water, eating, and fighting are way outside the scope of a simple answer. The implementation depends a lot on how you want those mechanics to work. The reason you aren’t finding elaborate examples worked up in the TADS 3 manuals is that those mechanics have been marginalized over the last twenty years and are no longer considered acceptable by the vast majority of players.

Thanks for the information. I was quite surprised to learn about the absense of support for all of my ideas. I really like TADS3 and hate to give up on it. Actually, the fighting that I had in mind was quite minimal. What I had in mind for the rest was counters, both sequencial and random, and as variable storage. The variables are actually the most required. I’m now wondering if it wouldn’t be a better idea to give Inform a try. What are your ideas about that?

RonG

btw: I really can’t thank you guys enough for your tons of support. Special thanks to you for all the ultra fast help you’ve always given. :stuck_out_tongue:

All of what you want is supported. It’s called “programming”. TADS is a programming language. It’s not a magic box that implements your game for you. You have to do that yourself. You can ask for help about specific things you have in mind, but the question you asked in this thread is too general. You need to be more specific.

If you need general, non-specific answers:

How to do a hunger counter: Keep track of the PCs hunger level and check it on each turn.
Resting: Check in each turn how much time has passed since the PC rested.
Drinking and eating: Check in each turn how much time has passed since the PC ate/drank.
Fighting: Implement fight related actions and have them subtract hit points from monsters. Introduce code to the monsters that handles attacking the PC.

I’m sorry that I used such general terms in describing what I wanted to do in this post. Actually, I’ve done more searching through the manuals and I believe I can find ways to meet all my needs. I plan to use lists, deamons, random values, and other ideas. I’m quite confident that I can pull this off. My best bet is probably to make a ‘big picture’ of what I require, code wise, to achieve all these ideas.

Don’t mean to bother you so much but I truly love programming and have done it for many years even though it’s certainly not that obvious.

I did check Inform7 once again and I still don’t like it!

Best Regards,

RonG