ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

A question on the sequence of things in the engine

This forum is the place to discuss the older ADRIFT versions 3.9 and 4.0.

Please refer to the ADRIFT 4 Manual for more information.

Postby Chilli » Thu Oct 28, 2010 3:06 am

Hi all:

I'm working on my first game (still!) and I've noticed what seems to me to be an odd quirk on the sequencing of how things seem to be processed in the v4 engine. I'm wondering if this behavior is correct; if it isn't, how do I correct it?

Here's the setup. I have an object that I've called "Task States" that has eleven states. I use this object as a condition test for Alternate Descriptions as well as a test in Task Restrictions. For the most part, I've found this to be the most flexible way to handle multiple situations that occur in the same area wherein I only want a message to be displayed once.

However, I've noticed that if I change the state of this object in one task that involves displaying the description for a particular room, the state value recognized when the room is displayed is the PREVIOUS value that was set... even though the value, if displayed in the description, is the NEW one.

Is this correct? Is this just a "behavior" that you all have learned to work with in your games? Or am I just doing something wrong?

(By the way, if my explanation isn't clear, I'd be happy to provide a code sample.)

Thanks for any help you can provide!

Sincerely,

"Chilli"




Edited By Chilli on 1288235285
Chilli
 
Posts: 22
Joined: Mon Sep 27, 2010 6:13 pm
Location: Illinois

Postby Campbell » Thu Oct 28, 2010 7:54 am

I think the task actions are carried out after displaying the room.

In v5, I've added an option (on the advanced tab) so you can specify if the actions are carried out before or after displaying the description.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4620
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Postby Chilli » Thu Oct 28, 2010 6:39 pm

Hi Campbell:

Thanks for the reply.

That would make sense, although it doesn't really explain why the value seems to be updated if I display it as part of the room description. It's just something that I'll have to get used to... at least, until v5 is official! ;)

What DID prove to be really frustrating was finding out, late last night, that adding more state values to the object caused (a) all references to the state for this object to be eliminated in the Alternate Description tasks, (b) all entries using this object to be deleted in task restrictions, and © all entries using this object to be deleted in task actions. NOT a pleasant discovery at all! At least I hadn't been using this "trick" from the very beginning of the game....

Sincerely,

"Chilli"
Chilli
 
Posts: 22
Joined: Mon Sep 27, 2010 6:13 pm
Location: Illinois

Postby ralphmerridew » Fri Oct 29, 2010 2:55 pm

ADRIFT has a rather odd behavior in that any variables in output text are actually evaluated after they're printed. That could be what's tripping you up.
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: 2566
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri
Points: 10

Postby Campbell » Fri Oct 29, 2010 10:39 pm

To give some flexibility, the text box before the room dropdown is output before the actions are executed, and the text box after the dropdown is evaluated after.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4620
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Postby Chilli » Fri Oct 29, 2010 11:22 pm

Hi Campbell:

THAT makes perfect sense... now that I've had it explained to me.

Sorry that I'm such a pea-brain with all of this. I truly appreciate all of your help.

Sincerely,

"Chilli"
Chilli
 
Posts: 22
Joined: Mon Sep 27, 2010 6:13 pm
Location: Illinois

Postby ralphmerridew » Sat Oct 30, 2010 1:53 pm

For flexibility, wouldn't it be best to just make printing text just another task action?
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: 2566
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri
Points: 10

Postby Campbell » Sat Oct 30, 2010 4:23 pm

ralphmerridew wrote:For flexibility, wouldn't it be best to just make printing text just another task action?

Yes, that's true. I may well add that as a new action.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4620
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland


Return to ADRIFT 3.9 and 4.0

Who is online

Users browsing this forum: No registered users and 4 guests

cron