ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Bug: taking what you are standing/sitting/lying on

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.

Bug: taking what you are standing/sitting/lying on

Postby Denk » Wed Mar 22, 2017 3:13 pm

Hi all,

I just stumbled across this bug, which makes the runner freeze. If the player tries to pick up the dynamic object the player is standing, sitting or lying on, the runner freezes. I attach a demo with a simple fix: The task "get something when on it" fixes the problem. If you delete this task you can make the runner freeze by typing "stand on table" followed by "get table".

I have made a bug report here: http://www.adrift.co/bug/19172
Please up-vote it.

There are now quite a few bugs in the standard library which can be solved. Perhaps it would be a good idea to put a list of known issues and solutions in one place?
Attachments
get_what_you_stand_on_bug.taf
(14.85 KiB) Downloaded 85 times
-----------------------------------------------------------------------------------------
Out now: The Royal Puzzle, The Way Home & The Dragon Diamond
-----------------------------------------------------------------------------------------
Denk
 
Posts: 154
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 31

Re: Bug: taking what you are standing/sitting/lying on

Postby P/o Prune » Sat Mar 25, 2017 7:13 pm

Thanks Denk.
Voted up, one notch :wink:
D-Day V.5 in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 29Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4244
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: Bug: taking what you are standing/sitting/lying on

Postby ElliotM » Wed May 02, 2018 7:59 pm

This bug affects Dynamic Containers as well as Dynamic Supporters. My setup is like yours, Denk, in that I tried making Specific tasks to make you get off or out of dynamic supporters or dynamic containers before taking them but my setup can't detect nested objects. For instance, go inside a portable tent, sit on a chair inside the tent, and then attempt to take the tent that you are technically still inside of will cause the runner to hang up.

Get Off Objects Before Taking.taf
Get Off and Get Out of Dynamic Supporters and Containers Before Taking. Works fine if no nested objects happen.
(15.21 KiB) Downloaded 36 times


Macro I used to test my demo (last line will cause the hang up because of nesting, remove if you want to test the rest leading up to that point)
adrift Code: Select all
sit on chair
take chair
go inside tent
take tent
drop tent
go inside tent
sit on chair
drop chair
sit on chair
take tent


The transcript illustrates my partial solution. Transcript gets written to all the way up to the task that hangs the runner which happens because we are taking the tent while sitting on the chair that is inside the tent:
adrift Code: Select all
> sit on chair
You sit on the light-weight chair.
 
> take chair
(getting off the light-weight chair first)  Ok, you pick up the light-weight chair.
 
> go inside tent
You step inside the portable sitting tent.
 
> take tent
(getting out of the portable sitting tent first)  Ok, you pick up the portable sitting tent.
 
> drop tent
Ok, you put down the portable sitting tent.
 
> go inside tent
You step inside the portable sitting tent.
 
> sit on chair
You can't sit on something that you are holding!
 
> drop chair
Ok, you put down the light-weight chair.
 
> sit on chair
You sit on the light-weight chair.
 
> take tent
Ok, you pick up the portable sitting tent.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Bug: taking what you are standing/sitting/lying on

Postby saabie » Thu May 03, 2018 2:16 am

If you get off the chair inside the tent then your "get off objects before taking" task will move you to the floor (outside the tent),
you should do what the "Leave object" task does:
Move the player to parent location
Set property character position of player character to standing

For the recursive case you would need to call a recursive task with %Player%.Parent going to an %item% reference.
This is fairly complicated and would need another 3 tasks and a variable at least.
I will try to update your demo if I have time.
saabie
 
Posts: 935
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 25

Re: Bug: taking what you are standing/sitting/lying on

Postby ElliotM » Thu May 03, 2018 2:53 am

Not sure we have the right task actions to do it the way you described unless I am missing something. Move the player to parent location gave me errors and I'm not seeing a way to set property character position to standing without specifying what they are standing on.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Bug: taking what you are standing/sitting/lying on

Postby saabie » Thu May 03, 2018 7:25 am

Move the player to parent location gave me errors
You need a restriction to first check that the player is not "At Location" because the parent function does not seem to work unless the player is on or in something.
I'm not seeing a way to set property character position to standing without specifying what they are standing on

Under the "Set properties" actions select the player character and you should find the "Character position" property on the drop-down list.
If it is not there then try opening and re-saving the "Player" character and try again.

I got it working for taking the tent when you are on the chair inside the tent but if you try to take the chair while it is in the tent it is hanging ADRIFT and I have no idea why yet.
saabie
 
Posts: 935
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 25

Re: Bug: taking what you are standing/sitting/lying on

Postby saabie » Thu May 03, 2018 2:48 pm

This seems to be working now, but will need more testing to make sure it works in all circumstances.
#File redacted#
Sitting Room
A heavy coffee table sits in the middle of the room.
Also here is a light-weight chair, a portable sitting tent and a rubber mat.

> get chair and mat
Ok, you pick up the light-weight chair and the rubber mat.

> enter tent
You step inside the portable sitting tent.

> drop mat
Ok, you put down the rubber mat.

> put chair on mat
Ok, you put the light-weight chair on top of the rubber mat.

> sit on chair
You sit on the light-weight chair.

> take tent
(Getting out of the portable sitting tent first)
Ok, you pick up the portable sitting tent.

> undo
Undone. You sit on the light-weight chair.

> take chair
(from the rubber mat)
(Getting off of the light-weight chair first)
Ok, you take the light-weight chair from the rubber mat.
saabie
 
Posts: 935
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 25

Re: Bug: taking what you are standing/sitting/lying on

Postby ElliotM » Fri May 04, 2018 4:57 am

I am quite impressed, Saabie, I've done recursive task setups before and know those aren't the most easiest thing to do in Adrift. I will play around with this tomorrow to see if there are any holes I can poke in it but I imagine this is already quite solid looking in implementation.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Bug: taking what you are standing/sitting/lying on

Postby saabie » Fri May 04, 2018 5:04 am

OK, here is a new version with a bug fixed:
s_Leave Objects Before Taking.taf
(16.09 KiB) Downloaded 33 times

This version should never crash ADRIFT, but does not fix every problem with the player going in or on objects.
1. Any entering any container that can be closed should really move the player to a separate location to prevent them interacting with objects outside of the container.
2. It is still possible to enter a container that characters can't enter, by putting another object inside of it and getting on or in that object. This could be fixed by not letting the player get on or in an object unless it has the same parent as the player.
saabie
 
Posts: 935
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 25

Re: Bug: taking what you are standing/sitting/lying on

Postby Campbell » Sun May 13, 2018 10:05 pm

The Standard Library distributed with the code is online with the source here, so corrections can be made by anyone, and will be available in the next release.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4619
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 5 guests

cron