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.
Post Reply
User avatar
Denk
Posts: 593
Joined: Mon Feb 22, 2016 6:21 pm
Points: 251
Location: Hjørring, Denmark

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

Post by Denk »

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 152 times
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
P/o Prune
Site Admin
Posts: 4677
Joined: Mon Jun 24, 2002 9:18 am
Points: 93
Location: Denmark

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

Post by P/o Prune »

Thanks Denk.
Voted up, one notch :wink:
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 138Kb
ElliotM
Posts: 1227
Joined: Tue Apr 17, 2007 9:04 pm
Points: 13
Location: The Midwest in the USA

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

Post by ElliotM »

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 98 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)

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:

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.
saabie
Posts: 1024
Joined: Fri Aug 12, 2011 3:07 am
Points: 50
Location: Adelaide, South Australia

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

Post by saabie »

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.
ElliotM
Posts: 1227
Joined: Tue Apr 17, 2007 9:04 pm
Points: 13
Location: The Midwest in the USA

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

Post by ElliotM »

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.
saabie
Posts: 1024
Joined: Fri Aug 12, 2011 3:07 am
Points: 50
Location: Adelaide, South Australia

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

Post by saabie »

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: 1024
Joined: Fri Aug 12, 2011 3:07 am
Points: 50
Location: Adelaide, South Australia

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

Post by saabie »

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.
ElliotM
Posts: 1227
Joined: Tue Apr 17, 2007 9:04 pm
Points: 13
Location: The Midwest in the USA

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

Post by ElliotM »

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.
saabie
Posts: 1024
Joined: Fri Aug 12, 2011 3:07 am
Points: 50
Location: Adelaide, South Australia

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

Post by saabie »

OK, here is a new version with a bug fixed:
s_Leave Objects Before Taking.taf
(16.09 KiB) Downloaded 97 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.
User avatar
Campbell
Site Admin
Posts: 4732
Joined: Sun Jun 23, 2002 12:05 pm
Points: 0
Location: Edinburgh, Scotland
Contact:

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

Post by Campbell »

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.
Post Reply