ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

"swapping" objects with characters

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.

"swapping" objects with characters

Postby P/o Prune » Tue Dec 17, 2019 5:20 pm

Ok, I've got a new problem...
As an extension of the put object in character problem.
When the player enters a location he will find a grandfather clock (object) at the side of the road.
I want to swap that object with the character Father time and have done so by moving object grandfather clock to location hidden when a certain task is been fulfilled and move character Father time to the location in stead.
Father time character is as follows:
Proper name: Father time
Article: A
Prefix: grandfather
noun: clock

(I have used this because in general Father time is a grandfather clock.)

My problem is that when I >x clock / grandfather clock / father time (take your pick) I get the message "You can't see the grandfather clock" or when I try: >X Father time, I get the reply: "You see no such thing"
When I change the object name to "clock-1" things work out as they're supposed to. So apparently Adrift 5 remembers the object even though it's moved to location hidden.
Is there a way around this?
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 73Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4463
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: "swapping" objects with characters

Postby DazaKiwi » Wed Dec 18, 2019 5:59 am

So where does the debugger say where the character fathertime is once the switch is suppose to happen?

You are wanting to switch the clock object with fathertime character right. How have you set this up? eg. Actions
1) move Fathertime to same location as grandfather clock
2) move grandfather clock to hidden
User avatar
DazaKiwi
 
Posts: 669
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 21

Re: "swapping" objects with characters

Postby Denk » Wed Dec 18, 2019 7:03 pm

P/o Prune wrote:Ok, I've got a new problem...
As an extension of the put object in character problem.
When the player enters a location he will find a grandfather clock (object) at the side of the road.
I want to swap that object with the character Father time and have done so by moving object grandfather clock to location hidden when a certain task is been fulfilled and move character Father time to the location in stead.
Father time character is as follows:
Proper name: Father time
Article: A
Prefix: grandfather
noun: clock

(I have used this because in general Father time is a grandfather clock.)

My problem is that when I >x clock / grandfather clock / father time (take your pick) I get the message "You can't see the grandfather clock" or when I try: >X Father time, I get the reply: "You see no such thing"
When I change the object name to "clock-1" things work out as they're supposed to. So apparently Adrift 5 remembers the object even though it's moved to location hidden.
Is there a way around this?

EDIT: (thanks to Lazzah, my understanding of this problem has been improved)
Unfortunately, there is a limitation (or bug if you like) in ADRIFT, so if [Descriptor/Noun] of a character is the same as a [Name/Noun(s)] of an object, EVEN if the object has been hidden at all times, that specific [Descriptor/Noun] for the character will be ignored, as if it had never been typed in the [Descriptor/Noun] field. The problem only occurs for those tasks, which have a corresponding task for objects.

A "workaround" is to give them different names but that is sometimes not appropriate. Another solution: You could also use general tasks to force certain behaviour, e.g. have general tasks such as "[x/examine] {grandfather} [clock]" which kicks in, if the character is in the same location as the player. Make sure that you apply general tasks to replace all relevant tasks. It may not be just EXAMINE which causes problems.

The following tasks will behave differently, depending on whether both an object and a character have the same name, or if the character name is unique, e.g. there is no object with the same name:

* put object in object
* remove object
* put object on object
* unlock object
* lock clock
* examine object/character
* get out of object
* get off clock

However, the object response of these may not necessarily be inappropriate.

Sorry - I hope the above is understandable :wink:
Last edited by Denk on Thu Dec 19, 2019 2:57 pm, edited 1 time in total.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 293
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 86

Re: "swapping" objects with characters

Postby Lazzah » Thu Dec 19, 2019 11:48 am

Denk wrote:well, you could also use general tasks to force a certain behaviour, e.g. have general tasks such as "[x/examine] {grandfather} [clock]" which kicks in, if the character is in the same location as the player. - but this would be quite a bit of work

Surely creating a general task for X {GRANDFATHER} [CLOCK] would not class as "quite a bit of work". I do this sort of thing quite frequently in my games and it takes a few minutes to do. Just copy and paste the command lines from the standard EXAMINE OBJECTS task into a new general task, add the object name and a couple of restrictions and there you have it! Oh, and don't forget to alter the task priority to a smaller number so that the task executes properly. Simples!
The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, The Call of the Shaman, The Lost Labyrinth of Lazaitch, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
User avatar
Lazzah
Moderator
 
Posts: 2269
Joined: Thu Mar 31, 2011 4:54 am
Location: Dagenham, Essex
Points: 65

Re: "swapping" objects with characters

Postby P/o Prune » Thu Dec 19, 2019 1:23 pm

DazaKiwi wrote:So where does the debugger say where the character fathertime is once the switch is suppose to happen?

You are wanting to switch the clock object with fathertime character right. How have you set this up? eg. Actions
1) move Fathertime to same location as grandfather clock
2) move grandfather clock to hidden


The player has to perform an action.
When this is done the following will (is supposed to) happen.
Move (object) a grandfather clock to location hidden.
Move (character) father time (grandfather clock) to location: dark road.

It works as far as the object is moved to hidden and the character is moved to the location. But that's where it ends.
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 73Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4463
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: "swapping" objects with characters

Postby P/o Prune » Thu Dec 19, 2019 1:27 pm

Lazzah wrote:
Denk wrote:well, you could also use general tasks to force a certain behaviour, e.g. have general tasks such as "[x/examine] {grandfather} [clock]" which kicks in, if the character is in the same location as the player. - but this would be quite a bit of work

Surely creating a general task for X {GRANDFATHER} [CLOCK] would not class as "quite a bit of work". I do this sort of thing quite frequently in my games and it takes a few minutes to do. Just copy and paste the command lines from the standard EXAMINE OBJECTS task into a new general task, add the object name and a couple of restrictions and there you have it! Oh, and don't forget to alter the task priority to a smaller number so that the task executes properly. Simples!

I've tried that Lazzah, Priority for the examine objects is by default set to: 50058
I have set it to 50020 and I still get the "You can't see the grandfather clock" :cry:

Maybe the solution is to change the name of the object, but what other name could you give a grandfather clock? :|
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 73Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4463
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: "swapping" objects with characters

Postby Lazzah » Thu Dec 19, 2019 1:45 pm

I would have changed the task priority to 5020, see if that works? How about the task priority for the EXAMINE OBJECTS and EXAMINE CHARACTER tasks? The one for the latter needs to be a smaller number than that for EXAMINE OBJECTS. How about the restrictions for the X GRANDFATHER CLOCK character task. Did you include OBJECT a grandfather clock MUST NOT BE VISIBLE TO the PC and vice versa for the X GRANDFATHER CLOCK object task?
The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, The Call of the Shaman, The Lost Labyrinth of Lazaitch, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
User avatar
Lazzah
Moderator
 
Posts: 2269
Joined: Thu Mar 31, 2011 4:54 am
Location: Dagenham, Essex
Points: 65

Re: "swapping" objects with characters

Postby Denk » Thu Dec 19, 2019 2:42 pm

Lazzah wrote:
Denk wrote:well, you could also use general tasks to force a certain behaviour, e.g. have general tasks such as "[x/examine] {grandfather} [clock]" which kicks in, if the character is in the same location as the player. - but this would be quite a bit of work

Surely creating a general task for X {GRANDFATHER} [CLOCK] would not class as "quite a bit of work". I do this sort of thing quite frequently in my games and it takes a few minutes to do. Just copy and paste the command lines from the standard EXAMINE OBJECTS task into a new general task, add the object name and a couple of restrictions and there you have it! Oh, and don't forget to alter the task priority to a smaller number so that the task executes properly. Simples!


I expected that the problem would be present for ALL tasks in the standard library. However, I just made a test to check how big the problem is. It turns out, that the problem only exists for the the following tasks, i.e. you will get the response for the object and not the character (i.e. the response will be different if you delete the clock object):

* put object in object
* remove object
* put object on object
* unlock object
* lock clock
* examine object/character
* get out of object
* get off clock

Some of these responses are not appropriate, e.g.:

put pendulum in clock
You cannot see the clock!

But some of the responses are okay, e.g.:

get out of clock
You are not inside the clock!

For the clock example, I would say that the only tasks with inappropriate responses are:

* put object in clock
* put object on clock
* examine clock

Now that I see, that the problem only occurs for three tasks, I agree that it is not a lot of work to handle it with general tasks.

From the test I realized that the problem for characters occurs when there exists a similar task for objects. For instance, if you both have a "TALK TO CHARACTER" task and a "TALK TO OBJECT" task, then the task with the lowest priority will have a problem. Furthermore, if there exists a task for the object but not for the character, the response will sometimes (but not always) be different if an object and a character has the same noun.

I will edit my post above to reflect this.
Last edited by Denk on Thu Dec 19, 2019 2:57 pm, edited 1 time in total.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 293
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 86

Re: "swapping" objects with characters

Postby P/o Prune » Thu Dec 19, 2019 2:49 pm

I'm going to write Campbell to see if he has a fix for this.
If not, I have two choices: 1: delete the object and change whatever needs changing about the character. Or 2: Delete the character and keep the object and work out tasks for all the conversation topics.
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 73Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4463
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: "swapping" objects with characters

Postby Denk » Thu Dec 19, 2019 3:01 pm

P/o Prune wrote:I'm going to write Campbell to see if he has a fix for this.
If not, I have two choices: 1: delete the object and change whatever needs changing about the character. Or 2: Delete the character and keep the object and work out tasks for all the conversation topics.

A 3rd option is to solve the problem with general tasks, which doesn't require that much as Lazzah pointed out. The examine task is the most important here. The "put object on object" and "put object in object" responses are a bit inappropriate but can be handled with conditional text overrides.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 293
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 86

Re: "swapping" objects with characters

Postby Lazzah » Thu Dec 19, 2019 3:02 pm

Like I said before, why can't the GRANDFATHER CLOCK character be an object? Ok, you would have to handle any conversation with tasks, but wouldn't this be better than messing about like you have been doing trying to get the character/object scenario to work?
The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, The Call of the Shaman, The Lost Labyrinth of Lazaitch, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
User avatar
Lazzah
Moderator
 
Posts: 2269
Joined: Thu Mar 31, 2011 4:54 am
Location: Dagenham, Essex
Points: 65

Re: "swapping" objects with characters

Postby P/o Prune » Thu Dec 19, 2019 3:08 pm

Lazzah wrote:Like I said before, why can't the GRANDFATHER CLOCK character be an object? Ok, you would have to handle any conversation with tasks, but wouldn't this be better than messing about like you have been doing trying to get the character/object scenario to work?

That's probably what I will end up doing. But I wanted to see if this would work.
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 73Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4463
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: "swapping" objects with characters

Postby P/o Prune » Fri Dec 20, 2019 9:23 am

I wrote Campbell and he sent me this solution which should work.

Hi Finn,

If you go to Options > Advanced, change the Task Execution logic to the second option. This will allow the examine characters task (which is a lower priority than the examine objects task) take precedence over the objects task because it succeeds, rather than running the higher priority task that fails. Obviously this will affect all tasks in the game tho, so you'd need to check it didn't have any adverse affects elsewhere.

Alternatively, you could add a new restriction to the ExamineObjects library task that runs before the other restrictions, such as "Character Father Time must not have seen Player". This should then prevent the objects task from having a failure output when you have seen the character. That's very simplistic - you'd need to add other restrictions on the referenced object. I'd go for the first option I think.

Cheers,
Campbell


I will give it a go, and if everything fails I'll scratch the character and run everything through the object.
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 73Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4463
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: "swapping" objects with characters

Postby Lazzah » Fri Dec 20, 2019 11:51 am

P/o Prune wrote:I wrote Campbell and he sent me this solution which should work.

[i]Hi Finn,

If you go to Options > Advanced, change the Task Execution logic to the second option. This will allow the examine characters task (which is a lower priority than the examine objects task) take precedence over the objects task because it succeeds, rather than running the higher priority task that fails. Obviously this will affect all tasks in the game tho, so you'd need to check it didn't have any adverse affects elsewhere.

That's very interesting. I checked all of my games and - apart from 3 which had the SECOND option selected - they all had the first option selected. I changed the option on one of the games that had the second option selected and ran the game macro, but this made no difference to any of the gameplay. Same with the games that had the first option selected.
The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, The Call of the Shaman, The Lost Labyrinth of Lazaitch, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
User avatar
Lazzah
Moderator
 
Posts: 2269
Joined: Thu Mar 31, 2011 4:54 am
Location: Dagenham, Essex
Points: 65

Re: "swapping" objects with characters

Postby P/o Prune » Fri Dec 20, 2019 12:29 pm

I have run my game and as far as I can see, there's no problem whatsoever. :D
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 73Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4463
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 2 guests