Page 1 of 1

V.5 Tips & Tricks Proto type

PostPosted: Tue Mar 06, 2018 7:30 pm
by P/o Prune
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:

Re: V.5 Tips & Tricks Proto type

PostPosted: Wed Mar 07, 2018 3:17 pm
by Denk
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.

Re: V.5 Tips & Tricks Proto type

PostPosted: Wed Mar 07, 2018 3:44 pm
by P/o Prune
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.

Re: V.5 Tips & Tricks Proto type

PostPosted: Mon Apr 30, 2018 10:24 pm
by DazaKiwi
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:

Library bug fix

PostPosted: Tue Jul 31, 2018 5:09 pm
by Denk
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.

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.

Re: V.5 Tips & Tricks Proto type

PostPosted: Wed Apr 17, 2019 11:10 pm
by DazaKiwi
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.

Aligning the columns of a table

PostPosted: Sun Jun 16, 2019 1:31 pm
by Denk
If you are printing a table with more than one column you will usually experience that the columns are not aligned.

NotAligned.png (3.96 KiB) Viewed 725 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 (3.84 KiB) Viewed 725 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 15 times

In this demo I have created the text variable "Table" looking like this:
adrift Code: Select all
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.

Re: V.5 Tips & Tricks Proto type

PostPosted: Sun Jun 16, 2019 9:05 pm
by DazaKiwi
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.

Re: V.5 Tips & Tricks Proto type

PostPosted: Thu Aug 01, 2019 3:40 am
by DazaKiwi
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.)

Re: V.5 Tips & Tricks Proto type

PostPosted: Thu Aug 01, 2019 9:59 am
by Denk
Nice demo Daza. It shows that the expression must be flipped around to work. I guess that is a bug in ADRIFT.