ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Characters and objects with the same name.

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.

Characters and objects with the same name.

Postby Lazzah » Fri Mar 13, 2020 10:59 am

Hi all, can someone please advise me?

While running one of my older games (Die Feuerfaust) with the macro I created when I wrote the game in 2015, I found that certain commands - which must have worked back in 2015 - now do not work as they previously did and thus the macro failed.

This is where I have a character and an object of the same name. I have a static object THE WOMEN in one location as from that location the PC can see some women who have been captured by some barbarians. X WOMEN works OK at this location.

Later in the game the PC is in a location where the women have been taken to and here is where I have the character THE WOMEN. If I type X WOMEN here, ADRIFT will try to execute the X OBJECT general task as it has a higher priority than X CHARACTER, and - as the object THE WOMEN is not present - it displays the failure message "You can't see the women!".

If I tick the "Continue executing matching lower priority tasks (multiple matching) and then type X WOMEN, both the default "You can't see the women!" and the correct response to X WOMEN in this location are displayed.

Is this a bug? I realise that I can change the static object to a character and vice versa, but does anyone know of a fix to this problem?
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: 2362
Joined: Thu Mar 31, 2011 4:54 am
Location: Clacton-on-Sea, Essex
Points: 65

Re: Characters and objects with the same name.

Postby rovarsson » Sat Mar 14, 2020 4:27 pm

I do not, but I sure would like to know. This would come in very handy in TT.
rovarsson
 
Posts: 86
Joined: Mon Dec 23, 2019 10:37 pm
Location: Belgium
Points: 15

Re: Characters and objects with the same name.

Postby Denk » Sat Mar 14, 2020 8:34 pm

Lazzah wrote:Is this a bug? I realise that I can change the static object to a character and vice versa, but does anyone know of a fix to this problem?
I don't think it is a bug, just a limitation, which can be worked around. In saabie's updated library, the "get character" task has the same problem as the "Examine character" task: If an object with the same name as a character exists, the "get object" task will run instead.

EDIT:
I just realized that this could be solved extremely simple with one task. See my post below. Thus I delete this cr*p I have made in this post ;-)
Last edited by Denk on Sat Mar 14, 2020 10:04 pm, edited 2 times in total.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 465
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251

Re: Characters and objects with the same name.

Postby DazaKiwi » Sat Mar 14, 2020 8:41 pm

I just made a little demo and the only way to make this work as you intended is adding this line to the default Examine Object task: Character 'The Women' must not be in the same location as the Player Character' - note this HAS to be moved to the top of the restrictions list, if its lower it wont work and just give the usual cant see women message.

Why can't you just have the women as a character, why have them both as a character and an object?
Attachments
SameObjCharName_v1.taf
(15.21 KiB) Downloaded 56 times
User avatar
DazaKiwi
 
Posts: 743
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 61

Re: Characters and objects with the same name.

Postby Denk » Sat Mar 14, 2020 9:10 pm

DazaKiwi's method is definitely simple so it might be preferable for now. EDIT: My method a few posts below can be implemented into the Standard Library since it does not need to specify specific objects. Perhaps saabie can implement the method in his updated standard library before the final release of ADRIFT 5.0.36?
Last edited by Denk on Sat Mar 14, 2020 10:25 pm, edited 1 time in total.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 465
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251

Re: Characters and objects with the same name.

Postby Lazzah » Sat Mar 14, 2020 9:53 pm

DazaKiwi wrote:I just made a little demo and the only way to make this work as you intended is adding this line to the default Examine Object task: Character 'The Women' must not be in the same location as the Player Character' - note this HAS to be moved to the top of the restrictions list, if its lower it wont work and just give the usual cant see women message.

Why can't you just have the women as a character, why have them both as a character and an object?

Thanks for the demo.

I have now changed all the character static objects to proper Characters and added extra alternative descriptions where the characters are seen from a distant location. In the original version of the game the use of static objects for characters that were seen at a distance must have worked, otherwise why would I have had them in the game?
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: 2362
Joined: Thu Mar 31, 2011 4:54 am
Location: Clacton-on-Sea, Essex
Points: 65

Re: Characters and objects with the same name.

Postby Denk » Sat Mar 14, 2020 10:01 pm

Hehe - funny how things become simpler when you keep working with it. There is no reason to mess with the standard library. You can just copy this task into your game and the problem is gone:
Obj_to_character V3.taf
(15.28 KiB) Downloaded 51 times


Just make sure that it has a high priority (e.g. 1000) after you copied it.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 465
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251

Re: Characters and objects with the same name.

Postby Lazzah » Sun Mar 15, 2020 9:21 am

Denk wrote:Hehe - funny how things become simpler when you keep working with it. There is no reason to mess with the standard library. You can just copy this task into your game and the problem is gone:
Obj_to_character V3.taf


Just make sure that it has a high priority (e.g. 1000) after you copied it.

Thanks Denk, that works perfectly. I experimented by changing the objects to static ones, but it still works OK.

However, there IS a problem if you (e.g.) type GET BOY (character), you still get the "You can't see the boy!" response. I was wondering if this will have implications in the new release v.36 as there will be a new GET CHARACTER 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: 2362
Joined: Thu Mar 31, 2011 4:54 am
Location: Clacton-on-Sea, Essex
Points: 65

Re: Characters and objects with the same name.

Postby Denk » Sun Mar 15, 2020 11:48 am

Lazzah wrote:However, there IS a problem if you (e.g.) type GET BOY (character), you still get the "You can't see the boy!" response. I was wondering if this will have implications in the new release v.36 as there will be a new GET CHARACTER task?

saabie mentioned that he put this problem on his to-do list, so he will probably include a fix for it in his upcoming release of the standard library. If he fixes it, you can just delete the task you copied from "Obj_to_character V3.taf" again. If he do not fix it, you can keep it and it should work just fine.

I tested this by updating the standard library to the version created on 17th on December by saabie on Github and the method still worked fine.

In this newer version of the standard library, a "Take character" task has been created. The "Take character" and "take objects" have the same problem as we had with examining objects/characters. Thus it can be handled in the same way:
FixTakeAndExamine.taf
Based on updated library 17Dec2019
(23.05 KiB) Downloaded 42 times

Again, if saabie fixes the problem for both EXAMINE and TAKE, you should remove both tasks.

You may still get inappropriate responses if you try to put objects on or in the boy character ("You cannot see the small boy!"). In theory, this could be fixed with some more tasks. However, it can quickly be fixed with a conditional text override.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
User avatar
Denk
 
Posts: 465
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 251


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 6 guests

cron