Dropping object in a dark location

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
P/o Prune
Site Admin
Posts: 4885
Joined: Mon Jun 24, 2002 9:18 am
Points: 168
Location: Denmark

Dropping object in a dark location

Post by P/o Prune »

Is there a way to make an object "disappear" if it is dropped in a dark location? and then be visible again when / if said location is lit?
D-Day in progress 86Kb (Slowly drifting)
October 31st: 93Kb (possible entry for IFComp 2021 :wink: )
User avatar
Lazzah
Moderator
Posts: 2490
Joined: Thu Mar 31, 2011 5:54 am
Points: 100
Location: Clacton-on-Sea, Essex
Contact:

Re: Dropping object in a dark location

Post by Lazzah »

Normally any object dropped in a dark location (i.e. a location in the group "Dark Locations" where there is no light source present) will not be seen, but in the context you are referring to the location isn't actually "dark", it is a normal location that the text says is dark. In this case you would create a specific task for dropping objects in that location where one of the actions is: "Set property 'Specifically exclude object from location descriptions' of Referenced Objects to Selected". That will ensure any object dropped in the "dark" location will not be seen.

Now, in the task where the room is lit you need to insert an action for EVERY object that can be dropped in that location - luckily in this context there aren't many! This would be (e.g.): "Set property 'Specifically exclude object from location descriptions' of 'a broken clay pot' to Unselected".

I have created a short demo which is attached, I hope you find it and the above of help?
P.O. Demo.taf
(28.47 KiB) Downloaded 6 times
Visit "Larry's ADRIFT Text Adventures" at http://LarrysAdriftTextAdventures.co.uk
User avatar
Denk
Posts: 857
Joined: Mon Feb 22, 2016 6:21 pm
Points: 346
Location: Hjørring, Denmark

Re: Dropping object in a dark location

Post by Denk »

At the moment, the demo doesn't prevent the player from picking up the objects in the dark but that can be worked around. Another technique I like to use is to move the dropped objects to an inaccessible location, e.g. "The dark object location". Then, when you turn on the light you can:

[Move][Everything at location][The dark object location][to location][The Dark Room]
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
P/o Prune
Site Admin
Posts: 4885
Joined: Mon Jun 24, 2002 9:18 am
Points: 168
Location: Denmark

Re: Dropping object in a dark location

Post by P/o Prune »

Denk wrote: Fri Apr 30, 2021 11:36 am At the moment, the demo doesn't prevent the player from picking up the objects in the dark but that can be worked around. Another technique I like to use is to move the dropped objects to an inaccessible location, e.g. "The dark object location". Then, when you turn on the light you can:

[Move][Everything at location][The dark object location][to location][The Dark Room]
This would work well in my case, since I only have one location that turns totally dark. (I'll explain in a pm)
D-Day in progress 86Kb (Slowly drifting)
October 31st: 93Kb (possible entry for IFComp 2021 :wink: )
User avatar
DazaKiwi
Posts: 830
Joined: Thu Oct 21, 2010 10:05 am
Points: 71
Location: New Zealand

Re: Dropping object in a dark location

Post by DazaKiwi »

Although i have not viewed Lazzah's demo, I made one too. This is how i would address not letting player pick something up they might of dropped in the dark or perhaps they know that an object should be there. I created an extra task where if it is dark it will say you cannot see object if you attempt to pick it up. Without it, the player can pick up something they know is there dropped or have been told.

This demo will also be handy for new drifters who want to learn how to create light sources that can be turned on and off etc. And the torch in this demo must be lit/light (ie light torch), not switched on.
Attachments
HideObjectsInDarkLocations_v4_1.taf
Bug fixes, can now also use turn on lights or turn on light switch.
(17.47 KiB) Downloaded 5 times
Last edited by DazaKiwi on Thu May 06, 2021 3:59 am, edited 6 times in total.
User avatar
Denk
Posts: 857
Joined: Mon Feb 22, 2016 6:21 pm
Points: 346
Location: Hjørring, Denmark

Re: Dropping object in a dark location

Post by Denk »

DazaKiwi wrote: Tue May 04, 2021 1:12 amThis demo will also be handy for new drifters who want to learn how to create light sources that can be turned on and off etc. And the torch in this demo must be lit/light (ie light torch), not switched on.
The demo works fine except that when you are in the cave and the torch is lit, you still can't pick anything up. It should be possible to fix this by changing the restrictions in your specific task "Tell Player they cannot See Object if in the Dark".
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
DazaKiwi
Posts: 830
Joined: Thu Oct 21, 2010 10:05 am
Points: 71
Location: New Zealand

Re: Dropping object in a dark location

Post by DazaKiwi »

Whoops. Okay i have fixed the problem and have uploaded new version. I am now used a variable to control that task that prevents player from taking anything in the dark.
User avatar
Denk
Posts: 857
Joined: Mon Feb 22, 2016 6:21 pm
Points: 346
Location: Hjørring, Denmark

Re: Dropping object in a dark location

Post by Denk »

The new version also has some problems. If the torch is off, you cannot pick anything up in any of the locations. And if it is on, it doesn't matter where the torch is. I think you will need more than one restriction. I got it to work with the following restrictions, which will get more complicated if there are more than one light source:
Restrictions.png
Restrictions.png (13.36 KiB) Viewed 213 times
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
DazaKiwi
Posts: 830
Joined: Thu Oct 21, 2010 10:05 am
Points: 71
Location: New Zealand

Re: Dropping object in a dark location

Post by DazaKiwi »

Ok i have updated the demo to include two different type of light sources, i think this system could allow many different kinds as i have added a property...Object is a Light Source and also Object burns a fuel source. Usually there is only two right? Electric or fire.

I have also added a cabin to the South that has a light switch, which is on initally.

So you have the fire torch and flashlight/light switch, the wording will be different when lighting or turning them on based on how it is lit.
User avatar
Denk
Posts: 857
Joined: Mon Feb 22, 2016 6:21 pm
Points: 346
Location: Hjørring, Denmark

Re: Dropping object in a dark location

Post by Denk »

I agree it could be a good demo for newbies if you can get rid of the bugs. I found a few problems - perhaps there are more:
Spoiler
Light Source Demo

Updated version: includes a flashlight and a cabin with lights

You are carrying a shield, fire torch, and a flashlight. You think you may have left your spear in the cave. To the South you see a cabin with its lights on.

Outside Cave
Exits are east and south.

> s
You move south.

Cabin
On the wall is a light switch. It is switched on.
An exit leads north.

> drop all
Ok, you put down the shield, the fire torch and the flashlight.

> get shield
It is too dark to see the shield.
@ The light is on but I cannot get the shield etc.

> get all
It is too dark to see the shield, the fire torch and the flashlight.

> x light
You see no such thing.

> x switch
You see no such thing.

> x light switch
A rather antique light switch. You can turn off the light switch if you wish.
@ perhaps make "light" and "switch" extra nouns for "light switch" so you can e.g. "switch off light" etc.
NB: At the moment "switch off light switch" gives no response.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
DazaKiwi
Posts: 830
Joined: Thu Oct 21, 2010 10:05 am
Points: 71
Location: New Zealand

Re: Dropping object in a dark location

Post by DazaKiwi »

Thanks Denk. I think i have got all the bugs now. I have gotten rid of the variable i was using to control if a room was lit or not and now using a location property for that. And i notice the overriding tasks for using the switch command was calling the custom tasks, was an early version and was missing the param. Also you can now use turn off lights in the cabin. I tested it out dropping and picking up with lights on and off in cabin and in the cave with the flashlight. So it all should finally work now.
User avatar
Denk
Posts: 857
Joined: Mon Feb 22, 2016 6:21 pm
Points: 346
Location: Hjørring, Denmark

Re: Dropping object in a dark location

Post by Denk »

DazaKiwi wrote: Thu May 06, 2021 3:04 am Thanks Denk. I think i have got all the bugs now. I have gotten rid of the variable i was using to control if a room was lit or not and now using a location property for that. And i notice the overriding tasks for using the switch command was calling the custom tasks, was an early version and was missing the param. Also you can now use turn off lights in the cabin. I tested it out dropping and picking up with lights on and off in cabin and in the cave with the flashlight. So it all should finally work now.
It is definitely better now, but there are still some bugs in there, you might want to fix:
Spoiler
> restart
HideObjectsInDarkLocations_v4_1
Light Source Demo
Updated version: includes a flashlight and a cabin with lights
You are carrying a shield, fire torch, and a flashlight. You think you may have left your spear in the cave. To the South you see a cabin with its lights on.

Outside Cave
Exits are east and south.

> switch flashlight
@ no output

> x torch
A typical wooden torch that burns fire at the command of light torch.

> light torch
There are no lights to interact with here!
@ doesn't work in this location despite what was said when examining the torch

> s
You move south.

Cabin
On the wall is a light switch. It is switched on. An exit leads north.

> light torch
You light the fire torch.
(You can snuff out fire torch.)

Cabin
On the wall is a light switch. It is switched on. An exit leads north.
@ I could light it here

> n
You move north.

Outside Cave
Exits are east and south.

> e
You move east.

Cave
There is a spear here. An exit leads west.

> get spear

It is too dark to see the spear.
@ I entered with a lit torch, I can see the spear but not take it.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
DazaKiwi
Posts: 830
Joined: Thu Oct 21, 2010 10:05 am
Points: 71
Location: New Zealand

Re: Dropping object in a dark location

Post by DazaKiwi »

The bugs keep on popping up lol, I guess this is what i get for trying to have 3 different lighting systems in one. But i am sure i can iron out those bugs in time, but for another time.
Post Reply