ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

V.5 Tips & Tricks Proto type

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.

V.5 Tips & Tricks Proto type

Postby P/o Prune » Tue Mar 06, 2018 7:30 pm

This is just a test to see how the V.5 Tips & Tricks will look,
When all is settled I'll go through the V.5 thread and add the various demos.
In the example below Rotter was on the look out for a fast way to sell all valuable items held and Denk came up with a nifty little demo.

The thread is not limited to requests and replies. If someone comes up with something you believe would be of help to other drifters send it to my email and I'll add it to the list.

I'm in doubt about whether this should be an open thread since I'm afraid that the demos will disappear in white noise. I would like it to be a list of demos that Drifters can scroll through without having to go through numerous comments and possible sidetracks.

Any comments and suggestions will be appreciated.



Selling all the valuable items held
Post by rotter » Tue Feb 06, 2018 8: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"?

Solution by Denk:
Attachments
sell all.taf
(15.55 KiB) Downloaded 75 times
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 54Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4372
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: V.5 Tips & Tricks Proto type

Postby Denk » Wed Mar 07, 2018 3:17 pm

I think this thread is a good idea. Perhaps you should keep it open to begin with - if it becomes a problem you can always lock it. Also, if you always insert the tips and tricks in the first post, as you have done with the sell all example, they will always be on top.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 243
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 31

Re: V.5 Tips & Tricks Proto type

Postby P/o Prune » Wed Mar 07, 2018 3:44 pm

Denk wrote:I think this thread is a good idea. Perhaps you should keep it open to begin with - if it becomes a problem you can always lock it. Also, if you always insert the tips and tricks in the first post, as you have done with the sell all example, they will always be on top.


I think that's a good idea.
The demo's / examples will be edited into the first post as they arrive. Drifters can then discuss them in the following posts.
D-Day in progress 86Kb (Slowly drifting)
Just a Fairy Tale: 54Kb
User avatar
P/o Prune
Site Admin
 
Posts: 4372
Joined: Mon Jun 24, 2002 8:18 am
Location: Denmark
Points: 58

Re: V.5 Tips & Tricks Proto type

Postby DazaKiwi » Mon Apr 30, 2018 10:24 pm

Here is a little demo showing how the map in runner can be used as a multi choice method, since you can click on a map location and automatically move to it.

There is one little hitch however, when you do move the choice you pick it shows the direction you moved in red, unfortunately this is hard-coded in, but would be cool if it could be somehow manually turned off when needed. And you have to turn off show exits (in Dev) if you don't want exits to show when arriving at the choices starting location. If your game is purely multi-choice then turning it off won't be problem, else you could manually show exits in the desc of location via Player.Location.Exits
Also with the nature of how this works, Adrift moves the player one location at a time to destination location, so you cannot have 2 choices lined up in the same direction for obvious reasons. But using 1 direction per choice still gives you 8 possible choices if you wanted that many.

Download Demo:
http://www.mediafire.com/file/s4n3nl6cq93ezqe/MultiChoiceW_LocationsDemo_v2.taf
User avatar
DazaKiwi
 
Posts: 627
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 16

Library bug fix

Postby Denk » Tue Jul 31, 2018 5:09 pm

There are some bugs in the standard library, some more important than others. It is possible for the user to modify the standard library but that can seem a bit complicated for beginners. Thus I have made this taf-file which you can use as a starting point for your games.

The taf-file fixes three bugs in v.5.0.35.3:

1. Container bug
2. No route north, only north
3. Get off objects before moving

Some comments:
Bug 1: This bug causes ADRIFT-errors when you apply the built-in size restrictions on containers.
Bug 2: This bug reveals hidden exits when they are not open, if you try to go in a direction which is not valid.
Bug 3: This bug, prevents movement when seated etc. on an object, e.g. a chair.

I can only recommend users to play around with the standard library, since ADRIFT becomes much more flexible once you know how to do that. Note that you are only changing the taf-file you are working on - you are not ruining the standard library for future projects.
Attachments
LibraryBugFix.taf
(14.64 KiB) Downloaded 45 times
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 243
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 31

Re: V.5 Tips & Tricks Proto type

Postby DazaKiwi » Wed Apr 17, 2019 11:10 pm

Auto Reveal Map module:

I have a new module to share and a demo to go with it, suitable for large map games which like the title says reveals all locations of the map you want shown. It beats manually adding move player to location x for the number of locations you have, a very tedious task if you have a ton of locations.

There will be some who don't want to reveal parts or the entire map to players at all and some who do which this is for. This also can be used only revealing the map or sections of a map when the Player finds/reads a map or uses a terminal etc.

Anyway have a look at the demo or import the module (the difference between the two is the demo has some locations as example and is run by player command, where as the module version starts immediately (which you can change Reveal Map task to 'Called by another task/event' if you prefer- such as calling it when the player reads a map etc.

There is a read me task for more info, I hope this is straight forward enough for even new drifters can use. Ask any questions if need be.
Attachments
Reveal_Map_Demo_v1.taf
Demo version
(16.41 KiB) Downloaded 18 times
Auto_Reveal_Map_module_v3.amf
Module version, just import into your game
(4.04 KiB) Downloaded 14 times
User avatar
DazaKiwi
 
Posts: 627
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 16

Aligning the columns of a table

Postby Denk » Sun Jun 16, 2019 1:31 pm

If you are printing a table with more than one column you will usually experience that the columns are not aligned.

Example:
NotAligned.png
NotAligned.png (3.96 KiB) Viewed 457 times


In order to ensure that the columns are aligned, you should print the table with mono-spaced fonts e.g. "courier new".
It will look like this:
aligned.png
aligned.png (3.84 KiB) Viewed 457 times


I attach a taf-file demonstrating how to align the tables when the contents of some of the columns are variables.
Aligned columns.taf
(16.18 KiB) Downloaded 9 times

In this demo I have created the text variable "Table" looking like this:
adrift Code: Select all
NAME       GENDER     STATUS
-----------------------------
John       M          %Health1%
Lisa       F          %Health2%
Harrison   M          %Health3%
Joe        M          %Health4%


As you can see, the text variable "Table" contains 4 other variables (%Health1%, %Health2% etc.)
When something happens in the game, e.g. John gets shot, the variables are changed in a task and the "Table" will change accordingly.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 243
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 31

Re: V.5 Tips & Tricks Proto type

Postby DazaKiwi » Sun Jun 16, 2019 9:05 pm

Great Demo Denk. This issue has plagued me in the past. Another trick i got from this is how you used %text% in the shoot %text% task, ive never thought of using %text% for something like that.
User avatar
DazaKiwi
 
Posts: 627
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 16

Re: V.5 Tips & Tricks Proto type

Postby DazaKiwi » Thu Aug 01, 2019 3:40 am

Expression Restriction for Player Property Referencing object:

Recently with a project i got stuck with a restriction expression and made a demo to try and find a solution, which i did in the end.

I often use Player properties that track/store objects for things like what vehicle they are using, weapon or targeting a vehicle or object. So if you want to have a restriction for them, its best to use an expression.

I thought I'd post my demo/findings here in this thread to benefit others who are familiar with using expressions.

My demo has a Player Object property type, where object 2 is the current referenced object in this property.

I wanted an expression to check if the Player property has a specific object stored there and in the restriction expression i was originally using;
adrift Code: Select all
%Player%.PropertyKey = ObjectKey
which was giving me an error. I discovered if you flip it around, ..thus..
adrift Code: Select all
ObjectKey = %Player%.PropertyKey
or if it must not match
adrift Code: Select all
ObjectKey != %Player%.PropertyKey
it works fine.

Anyhow i have the demo if anyone wants to look at it.
(If you are new to expressions, in developer with this demo try clicking on the drop down button on window panes for Objects and Character and select filter 'key' to see the property keys for the objects and player property which might help make sense of this demo.)
Attachments
Restriction_Property_Test_v1.taf
(15.64 KiB) Downloaded 2 times
User avatar
DazaKiwi
 
Posts: 627
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand
Points: 16

Re: V.5 Tips & Tricks Proto type

Postby Denk » Thu Aug 01, 2019 9:59 am

Nice demo Daza. It shows that the expression must be flipped around to work. I guess that is a bug in ADRIFT.
----------------------------------------------------------------------
The Bash Saga:
1. The Dragon Diamond 2. The Way Home 3. Stone of Wisdom
----------------------------------------------------------------------
Denk
 
Posts: 243
Joined: Mon Feb 22, 2016 6:21 pm
Location: Hjørring, Denmark
Points: 31


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 3 guests

cron