ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

question about functions

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.

question about functions

Postby razor77 » Fri Apr 27, 2018 4:37 pm

I am a little confused about functions. Most of the time when i use them they display the key of what i need instead of the name.

Specificly im trying to display the room location of a character. I've used the key of the character plus .location. (bob.location) like displayed in the adrift wiki and it displays location key instead of name. The wiki is confusing any help with functions and the trick to making them work correctly/reliably, would be very appreciated.
razor77
 
Posts: 86
Joined: Mon Sep 05, 2011 8:18 pm
Points: 10

Re: question about functions

Postby Denk » Fri Apr 27, 2018 5:12 pm

When you type a key followed by "." you get a drop-down list.
For each option, notice the symbol on the left. Those options with the ABC-symbol are text strings and should work fine as output. But other options, such as ".Location" show e.g. a picture of a small house which means it is the key to a location. To get the location name you need to add another "." after "location" and you will get a new drop-down list. Here it should be possible to choose between two ABC-options: "Long description" and "Short description"
In this case I think you are interested in the short description. Your total function then becomes: Bob.Location.Name

Hope this makes sense.
-----------------------------------------------------------------------------------------
Out now: The Royal Puzzle, The Way Home & The Dragon Diamond
-----------------------------------------------------------------------------------------
Denk
 
Posts: 154
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 31

Re: question about functions

Postby razor77 » Fri Apr 27, 2018 10:40 pm

thanks makes perfect sense i will give it a look. :)
razor77
 
Posts: 86
Joined: Mon Sep 05, 2011 8:18 pm
Points: 10

Re: question about functions

Postby razor77 » Fri Apr 27, 2018 10:46 pm

it worked thanks so much!
razor77
 
Posts: 86
Joined: Mon Sep 05, 2011 8:18 pm
Points: 10


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 5 guests

cron