ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

No additional question

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.

No additional question

Postby FrankEdits » Sat Jul 08, 2017 2:32 am

Hello everyove. I am new in ADRIFT and IF at all, so sorry if i ask question which alredy exist (i search a lot, but didnot find) and for my bad english (i am from Ukraine).
I have some trouble with tasks.
I want when player type command 'attack %character%' there is additional question "with what?". If i created task (specefic or general) "attack guy with sword" game understand player its okay, but if player types just "attack guy", there will be just message like "This character wiil not like it".
I want to add such option, game ask you "with what?" and player can just type "
sword' - and task "attack character with object" go to be complete. And not only with attack system, but with some more options, like
"move table" -> with what? -> hands -> you are too weak -> move table -> with what? -> magic -> table goes away.
Help, please!
FrankEdits
 
Posts: 2
Joined: Sat Jul 08, 2017 1:58 am

Re: No additional question

Postby saabie » Sun Jul 09, 2017 5:08 am

Here is an example:
AttackWith.taf
(15.18 KiB) Downloaded 15 times

I changed the two "Attack" commands in the standard library to give more battle-like messages and added a specific task for attacking with the axe.
The "Attack %character%" command now asks "With what?" any sets a variable that enables a new "%object%" task that accepts the name of an object and runs "Attack %character% with %object%" in it's actions.
I needed to store the %character% reference between the two commands, so I added a new character property to the Player.
Here is a transcript:
Battleground
There is a sharp axe here. Fred is here.

> attack fred
With what?

> the axe
You are not carrying the sharp axe.

> attack fred
With what?

> the wet noodle
The wet noodle is completely ineffective as a weapon and does no damage to Fred.

> get axe
Ok, you pick up the sharp axe.

> attack fred
With what?

> axe
The sharp axe smashes down on Fred's helmet.
Ouch! He exclaims.
saabie
 
Posts: 834
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia

Re: No additional question

Postby ralphmerridew » Sun Jul 09, 2017 8:27 pm

Comments:
- The usual behavior in IF of a disambiguation prompt is that you can enter a disambiguator on the next turn and have it perform appropriate disambiguation. If you enter anything else on the next turn, the incomplete command is forgotten.
- If you type "ATTACK", it shows a "Attack who?" message. You can enter "Fred" on the next turn, but not after that. (Usual behavior)
- If type "ATTACK FRED", then do a few unrelated turns, and then enter an object a few turns later, it will run the attack task. (Unusual behavior)
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: 2501
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Re: No additional question

Postby FrankEdits » Sun Jul 09, 2017 10:05 pm

saabie wrote:Here is an example:
AttackWith.taf

I changed the two "Attack" commands in the standard library to give more battle-like messages and added a specific task for attacking with the axe.
The "Attack %character%" command now asks "With what?" any sets a variable that enables a new "%object%" task that accepts the name of an object and runs "Attack %character% with %object%" in it's actions.
I needed to store the %character% reference between the two commands, so I added a new character property to the Player.
Here is a transcript:
Battleground
There is a sharp axe here. Fred is here.

> attack fred
With what?

> the axe
You are not carrying the sharp axe.

> attack fred
With what?

> the wet noodle
The wet noodle is completely ineffective as a weapon and does no damage to Fred.

> get axe
Ok, you pick up the sharp axe.

> attack fred
With what?

> axe
The sharp axe smashes down on Fred's helmet.
Ouch! He exclaims.

OMG.
Really working. Thanks. I dont know how i do it without you. I dont understand how work with variables and propertys, so big thanks for that. :Thanks:
FrankEdits
 
Posts: 2
Joined: Sat Jul 08, 2017 1:58 am

Re: No additional question

Postby saabie » Mon Jul 10, 2017 12:41 am

ralphmerridew wrote:- If you type "ATTACK", it shows a "Attack who?" message. You can enter "Fred" on the next turn, but not after that. (Usual behavior)
Yes, I should have put in an event to clear the variable on the next turn if they don't enter an object name in response to the prompt.
saabie
 
Posts: 834
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

cron