intfiction.org

The Interactive Fiction Community Forum
It is currently Fri Nov 16, 2018 6:26 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Jul 25, 2018 10:39 am 
Offline

Joined: Wed Jul 25, 2018 8:55 am
Posts: 18
I have run into an issue which I've greatly simplified here. I have an npc that has a ring:

Code:
startRoom: Room 'start room' 'start room'
;
+ me: Actor;
+npc: Actor 'npc' 'npc';
++ring: Thing 'ring' 'ring';


'npc' will be incapacitated in some way during the game at which point I want the player to be able to take the ring. For now, I just want to take it while I put that particular quest item on hold. There's other stuff I want to address first. But when I try, I get the following:

Start room

The npc is standing here.

> take ring

The npc won't let you have that.

How do I get around this problem?

Thanks.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 26, 2018 1:39 am 
Offline

Joined: Sat Jul 16, 2011 3:48 pm
Posts: 309
You need to overload checkTakeFromInventory method on the npc object to allow taking specific (or all) objects from the inventory of the NPC. Here are more details and examples: https://www.intfiction.org/forum/viewtopic.php?f=10&t=1840


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jul 26, 2018 9:14 am 
Offline

Joined: Wed Jul 25, 2018 8:55 am
Posts: 18
Perfect. Thanks.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group