Hello,
I have a few questions about TADS3 (adv) that I did not find answers to in the documentation, and I hope you can answer one or the other. I assume most of them are trivial for experienced authors,so I hope it is okay to ask you in the first place. Here we go:
1. How can I print “he/she/it” instead of “the boy/the girl/the baby” in a string?
I often use {the dobj/it}
(or using G-TADS/german translation: {der dobj/er}
), which generates an noutput like “The small bucket”. However, sometimes, when two such sentences follow each other, it would be nice to just say “it” (or the appropriate pronoun, whatsoever), so instead of
The small bucket is empty. The small bucket could be filled
rather
The small bucket is empty. It could be filled
2. How can I determine the container of an object, e.g. remap an action to the gDobj’s container
I handle the PourIntoAction on a Container, and if it gets called on the content (e.g. a Liquid or alike), I would like to remap the action to the container. I tried dobjFor(PourInto) remapTo(PourInto, gDobj.getConnectedContainers()[1], gIobj)
but it leads to an
[Runtime error: nil object reference]
So what is the correct way to refer to the container in this specific case?
Also, yet another question regarding remap-like behaviour:
3. Say I would like to answer a dobjFor(FillAction) with the question “with what?”, how can I then remap to/invoke the FillInto Action with the dobj for the initial action plus the iObj defined by the player answer?
An example should make that a bit clearer:
Fill bucket
With what do you want to fill the small bucket?
water
// invoke “Fill bucket with water” (e.g. FillIntoAction(Dobj, ‘water’) or something)
Or, alternatively, just assume that we mean water, and add a String like “[with water]” before performing a regular remapTo, etc. You get the idea.
4. (differnt topic:) How can I format floating point numbers, e.g. round to 3 decimals?
The question is self-explanatory. While I generally try to avoid floating point numbers to prevent precision errors (that occur naturally in programming languages for known reasons), it would be nice to know how to round them, or at least format the output.
Finally, I wonder if for future questions you prefer one cummulated post like this, or split the questions into seperate topics (I guess the difference is “generating noise in the forum” vs “improve searchability for future readers” and thus preventing double posts)
I think it would be smarter to create seperate topics, but I did not want to generate too much noise before asking the moderators or well-known users how to handle the many questions that arise when starting with TADS3 from zero to hero (Ah, is there a chat available that may be a better suit for many “trivial” questions?)
Best, and have a great week @ all!