ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Adrift End of the Year Comp.t

The place to chat about ideas, writing, this forum, or anything related to Interactive Fiction that isn't specific to ADRIFT.

Please also visit the Interactive Fiction Community Forum for further discussions.

Re: Adrift End of the Year Comp.t

Postby Lazzah » Sun Dec 29, 2013 10:19 am

saabie wrote:They are in the user functions folder (as thats what they are) but you use them just like you use a variable.

User Functions Folder? I do not have such a folder in my game file! Should I create one? :?
The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, The Call of the Shaman, The Lost Labyrinth of Lazaitch, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
User avatar
Lazzah
Moderator
 
Posts: 2352
Joined: Thu Mar 31, 2011 4:54 am
Location: Clacton-on-Sea, Essex
Points: 65

Re: Adrift End of the Year Comp.t

Postby saabie » Sun Dec 29, 2013 10:32 am

It was added in one of the recent ADRIFT upgrades.
The module should have added the folder automatically, so I must have deleted something I shouldn't have when I edited it.
Unfortunately modules exported from ADRIFT still need to be manually edited in a text editor before it can be imported into somebody else's game and that's quite complicated.
I'll have another go shortly and see if I can fix it.
saabie
 
Posts: 1024
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 50

Re: Adrift End of the Year Comp.t

Postby jankupila » Sun Dec 29, 2013 10:54 am

Should the folder be here?

Image

How can I get it visible?
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while
the Universe is trying to create bigger and better idiots. So far the Universe is winning.
User avatar
jankupila
 
Posts: 177
Joined: Sun Jan 30, 2011 10:58 am
Location: Helsinki, Finland

Re: Adrift End of the Year Comp.t

Postby saabie » Sun Dec 29, 2013 11:36 am

@Lazzah
This should work now:
HeldCount.amf
(6.55 KiB) Downloaded 209 times

If you import this into an existing file you may see multiple copies of the TASK folder. Just close them all and reopen the task folder.

@jankupila
The new folders ("User Functions" and "Synonyms") should be in any new game you create in the latest version of ADRIFT.
In old games they should have been added when ADRIFT was updated, unless you have "When loading a newer library item than the current adventure" set to "Never Overwrite" on the "Libraries" page of the Settings.
saabie
 
Posts: 1024
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 50

Re: Adrift End of the Year Comp.t

Postby jankupila » Sun Dec 29, 2013 11:51 am

Thanks I found them.
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while
the Universe is trying to create bigger and better idiots. So far the Universe is winning.
User avatar
jankupila
 
Posts: 177
Joined: Sun Jan 30, 2011 10:58 am
Location: Helsinki, Finland

Re: Adrift End of the Year Comp.t

Postby Lazzah » Sun Dec 29, 2013 2:11 pm

saabie wrote:@Lazzah
This should work now:
HeldCount.amf

If you import this into an existing file you may see multiple copies of the TASK folder. Just close them all and reopen the task folder.

Thanks saabie, I now have User Functions and Synonyms folders.

Maybe I'm missing something here, but how do I use I use HeldCount or WornCount in a restriction or action, they do not appear in the dropdown list of variables? :?

Thanks.
The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, The Call of the Shaman, The Lost Labyrinth of Lazaitch, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
User avatar
Lazzah
Moderator
 
Posts: 2352
Joined: Thu Mar 31, 2011 4:54 am
Location: Clacton-on-Sea, Essex
Points: 65

Re: Adrift End of the Year Comp.t

Postby saabie » Mon Dec 30, 2013 9:07 am

To use them in a restriction you use the Expression tab.
Here are some examples of what you can enter in the field:
%HeldCount% = 3
Passes if you are holding 3 objects
%HeldCount% > 10
Passes if you are holding more than 10 objects

For actions, you can't change the value so it can't be on the left of a set-variable action anyway.
The right side of a set-variable action is an expression anyway, so regardless of the variable you would have to type the name into the box.
If you wanted to set a variable to the current value of HeldCount, then type %HeldCount% in the box to the right of the = sign.
saabie
 
Posts: 1024
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 50

Re: Adrift End of the Year Comp.t

Postby Lazzah » Mon Dec 30, 2013 9:47 am

saabie wrote:To use them in a restriction you use the Expression tab.
Here are some examples of what you can enter in the field:
%HeldCount% = 3
Passes if you are holding 3 objects
%HeldCount% > 10
Passes if you are holding more than 10 objects

Hi saabie,

Much as I appreciate your efforts on my behalf, what you have done is no different from entering the expression "%Player%.Held.Count <= " into the expression box, which I know how to do. I have this expression in a fake general task (along with other functions such as %TheObject[%object%]%, etc) so all I need to do when I need to use it in a restriction is to copy and paste it into an expression tab and add the value required.

My original argument with Campbell was that the enhancement I requested appeared in the form of a "rocket-science" expression instead of a VARIABLE which one could select from the dropdown list.

Sorry to have wasted your valuable time. :blush:
The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, The Call of the Shaman, The Lost Labyrinth of Lazaitch, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
User avatar
Lazzah
Moderator
 
Posts: 2352
Joined: Thu Mar 31, 2011 4:54 am
Location: Clacton-on-Sea, Essex
Points: 65

Re: Adrift End of the Year Comp.t

Postby saabie » Mon Dec 30, 2013 10:06 am

You could put in an enhancement request that user functions with no parameters are automatically added to the dropdown lists of variables.
Last edited by saabie on Mon Dec 30, 2013 11:13 pm, edited 1 time in total.
saabie
 
Posts: 1024
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia
Points: 50

Re: Adrift End of the Year Comp.t

Postby ElliotM » Mon Dec 30, 2013 7:29 pm

I'm not sure I follow what is being discussed. Did anyone try setting %Player%.Held.Count equal to a variable and then using that instead? Update it with a task run each turn by an event and you'd never have to directly use %Player%.Held.Count ever again.

Variable Restrictions.png
Variable Restrictions.png (61.35 KiB) Viewed 6775 times


It will show up in the variable list on either side of the equation, but to have the restriction make any sense you would need to use an expression (green box) on the right like Saabie was discussing or have a different variable to compare it to that has the value you're checking for.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Adrift End of the Year Comp.t

Postby Lazzah » Tue Dec 31, 2013 8:34 am

ElliotM wrote:I'm not sure I follow what is being discussed. Did anyone try setting %Player%.Held.Count equal to a variable and then using that instead? Update it with a task run each turn by an event and you'd never have to directly use %Player%.Held.Count ever again.

It will show up in the variable list on either side of the equation, but to have the restriction make any sense you would need to use an expression (green box) on the right like Saabie was discussing or have a different variable to compare it to that has the value you're checking for.

If Campbell had implemented this as a variable in the first place - as I originally requested - we wouldn't need to go through all this shenanighans. I now have the %Player%.Held.Count expression, along with other frequently used functions, etc, saved in the message box of a fake task as per the attached image:

Function Messages.PNG
Function Messages.PNG (62 KiB) Viewed 6749 times


All I need to do if I want to use %Player%.Held.Count in a restriction expression is open the task and copy and paste it into the expression. Simples. I don't need to know how to use expressions.
The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust, The Lost Children, Run, Bronwynn, Run, The Call of the Shaman, The Lost Labyrinth of Lazaitch, Magnetic Moon, Starship Quest, Revenge of the Space Pirates
User avatar
Lazzah
Moderator
 
Posts: 2352
Joined: Thu Mar 31, 2011 4:54 am
Location: Clacton-on-Sea, Essex
Points: 65

Re: Adrift End of the Year Comp.t

Postby ralphmerridew » Tue Dec 31, 2013 2:45 pm

Lazzah: Campbell hasn't implemented it as a variable because it isn't a variable. It doesn't act like one, and trying to force it to act as one is likely to lead to the pileup of complexity that made ADRIFT 4 ultimately become unmaintainable.
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2586
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri
Points: 10

Re: Adrift End of the Year Comp.t

Postby ElliotM » Tue Dec 31, 2013 5:51 pm

Restriction.png
Restriction.png (41.33 KiB) Viewed 6725 times


Using my method, all three of these restrictions would act the same.

But if you're not looking for an alternative to the middle one, like I thought you were, then I apologize for complicating the discussion...
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

Re: Adrift End of the Year Comp.t

Postby ralphmerridew » Tue Dec 31, 2013 11:33 pm

Not quite.

They're only the same if nothing that adjusts the object tree happens between the time the variable is set and the time it is checked.
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2586
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri
Points: 10

Re: Adrift End of the Year Comp.t

Postby ElliotM » Wed Jan 01, 2014 5:05 am

True. I thought it'd be fairly accurate, but if I'm updating it every turn with an event I wouldn't necessarily know the order things happen in.
ElliotM
 
Posts: 1227
Joined: Tue Apr 17, 2007 8:04 pm
Location: The Midwest in the USA
Points: 13

PreviousNext

Return to General IF

Who is online

Users browsing this forum: No registered users and 1 guest