Hi, I’m really trying hard to learn Tads3. And then I came up with this idea. Wouldn’t it be great if there were some Tads3 tutorials on youtube?
I find other programming tutorials on youtube easier to understand than when just reading the manuals; Just a really easy one, where one could go through building a simple game and the interface perhaps. If anyone experienced is interested in doing that, I think that would be great for the community and I will definitely be watching it!
Besides that, I’m pondering this over and over… I can’t seem to understand when to use either dobjFor(…) or iobjFor(…)
The way I’ve understood it(, and this may be totally wrong by the way): Is that x.dobjFor is equivalent to y.iobjFor in some cases(?)
Like for instance in a game I am trying to write now, you start out bound to chair. To make things simple you are already carrying a knife.
Will the code for handling “cutting the rope” either be in the rope’s iobjFor(CutWith) or the knife’s dobjFor(CutWith)?
This is unclear to me, I do not know which to choose from. Is the result equal?
Right now the code for the knife and the rope looks like this:
[code]
Knife: Thing ‘knife’ ‘knife’ @me "It is a sharp knife. "
iobjFor(CutWith)
{
verify()
{
if(gDobj == Rope || gDobj == CuttedRope)
{
if (gDobj.cutted) illogicalAlready(’{The dobj/he} is already cut!’);
}
else inherited;
}
}
;
Rope: Thing, Fixture 'rope' 'rope' @me "It's a thick rope. "
cutted = nil
dobjFor(CutWith)
{
action() {
//"{The dobj/he}";
if(gIobj == Knife) {
me.bound = nil;
cutted = true;
Rope.moveInto(nil);
CuttedRope.moveInto(Cellar);
"You cut the rope with {the iobj/he}. It falls down on the floor round the chair. ";
}
}
}
;[/code]
It works, but I’m not really happy with it. Any improvements are welcomed.
I’m also trying to make the character unable to move or doing anything not realistic while being bound to the chair. But do I really have to go through each action for that. Like:
SturdyChair: Chair, Heavy 'chair' 'chair' @Cellar "It's a sturdy oak chair. "
roomBeforeAction() {
if (me.bound) {
if (gActionIn(Stand, StandOn, Sit, SitOn, GetOutOf, GetOffOf, GetOut, Out, Jump)) {
"You cannot do anything while being bound to the chair. ";
exit;
}
}
}
(The above seems rather inefficient.)
I’ve read the manuals, but I am still not getting it. I am an experienced Inform6 programmer, so that may be part of the problem, i.e I’m coming from a totally different coding paradigm.
Thankful for any explanations.