ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

VIDEO REQUEST: Expressions

A library of video tutorials for ADRIFT 5.0.

VIDEO REQUEST: Expressions

Postby ParadoxGames » Sat Sep 03, 2016 1:32 pm

I have a request for a series of videos: handling expressions.

Most of what I learned on ADRIFT usage is self-taught, with some help from reading tutorials and the knowledge of members here on the forum, but I wish to get to a higher level of understanding the way ADRIFT thinks.

I'm good on algebraic and logical expressions, but I want to deepen my programming skills and enter this world of expressions involving properties. For example, one of Lazzah's threads mentions an expression "%Player%.Held.Count = 1". I understand how that works. I seem to understand an expression's syntax and heirarchy, for example, held.count is a property pertaining to "object": %player%. I get that it's storing a variable equal to the number of items being held (or possibly a number that is the sum of the held objects' weight class- but I assume there's a different expression for that.) But I have no idea what expressions exist and ways to use them in the games.

So in the video, I'd like a series that 1) enumerates the various expressions available in an organized manner and the info they store, 2) shows how to implement them and where it's possible to do so, and 3) offers example situations where they become useful.
ParadoxGames
 
Posts: 161
Joined: Sat Sep 05, 2015 2:33 am

Re: VIDEO REQUEST: Expressions

Postby ElliotM » Thu Sep 08, 2016 9:04 pm

That is actually a fairly large amount of material when you break it down because when people talk about expressions they are actually talking about a few different but related features of Adrift. Expressions come in four types (Integer, String, Mixed, and Conditional) but are also considered one of the four Function types, the others including Item, General, and User. The results of an expression can be stored in variables and properties or they can be used in restrictions as a form of conditional logic. Expressions are mainly math related but do have uses in text manipulation.
ElliotM
 
Posts: 1183
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: VIDEO REQUEST: Expressions

Postby ParadoxGames » Wed Sep 14, 2016 1:26 am

I think "functions" is what I'm actually asking about. If you see the example I use, %Playe%.held.count = 1. Seems like a variable to me, but whatever category this covers (User Function?) it seems like part of a dynamic world of ADRIFT that offers a lot of potential I just don't know how people know all the functions when they need to use one. Yet I seem to understand them on a conceptual level. Does that make sense?
ParadoxGames
 
Posts: 161
Joined: Sat Sep 05, 2015 2:33 am

Re: VIDEO REQUEST: Expressions

Postby saabie » Wed Sep 14, 2016 6:15 am

ParadoxGames wrote:held.count is a property pertaining to "object": %player%. I get that it's storing a variable equal to the number of items being held
held is a property pertaining to "character": %player% :)
%Player% is a variable that contains the key of whichever character the player is currently controlling.
.Held then gives you a list of the keys of all of the objects that that character is holding.
.Count is a function that counts how many keys you got from the previous function.

ParadoxGames wrote:(or possibly a number that is the sum of the held objects' weight class- but I assume there's a different expression for that.)
That would be:
%Player%.Held.Weight.Sum
Weight is a property of objects, and can be found on the properties page of each object where it is set to a phrase like "Very Light"
but if you look at the "Object Weight" property (in Standard Library/Give, take and drop) you will see that every one of those settings has a number value.
The Sum function adds up these values for all of the held objects and gives you the total weight.

ParadoxGames wrote: %Player%.held.count = 1. Seems like a variable to me, but whatever category this covers (User Function?).
That's called an "Item Function".
A "General Funtion" looks like this: %CharacterName[ possessive ]%
A "User Function" is a general function that you create yourself, like a subroutine in a programing language.

ParadoxGames wrote:I just don't know how people know all the functions when they need to use one.
The wiki has lists of all the various functions at: http://wiki.adrift.co/Main_Page#Functions_and_Expressions
saabie
 
Posts: 834
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia

Re: VIDEO REQUEST: Expressions

Postby ElliotM » Wed Sep 14, 2016 6:24 pm

I generally look at the wiki to figure out if a function exists that does what I want. The page Saabie linked would be a handy one to have bookmarked for easy access while you're working on your projects.
ElliotM
 
Posts: 1183
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA

Re: VIDEO REQUEST: Expressions

Postby ParadoxGames » Sun Sep 18, 2016 11:53 pm

Excellent help, and the link is the foundation for what I wanted to learn!
ParadoxGames
 
Posts: 161
Joined: Sat Sep 05, 2015 2:33 am


Return to Video Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron