ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Player Char takes object too easily

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.

Player Char takes object too easily

Postby ParadoxGames » Sat Feb 25, 2017 2:28 pm

I have a problem that didn't exist before and now it does. I was playtesting my game, and there is an object that requires several restrictions to be passed before it can be taken from another object. in earlier playtests, ADRIFT wouldn't let the object be taken, but now, on my new computer, it does.

I ran the command with the debugger on. When the restrictions fail, the program halts the action of the command to take the object, as hoped. But then ADRIFT proceeds to run a test on "take object from another object (lazy) and lets it pass. How can I ensure to ADRIFT that failing the restrictions prevents it from trying lower-priority tasks that it may pass and override the puzzle/challenge? Is there a command that interrupts the process?
ParadoxGames
 
Posts: 161
Joined: Sat Sep 05, 2015 2:33 am

Re: Player Char takes object too easily

Postby Lazzah » Sat Feb 25, 2017 7:30 pm

What operating system does your new computer have - I would guess Windows 10? Is this different from your old computer, maybe Windows 7?
OUT NOW: The Lost Children
Current W.I.P.: Magnetic Moon
Also available: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust - The Fist of Fire
User avatar
Lazzah
Moderator
 
Posts: 2014
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England

Re: Player Char takes object too easily

Postby ParadoxGames » Sat Feb 25, 2017 9:39 pm

believe it or not, I went from win 8 to Windows 7.
ParadoxGames
 
Posts: 161
Joined: Sat Sep 05, 2015 2:33 am

Re: Player Char takes object too easily

Postby ParadoxGames » Sun Feb 26, 2017 2:39 am

Here is the text from the debugger. The pliers are on the vending machine but aren't supposed to be reached unless 1) the player noticed that the pliers were on the machine, 2) The recliner is pushed against the machine, 3) the character is standing on the machine. I tried putting extra tasks in which override default tasks. Here's the sequence of events, followed by its appearance in the debugger, with minimal notes. If anyone can help, let me know. Notice the same event reacts three different ways.

-----------
TAKE PLIERS
I don't understand what you want to do with the pair of pliers.

TAKE PLIERS
From where you stand, the pliers are too far to reach.
(This is trhe desired response)

TAKE PLIERS
Ok, you take the pliers from the vending machine.


--------------


TAKE PLIERS #1
I don't understand what you want to do with the pair of pliers.


Synonyms changed input "take pliers" to "get pliers"
Task 'get a pair of pliers' matches input.
The Player Character must have seen object 'a pair of pliers': Passed
The Player Character must be in the same location as object 'a pair of pliers': Passed
The Player Character must not be holding object 'a pair of pliers': Passed
Character 'Charlie' must not be holding object 'a pair of pliers': Passed
The Player Character must not be standing on object 'a love seat': Passed
The Player Character must be standing on object 'a recliner': Failed
Task does not pass restrictions.

(at this point, the response "From where you stand, the pliers are too far to reach." should be read.)

Task 'Eye Chart Level 7 Read' matches input.
Variable 'EyeChartLevel' must be equal to 7: Failed
Task does not pass restrictions.
Task 'get a pair of pliers from vending machine' matches input.

(this task was put in as a redundancy check to test the results)

The Player Character must have seen object 'a pair of pliers': Passed
The Player Character must be in the same location as object 'a pair of pliers': Passed
The Player Character must not be holding object 'a pair of pliers': Passed
Character 'Charlie' must not be holding object 'a pair of pliers': Passed
The Player Character must not be standing on object 'a love seat': Passed
The Player Character must be standing on object 'a recliner': Failed
Task doesn't pass restrictions, but is current highest priority failing task with restriction output.
Attempting to execute task get a pair of pliers from vending machine...
Checking reference free task get a pair of pliers from vending machine
The Player Character must have seen object 'a pair of pliers': Passed
The Player Character must be in the same location as object 'a pair of pliers': Passed
The Player Character must not be holding object 'a pair of pliers': Passed
Character 'Charlie' must not be holding object 'a pair of pliers': Passed
The Player Character must not be standing on object 'a love seat': Passed
The Player Character must be standing on object 'a recliner': Failed
Failed Restrictions
No matches found. Checking again using existance.


--------------


TAKE PLIERS #2
From where you stand, the pliers are too far to reach.
(This is trhe desired response)


Synonyms changed input "take pliers" to "get pliers"
Task 'get a pair of pliers' matches input.
The Player Character must have seen object 'a pair of pliers': Passed
The Player Character must be in the same location as object 'a pair of pliers': Passed
The Player Character must not be holding object 'a pair of pliers': Passed
Character 'Charlie' must not be holding object 'a pair of pliers': Passed
The Player Character must not be standing on object 'a love seat': Passed
The Player Character must be standing on object 'a recliner': Failed
Task does not pass restrictions.
Task 'Eye Chart Level 7 Read' matches input.
Variable 'EyeChartLevel' must be equal to 7: Failed
Task does not pass restrictions.
Task 'get a pair of pliers from vending machine' matches input.
The Player Character must have seen object 'a pair of pliers': Passed
The Player Character must be in the same location as object 'a pair of pliers': Passed
The Player Character must not be holding object 'a pair of pliers': Passed
Character 'Charlie' must not be holding object 'a pair of pliers': Passed
The Player Character must not be standing on object 'a love seat': Passed
The Player Character must be standing on object 'a recliner': Failed
Task does not pass restrictions.
Task 'Take Objects (Parent Task)' matches input.
Referenced Objects must exist: Passed
Referenced Objects must have been seen by the Player character: Passed
Referenced Objects must be visible to the Player character: Passed
Property 'Object type' for Referenced Objects must be 'Dynamic': Passed
Referenced Objects must be exact text 'All': Failed
Referenced Objects must not be exact text 'All': Passed
Referenced Objects must not be held by the Player character: Passed
Referenced Objects must not be worn by the Player character: Passed
Referenced Objects must exist: Passed
Referenced Objects must have been seen by the Player character: Passed
Referenced Objects must be visible to the Player character: Passed
Property 'Object type' for Referenced Objects must be 'Dynamic': Passed
Referenced Objects must be exact text 'All': Failed
Referenced Objects must not be exact text 'All': Passed
Referenced Objects must not be held by the Player character: Passed
Referenced Objects must not be worn by the Player character: Passed
Task passes restrictions.
Attempting to execute task Take Objects (Parent Task)...
Checking single reference task [get/take/pick up] a pair of pliers
Referenced Objects must exist: Passed
Referenced Objects must have been seen by the Player character: Passed
Referenced Objects must be visible to the Player character: Passed
Property 'Object type' for Referenced Objects must be 'Dynamic': Passed
Referenced Objects must be exact text 'All': Failed
Referenced Objects must not be exact text 'All': Passed
Referenced Objects must not be held by the Player character: Passed
Referenced Objects must not be worn by the Player character: Passed
Passed Restrictions
Overriding child task found: Take Objects From Location
Attempting to execute task Take Objects From Location...
Checking single reference task [get/take/pick up] a pair of pliers
Referenced Objects must not be inside Any Object: Passed
Referenced Objects must not be on Any Object: Failed
Failed Restrictions
First Reference: a pair of pliers(no output)
Continue executing other child tasks.
Overriding child task found: Take Objects From Object (Lazy)
Attempting to execute task Take Objects From Object (Lazy)...
Checking single reference task [get/take/pick up] a pair of pliers
Referenced Objects must not be exact text 'All': Passed
Referenced Objects must be inside Any Object: Failed
Referenced Objects must be on Any Object: Passed
Passed Restrictions
First Reference: a pair of pliers(no output)
First Reference: a pair of pliers(no output)
Second Reference: a vending machine(no output)
Attempting to execute task Take Objects From Object...
Checking double reference task [get/take/pick up/remove] a pair of pliers from a vending machine
Referenced Objects must exist: Passed
Referenced Object 2 must exist: Passed
Referenced Objects must have been seen by the Player character: Passed
Referenced Object 2 must have been seen by the Player character: Passed
Referenced Objects must be visible to the Player character: Passed
Referenced Object 2 must be visible to the Player character: Passed
Property 'Object type' for Referenced Objects must be 'Dynamic': Passed
Referenced Objects must not be worn by the Player character: Passed
Referenced Objects must be inside Referenced Object 2: Failed
Referenced Objects must be on Referenced Object 2: Passed
The Player Character must not have property 'Maximum weight of held items': Failed
Property 'Maximum weight of held items' for the Player character must be >= '%objects%.Weight.Sum+%objects

%.Children.Weight.Sum': Passed
Property 'Maximum weight of held items' for the Player character must be >= '%Player%.Held.Weight.Sum+%objects

%.Weight.Sum+%objects%.Children.Weight.Sum': Passed
The Player Character must not have property 'Maximum size of held items': Failed
Property 'Maximum size of held items' for the Player character must be >= '%objects%.Size.Sum': Passed
Property 'Maximum size of held items' for the Player character must be >= '%Player%.Held.Size.Sum+%objects

%.Size.Sum': Passed
Passed Restrictions
Overriding child task found: get a pair of pliers (from object)
Attempting to execute task get a pair of pliers (from object)...
Checking double reference task [get/take/pick up/remove] a pair of pliers from a vending machine
The Player Character must have seen object 'a pair of pliers': Passed
The Player Character must be in the same location as object 'a pair of pliers': Passed
The Player Character must not be holding object 'a pair of pliers': Passed
Character 'Charlie' must not be holding object 'a pair of pliers': Passed
The Player Character must not be standing on object 'a love seat': Passed
The Player Character must be standing on object 'a recliner': Failed
Failed Restrictions
First Reference: a pair of pliers(no output)
Second Reference: a vending machine(no output)
Do not continue executing other child tasks.
Do not continue executing other child tasks.


--------------


TAKE PLIERS #3
Ok, you take the pliers from the vending machine.


Synonyms changed input "take pliers" to "get pliers"
Task 'get a pair of pliers' matches input.
The Player Character must have seen object 'a pair of pliers': Passed
The Player Character must be in the same location as object 'a pair of pliers': Passed
The Player Character must not be holding object 'a pair of pliers': Passed
Character 'Charlie' must not be holding object 'a pair of pliers': Passed
The Player Character must not be standing on object 'a love seat': Passed
The Player Character must be standing on object 'a recliner': Failed
Task does not pass restrictions.
Task 'Eye Chart Level 7 Read' matches input.
Variable 'EyeChartLevel' must be equal to 7: Failed
Task does not pass restrictions.
Task 'get a pair of pliers from vending machine' matches input.
The Player Character must have seen object 'a pair of pliers': Passed
The Player Character must be in the same location as object 'a pair of pliers': Passed
The Player Character must not be holding object 'a pair of pliers': Passed
Character 'Charlie' must not be holding object 'a pair of pliers': Passed
The Player Character must not be standing on object 'a love seat': Passed
The Player Character must be standing on object 'a recliner': Failed
Task does not pass restrictions.
Task 'Take Objects (Parent Task)' matches input.
Referenced Objects must exist: Passed
Referenced Objects must have been seen by the Player character: Passed
Referenced Objects must be visible to the Player character: Passed
Property 'Object type' for Referenced Objects must be 'Dynamic': Passed
Referenced Objects must be exact text 'All': Failed
Referenced Objects must not be exact text 'All': Passed
Referenced Objects must not be held by the Player character: Passed
Referenced Objects must not be worn by the Player character: Passed
Referenced Objects must exist: Passed
Referenced Objects must have been seen by the Player character: Passed
Referenced Objects must be visible to the Player character: Passed
Property 'Object type' for Referenced Objects must be 'Dynamic': Passed
Referenced Objects must be exact text 'All': Failed
Referenced Objects must not be exact text 'All': Passed
Referenced Objects must not be held by the Player character: Passed
Referenced Objects must not be worn by the Player character: Passed
Task passes restrictions.
Attempting to execute task Take Objects (Parent Task)...
Checking single reference task [get/take/pick up] a pair of pliers
Referenced Objects must exist: Passed
Referenced Objects must have been seen by the Player character: Passed
Referenced Objects must be visible to the Player character: Passed
Property 'Object type' for Referenced Objects must be 'Dynamic': Passed
Referenced Objects must be exact text 'All': Failed
Referenced Objects must not be exact text 'All': Passed
Referenced Objects must not be held by the Player character: Passed
Referenced Objects must not be worn by the Player character: Passed
Passed Restrictions
Overriding child task found: Take Objects From Location
Attempting to execute task Take Objects From Location...
Checking single reference task [get/take/pick up] a pair of pliers
Referenced Objects must not be inside Any Object: Passed
Referenced Objects must not be on Any Object: Failed
Failed Restrictions
First Reference: a pair of pliers(no output)
Continue executing other child tasks.
Overriding child task found: Take Objects From Object (Lazy)
Attempting to execute task Take Objects From Object (Lazy)...
Checking single reference task [get/take/pick up] a pair of pliers
Referenced Objects must not be exact text 'All': Passed
Referenced Objects must be inside Any Object: Failed
Referenced Objects must be on Any Object: Passed
Passed Restrictions
First Reference: a pair of pliers(no output)
First Reference: a pair of pliers(no output)
Second Reference: a vending machine(no output)
Attempting to execute task Take Objects From Object...
Checking double reference task [get/take/pick up/remove] a pair of pliers from a vending machine
Referenced Objects must exist: Passed
Referenced Object 2 must exist: Passed
Referenced Objects must have been seen by the Player character: Passed
Referenced Object 2 must have been seen by the Player character: Passed
Referenced Objects must be visible to the Player character: Passed
Referenced Object 2 must be visible to the Player character: Passed
Property 'Object type' for Referenced Objects must be 'Dynamic': Passed
Referenced Objects must not be worn by the Player character: Passed
Referenced Objects must be inside Referenced Object 2: Failed
Referenced Objects must be on Referenced Object 2: Passed
The Player Character must not have property 'Maximum weight of held items': Failed
Property 'Maximum weight of held items' for the Player character must be >= '%objects%.Weight.Sum+%objects

%.Children.Weight.Sum': Passed
Property 'Maximum weight of held items' for the Player character must be >= '%Player%.Held.Weight.Sum+%objects

%.Weight.Sum+%objects%.Children.Weight.Sum': Passed
The Player Character must not have property 'Maximum size of held items': Failed
Property 'Maximum size of held items' for the Player character must be >= '%objects%.Size.Sum': Passed
Property 'Maximum size of held items' for the Player character must be >= '%Player%.Held.Size.Sum+%objects

%.Size.Sum': Passed
Passed Restrictions
Overriding child task found: get a pair of pliers (from object)
Attempting to execute task get a pair of pliers (from object)...
Checking double reference task [get/take/pick up/remove] a pair of pliers from a vending machine
The Player Character must have seen object 'a pair of pliers': Passed
The Player Character must be in the same location as object 'a pair of pliers': Passed
The Player Character must not be holding object 'a pair of pliers': Passed
Character 'Charlie' must not be holding object 'a pair of pliers': Passed
The Player Character must not be standing on object 'a love seat': Passed
The Player Character must be standing on object 'a recliner': Failed
Failed Restrictions
First Reference: a pair of pliers(no output)
Second Reference: a vending machine(no output)
Continue executing other child tasks.
First Reference: a pair of pliers(no output)
Second Reference: a vending machine(no output)
Do not continue executing other child tasks.
ParadoxGames
 
Posts: 161
Joined: Sat Sep 05, 2015 2:33 am

Re: Player Char takes object too easily

Postby ice_wanted » Sun Feb 26, 2017 2:37 pm

Hi,
1: Why do you use a synonym to modify "take" to "get"?
2: The "get objects from object (Lazy)" task get executed because it match restrictions as well as your custom task. You want to try not to have 2 tasks matching all restrictions.

1-It would be best if your task used the " [get/take/pick up] %objects% " formalism instead of a synonym, just like the default library "take object (parent task)" task. This would avoid some weird behaviours and probably fix part of your issue.

Here is how I would fix your issue:
1-Delete the synonym (including all other one that match a default library action)
2-Use a Specific Task (GREEN) for your custom task (ie: a child of a default task). Children always overrides the parent task. This prevents you from having 2 tasks that meet the restrictions (like you currently have). To do this:
a) Create the Specific task (GREEN/children task) and parent it to "take objects from object"
b) make sure you select the pliers as the first object in the task action. (replace the blue underlined "object" text) + make sure you select the vending machine as the second object.
c) add all your restrictions. Make sure that key restrictions have an output message. Without output message in the restrictions, if the task fails, the default/parent task will be executed.
d) Uncheck the "task is repeatable" option if you want this task to run only once.

How it this will work:
1- the default library task "take objects (Parent task)" will execute first as it match your criteria.
2- it will check for children and find the "Take object from location (lazy)" match your criteria. This will in turn execute the "Take object from object".
3- It will check for children again and find your custom task. It will match the criteria or fail on a restriction. In both cases, the output will be what you want.

Doing it way, your task works with the player typing all these combinations:
- Get pliers
- Take pliers
- Pick up pliers
- Pick pliers
- Get pliers from vending machine
- Take pliers from vending machine
- Pick up pliers from vending machine
- Pick pliers from vending machine

Hope it helps.
ice_wanted
 
Posts: 81
Joined: Thu Aug 22, 2013 1:12 am

Re: Player Char takes object too easily

Postby saabie » Sun Feb 26, 2017 11:24 pm

One thing that can make a game stop working is the task execution logic option.
If this is different on the new computer then it can change the order that tasks work.
If a command does something different when you try it two times in a row then one of your tasks may not have "Task is repeatable" ticked in the bottom left corner.
If tasks are running in the wrong order then check their "Priority" settings on their "Advanced" page.
I agree with everything ice_wanted said, always have one general task for each command and override it with specific tasks when you want something different to happen for a particular object, location or if a restriction is preventing the player from being able to take something.
saabie
 
Posts: 830
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia

Re: Player Char takes object too easily

Postby ParadoxGames » Sun Jul 16, 2017 2:33 pm

Your advice resolved the issue easily. I never got to thank you. Life happened. But it worked and I appreciate it. Thanks. My coding may be a little sloppy to you guys who may understand programming better than I, but hopefully this project, and your help, makes me better skilled in future projects.
ParadoxGames
 
Posts: 161
Joined: Sat Sep 05, 2015 2:33 am


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 4 guests