ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Change what an object is called

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.

Change what an object is called

Postby rotter » Tue Dec 29, 2015 8:15 am

Is it possible in V5 to change the name of an object when viewed in the inventory?
Currently working on "The Blank Wall" in ADRIFT 5, "Word of the Day" and "Again and Again" in Inform 7.
Delron, the home of Otter Interactive Fiction.
User avatar
rotter
 
Posts: 1262
Joined: Sat May 08, 2004 12:12 am
Location: UK

Re: Change what an object is called

Postby Lazzah » Tue Dec 29, 2015 12:24 pm

rotter wrote:Is it possible in V5 to change the name of an object when viewed in the inventory?

I was going to say use a text override, but that would change the name wherever it was displayed.
OUT NOW: The Lost Children
Current W.I.P.: Run, Bronwynn, Run!
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: 1975
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England

Re: Change what an object is called

Postby Po. Prune » Tue Dec 29, 2015 12:36 pm

I'm not quite sure what you mean, Rotter, but would it be possible by swapping between two objects?
D-Day V.5 in progress 79Kb so far (slowly getting there)
Anno 1700 in progress 106Kb
User avatar
Po. Prune
Moderator
 
Posts: 3895
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark

Re: Change what an object is called

Postby rotter » Tue Dec 29, 2015 1:56 pm

Po. Prune wrote:I'm not quite sure what you mean, Rotter, but would it be possible by swapping between two objects?


Two objects would work, but you would then have to double-up any tasks to handle both objects. The example of what I was thinking of is an object that changes colour at various times during the game but only when held. So, a red pebble, a blue pebble and just an ordinary pebble when in the location. Text override might be the answer.
Currently working on "The Blank Wall" in ADRIFT 5, "Word of the Day" and "Again and Again" in Inform 7.
Delron, the home of Otter Interactive Fiction.
User avatar
rotter
 
Posts: 1262
Joined: Sat May 08, 2004 12:12 am
Location: UK

Re: Change what an object is called

Postby ElliotM » Tue Dec 29, 2015 7:46 pm

Dynamically changing names is something I've wondered about. In my case I was trying it out on location names, but was unable to get it to work. What did work was overriding the default short name by including it in a room group where the short name is already defined, which is how the dark locations room group works. Dynamically changing only the adjective might not be possible, as you can't stick variable references in that field. The OBJECTKEY.Name property is a combination of the article, adjective, and noun fields, so I don't think you can change them at runtime.
ElliotM
 
Posts: 1183
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: Change what an object is called

Postby Po. Prune » Tue Dec 29, 2015 7:56 pm

Just thought of something.
Would it be possible if you used an alternate description of the object?
You know you can right click on the object description and chose an alternate description, right? This description will only be shown if certain restrictions are valid, like character holding object for instance.
Could this do the trick?
D-Day V.5 in progress 79Kb so far (slowly getting there)
Anno 1700 in progress 106Kb
User avatar
Po. Prune
Moderator
 
Posts: 3895
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark

Re: Change what an object is called

Postby ElliotM » Tue Dec 29, 2015 8:31 pm

I've tried alt descriptions in groups before and had strange results. You try it yet, Po. Prune?
ElliotM
 
Posts: 1183
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: Change what an object is called

Postby ralphmerridew » Tue Dec 29, 2015 9:10 pm

You might try modifying the inventory task to set a variable before printing out the inventory text, then clear the variable after printing the inventory text, and use a text substitution that reads that variable.
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2480
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Re: Change what an object is called

Postby ralphmerridew » Tue Dec 29, 2015 9:23 pm

One catch: Do you just want to change what name is printed, or do you also want to change what names the player can use to refer to the object? Most of these only handle the first. (You'd probably have to swap around multiple objects to get the second.)
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2480
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Re: Change what an object is called

Postby saabie » Wed Dec 30, 2015 12:10 am

You could have the color as a separate property, then add an alternate description to the Inventory task that is appended to the output if the pebble is held and the color property is not "none".
This could add "The pebble is currently Pebble.Color" to the end of the inventory listing.

To get it to respond to "red pebble" or "blue pebble" etc. you could either add them to the "noun" field as separate lines, or else use a synonym to change any of them to just "pebble". (but it will respons to any color regardless of it's actual color at the time)

rotter wrote:Two objects would work, but you would then have to double-up any tasks to handle both objects.
Instead of a specific task for each pebble you could put all the pebbles in a group and use a restriction to determine if it should override the general task. (Change the command line from "pebble" back to "object" and don't put any text in the restriction message)
Last edited by saabie on Wed Dec 30, 2015 12:16 am, edited 1 time in total.
saabie
 
Posts: 811
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia

Re: Change what an object is called

Postby ElliotM » Wed Dec 30, 2015 12:15 am

Adding them to the noun field has been the way I've worked around this in the past. If you only have one object with this name it should work okay.

adrift Code: Select all
rock
red rock
blue rock
pebble
red pebble
blue pebble
ElliotM
 
Posts: 1183
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: Change what an object is called

Postby Po. Prune » Wed Dec 30, 2015 5:45 am

ElliotM wrote:I've tried alt descriptions in groups before and had strange results. You try it yet, Po. Prune?

No, not in groups. But other than that I use alternate descriptions frequently. It's one of the best features of V.5 I think.
D-Day V.5 in progress 79Kb so far (slowly getting there)
Anno 1700 in progress 106Kb
User avatar
Po. Prune
Moderator
 
Posts: 3895
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark

Re: Change what an object is called

Postby rotter » Wed Dec 30, 2015 9:56 pm

ralphmerridew wrote:One catch: Do you just want to change what name is printed, or do you also want to change what names the player can use to refer to the object? Most of these only handle the first. (You'd probably have to swap around multiple objects to get the second.)


My original idea what to do the first, just change how the object name is displayed. I'll have a look at your idea about modifying the inventory task - setting a variable before printing out the inventory text.
Currently working on "The Blank Wall" in ADRIFT 5, "Word of the Day" and "Again and Again" in Inform 7.
Delron, the home of Otter Interactive Fiction.
User avatar
rotter
 
Posts: 1262
Joined: Sat May 08, 2004 12:12 am
Location: UK

Re: Change what an object is called

Postby ElliotM » Wed Dec 30, 2015 11:09 pm

Is the object you wanted this for the only one of its kind? If so, adding all the adjectives in the noun might be the simplest way to do it if you don't want to do object swapping.
ElliotM
 
Posts: 1183
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: Change what an object is called

Postby ralphmerridew » Sat Jan 02, 2016 1:16 am

Questions about what exactly you want:

1) What should be displayed in inventory: "a red pebble" or "a pebble (glowing red)"?
I've seen both in games,

2) What should be displayed if some task prints out the name of an object while it's being held?

adrift Code: Select all
> PUSH PEBBLE
You push the pebble, but nothing happens.
 
> TAKE PEBBLE
Taken.  The pebble starts to glow red.
 
> I
You are holding a red pebble.
 
> PUSH PEBBLE
You push ____, but nothing happens.


If the inventory text says "a red pebble", I'd expect the push text to say "the red pebble" (though I wouldn't mind that much if it didn't). If the inventory text showed "a pebble (glowing red)", I would just expect the push text to be "the pebble", and would be rather surprised if it the parened text were displayed

3) What happens if the player tries to refer to the pebble by color while it is held?

If the inventory text was "a red pebble", I'd expect the game to let me refer to it as such, and would be annoyed if it didn't. If the inventory text was "a pebble (glowing red)", I wouldn't expect the game to let me call it a red pebble, but wouldn't mind if it did.

4) What if the player tries to refer to it by an incorrect color (but which the pebble can show) - would it accept that or give an error?

I'd expect it to give an error, though I wouldn't mind that much if it were accepted; getting that right is difficult in ADRIFT.
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2480
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Next

Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 3 guests