ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Solving two issues in the Standard Libary (v.5.0.35.3)

This forum is the place to learn about and discuss ADRIFT 5. Feel free to mention any bugs you find here, but please also add these to the Bugs & Enhancements list.

Please also refer to the ADRIFT 5 Wiki for more information.

Solving two issues in the Standard Libary (v.5.0.35.3)

Postby Denk » Mon Apr 27, 2020 4:46 pm

I have been looking into two issues in the standard library:

Problem 1:
PUT object IN POUCH. If the object is already in the pouch, we get (First removing 'object' from the pouch') "You put the 'object' in the pouch."
It would be better just to say that the object is already in the pouch.

Problem 2:
If we type TAKE OBJECT we get "You are already carrying the 'object'" if it is inside a container you are carrying.
It would be better if it took the object out of the container you are carrying.

Solution to problem 1:
PouchProblem1.taf
(15.54 KiB) Downloaded 34 times

The fix was done by changing the restrictions in the tasks "Remove before put" and "Put objects in others".

First take a look at the restrictions in "Remove before put":
The two last restrictions are new:
[Referenced Objects must not be inside Referenced Object 2] AND
[Referenced Objects must not be on Referenced Object 2]

Note that because there were some OR's between some of the restrictions, it was necessary to add parentheses around the original set of restrictions. Also note that the message field in these two new restrictions must be empty.

Now take a look at the restrictions in "Put objects in others":
The only change here is that I have added the following restriction:
[Referenced Objects must not be inside Referenced Object 2]

Please note the restriction message.

Finally, go to the "Advanced" pane in the "Put objects in others"-task. Here the field "If task fails and input references 'all', display this..." is empty. Copy this text into this field: You have nothing to put in %object2%.Name.

Solution to problem 2:
PouchProblem2.taf
(15.57 KiB) Downloaded 39 times

The problem is this ADRIFT restriction:
[Referenced Objects][must not][be held by][The Player Character]

If you are holding a container with an object inside, the object inside is also treated as if it is held by the Player Character.

To fix this it was necessary to create a new property: TakeFix

TakeFix is a property of all items and it is an Integer. Leave it undefined for all locations, objects and characters except for the player character. It should be one for the player character.

Also, open the Standard Libary task "Take Objects (Parent Task)" and find the restriction: [Referenced Objects][must not][be held by][The Player Character]

Change this restriction to an expression restriction and copy this into the expression field: %objects%.Parent.Takefix=0

Now, only if you carrying the object directly (i.e. not holding any containers with it), you will get the message "You are already carrying the coin".

If something is not clear, just ask.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 538
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251

Re: Solving two issues in the Standard Libary (v.5.0.35.3)

Postby rovarsson » Tue Apr 28, 2020 5:59 pm

Good work Denk! Thanks.

I had semi-solved 'Remove before put' by adding [Referenced Objects must not be inside Referenced Object 2]. It works for what I need, but I knew from the beginning it 's a superficial patch. Your solution is more in-depth and thorough. I'll implement it next time I open TT.

I worked around TAKE 'object' when 'object' is in a container being carried by making it a worn container and prohibiting the player from taking it off. This makes Adrift switch to TAKE 'object' FROM 'container'. This too is a superficial patch. Even with a good reason, it's annoying to the player. (Not to mention to me.) As before, your solution is more thorough. Thanks.
rovarsson
 
Posts: 94
Joined: Mon Dec 23, 2019 10:37 pm
Location: Belgium
Points: 15


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 5 guests