How do I avoid stripping when player uses put all in object?

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: 4981
Joined: Mon Jun 24, 2002 9:18 am
Points: 168
Location: Denmark

How do I avoid stripping when player uses put all in object?

Post by P/o Prune »

I have made specific tasks overriding the general remove task hoping to avoid the player to be able to take off his/her clothes. (Somebody is bound to try it.)
It works for the various pieces of clothing if the player uses the command >remove, but if s/he comes across a container and uses >put all in %object% s/he will remove all possession and put them in said container.
Is there a way to get around that?
D-Day in progress 86Kb (Slowly drifting)
October 31st: 135Kb (My entry for the parser Comp 2022 :wink: )
User avatar
Denk
Posts: 1027
Joined: Mon Feb 22, 2016 6:21 pm
Points: 346
Location: Hjørring, Denmark

Re: How do I avoid stripping when player uses put all in object?

Post by Denk »

P/o Prune wrote: Fri Oct 15, 2021 8:47 am I have made specific tasks overriding the general remove task hoping to avoid the player to be able to take off his/her clothes. (Somebody is bound to try it.)
It works for the various pieces of clothing if the player uses the command >remove, but if s/he comes across a container and uses >put all in %object% s/he will remove all possession and put them in said container.
Is there a way to get around that?
It can be argued, but I would call that behaviour a bug. And I just realized that this bug has been with us all along, also in Campbell's original Standard Library and the newest version of Combi-Lib(v4.2). Funny no one has mentioned it (or perhaps they did long time ago).

It is good that you can e.g. type:
>put hat in box
(removing the hat from you first)
You put the hat inside the box.

But if the player types: >put all in box
Then only the directly held objects should be put in the box.

I am fixing this for Combi-Lib 4.3 but if you have already started a game, there is an easy way to fix this:
1. In the Developer, go to the folder "Standard Library->Give, Take and Drop"
2. In here, locate the task "Remove before put" and open it
3. Go to the "Advanced"-pane and UNTICK "Prevent this task from being inherited" (if it hasn't been done already)
4. Click okay. Now you can override that task
5. Create a new specific task which overrides "Remove before put"
6. Leave the message field blank and give the task an appropriate name, e.g. "Avoid stripping"
7. Make one restriction without restrictions message: Referenced objects must be exact text all
8. Click okay and the problem is fixed (Please test it, in case you made a mistake)

Explanation: In the special case that the player types ALL, the specific task you just created runs and instead of removing the objects, it does nothing.

I attach a demo demonstrating this:
avoid_put_worn.taf
(45.22 KiB) Downloaded 7 times

You can copy the specific task into your own game, that should work, but please test it if you do so.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
DazaKiwi
Posts: 863
Joined: Thu Oct 21, 2010 10:05 am
Points: 71
Location: New Zealand

Re: How do I avoid stripping when player uses put all in object?

Post by DazaKiwi »

I guess without using the Combi-Library, you could just have an overriding task with one of its restrictions; objects must not be worn by player. I haven't tried this, just saying off the top of my head.
User avatar
Denk
Posts: 1027
Joined: Mon Feb 22, 2016 6:21 pm
Points: 346
Location: Hjørring, Denmark

Re: How do I avoid stripping when player uses put all in object?

Post by Denk »

DazaKiwi wrote: Fri Oct 15, 2021 9:17 pm I guess without using the Combi-Library, you could just have an overriding task with one of its restrictions; objects must not be worn by player. I haven't tried this, just saying off the top of my head.
The problem is the same no matter which of the libraries you are using (Campbell's, saabie's or Combi-Lib):

There is a task called "Remove before put" which by default cannot be overriden because it is set to "Prevent from being inherited". Also, it doesn't help to override the "put objects in others"-task as the task "Remove before put" runs before the overriding task (multiple matching).

All you have to do is override the "remove before put" with appropriate restrictions but first you must untick the option that prevents it from being overridden. Also, you want it to work when NOT using the word all, so a restriction should check if "all" was applied.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Post Reply