ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Having trouble with a custom Ask command

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.

Having trouble with a custom Ask command

Postby DazaKiwi » Sat Jul 21, 2012 11:48 pm

I have only managed to get this working once.

I have a object that is too heavy to lift by the player they will need to ask another character to help them lift the object.

I created a new task: ask %character% to help lift %object%

You type in the characters descriptor name, (made up example:) Ask bob to help lift fridge

All i get is "sorry, I didn't understand that command." Debug tells me no matches found!

I have set Task priority to 1. I've tried entering the characters full name.

Is it being bypassed because its related to other Ask tasks?
User avatar
DazaKiwi
 
Posts: 233
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand

Re: Having trouble with a custom Ask command

Postby saabie » Sun Jul 22, 2012 1:32 am

Do you have the property "is this character know to the player" selected for bob.
If you try to use the proper name of a character when its not known then ADRIFT does not recognise it as a %character% reference and so it wont match your command.
The standard library Ask tasks cant interfere with your task because they all require the word "about" to be entered.

P.S. You might want to make some of those words optional, ie. ask %character% {to} {help} lift %object%
saabie
 
Posts: 292
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia

Re: Having trouble with a custom Ask command

Postby DazaKiwi » Sun Jul 22, 2012 10:16 am

I managed to get it working i had a restriction that i deleted and its working now. Funny thing is the debug didn't even want to look at the task at all otherwise i might of cotton onto the failed restriction.

Another problem i had was i was trying to display the players current location in the dialogue just for narration purposes, since you can ask another character in another room to come and help lift something, i was trying to use %LoctionName[%player%]% but i got a bad function error, and when i tried %LocationOf[%player%]% all i got was the key number for that location?
User avatar
DazaKiwi
 
Posts: 233
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand

Re: Having trouble with a custom Ask command

Postby Campbell » Sun Jul 22, 2012 11:12 am

%LocationName[%LocationOf[%Player%]%]%
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 3838
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Re: Having trouble with a custom Ask command

Postby DazaKiwi » Mon Jul 23, 2012 2:14 am

Campbell wrote:%LocationName[%LocationOf[%Player%]%]%


Thanks :)
User avatar
DazaKiwi
 
Posts: 233
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand

Re: Having trouble with a custom Ask command

Postby Campbell » Mon Jul 23, 2012 7:43 am

Or the new function, %Player%.CharacterAtLocation.ShortLocationDescription.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 3838
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Re: Having trouble with a custom Ask command

Postby DazaKiwi » Mon Aug 13, 2012 11:47 pm

Getting back to these tests.

In Walk/Movement/Activity;

When i try both of these %LocationName[%LocationOf[%Character1%]%]% and %DazakiwiCharacter2%.CharacterAtLocation.ShortLocationDescription i get a bad function error, even though the key(s) are correct and in the first case example the text is highlighted green when key Character1 is entered but the DazaKiwiCharacter2 is not highlighted green but remains usual text colour.

However if i use %Player% it works with each example fine.

So it seems it is not recognizing the custom prefix for character keys (im not sure if other prefix keys are not recognized by Adrift as well) at all and standard keys aren't being accepted either?

Another example
Walk/Movement/Activity;
If Character comes across Object then display;
"Hey i have found something at %LocationName[%LocationOf[%object3%]%]% is it %DisplayObject[%Object3%]% "

This gives me errors like the other one above too. Could these problems with not recognizing keys be unique to Activities for movement?
User avatar
DazaKiwi
 
Posts: 233
Joined: Thu Oct 21, 2010 9:05 am
Location: New Zealand

Re: Having trouble with a custom Ask command

Postby saabie » Tue Aug 14, 2012 12:32 am

Keys should not have % signs around them, only functions, references and variables use %.
Your functions should be:
%LocationName[%LocationOf[Character1]%]%
DazakiwiCharacter2.CharacterAtLocation.ShortLocationDescription

%Character1% is highlighted in green because that is a reference.
Key's like Character1 are highlighted in red.
saabie
 
Posts: 292
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia


Return to ADRIFT 5.0

Who is online

Users browsing this forum: No registered users and 2 guests