ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Selling all the valuable items held

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.

Selling all the valuable items held

Postby rotter » Tue Feb 06, 2018 6:11 pm

After some ideas for a V5 game I'm working on. I would like to be able to sell all the valuable items the PC is carrying to a merchant. Objects are identified as valuable by a property, "Object is valuable". Each items has a different selling price, again held in a property, "Object value". The game contains loads of items that can be sold.

Apart from doing it long hand, can anyone suggest a straight forward method of being able to sell everything in one go. Maybe using a command "SELL EVERYTHING"?
Currently working on "The Blank Wall" in ADRIFT 5 and "Again and Again" in Inform 7.
Delron, the home of Otter Interactive Fiction.
User avatar
rotter
 
Posts: 1352
Joined: Sat May 08, 2004 12:12 am
Location: UK
Points: 10

Re: Selling all the valuable items held

Postby Denk » Tue Feb 06, 2018 9:30 pm

I think this small demo demonstrates a way of doing what you are trying to do.

Briefly explained, when you type SELL ALL, the task "sell all" calls another task "sell all - subroutine" for each valuable item you are carrying, by sending a group of objects to the task.

If something is not clear, let me know and I will try to explain.
Attachments
sell all.taf
(15.55 KiB) Downloaded 14 times
-----------------------------------------------------------------------------------------
Out now: The Royal Puzzle, The Way Home & The Dragon Diamond
-----------------------------------------------------------------------------------------
Denk
 
Posts: 122
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 16

Re: Selling all the valuable items held

Postby rotter » Wed Feb 07, 2018 1:49 pm

Denk wrote:I think this small demo demonstrates a way of doing what you are trying to do.

Briefly explained, when you type SELL ALL, the task "sell all" calls another task "sell all - subroutine" for each valuable item you are carrying, by sending a group of objects to the task.

If something is not clear, let me know and I will try to explain.


Works like a charm, thanks.
Currently working on "The Blank Wall" in ADRIFT 5 and "Again and Again" in Inform 7.
Delron, the home of Otter Interactive Fiction.
User avatar
rotter
 
Posts: 1352
Joined: Sat May 08, 2004 12:12 am
Location: UK
Points: 10


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 5 guests

cron