telling a companion to act

dmarsh2014
I've been looking around for a couple days now, and coding on my own. I can't figure how to have a sidekick or companion follow orders. I don't really have any code yet, but I'm looking for a way to have the player give commands to an NPC, which would then do the command. Basically, have the NPC execute verbs like a player can.

Is it even possible?

The Pixie
The way I would do it is to have the player type TALK TO BORIS, then offer a number of topic, one or more of which would be a command. It really depends on what you want the player to type.

OurJud
I think TP has already touched on the main problem here; that of informing your player of the commands available. Issuing a command to an NPC and having them react accordingly isn't the problem, it's the controlling of what the player says at a specific moment..

Silver
This will always be a problem for IF as much as it is for any other RPG. Open ended discussion can only really lead to a situation not dissimilar to guess the verb unless handled brilliantly. Personally I'd do the same as I suggested on your notebook thread and have a discussion with a NPC start a minigame CYOA using the text processor where the player has choices of what they can say rather than making it open ended. If there was a better way of doing it then I'm sure Skyrim and GTA with their million pound budgets would have discovered it.

HegemonKhan
there's only three main ways to do this (that I know of anyways):

1. typed-in input (open-ended): the 'get input' Script or using Commands

2. a selection of choices (not open ended): 'show menu' Script, using Verbs, Hyperlinks, or 'button' Objects, or such a structure with using 'get input' Script or Commands

3. switch between your 'team~party member' Player Objects (wiki: ChangePov)

---------

an example using #2:

player's party members:
-> player: male human knight
-> object1: male dwarven barbarian
-> object2: male elven wizard
-> object3: female halfling thief
-> object4: female gnomish cleric

example using the 'show menu' method, along with using 'action button' Objects and an 'action' Verb:

object1: 'action button' Object -> 'action' Verb -> show menu ("what action?", split ("discuss;equip;magic;items;steal;hide;sneak;etc choices of actions", ";"), false) { scripting }
object2: 'action button' Object -> 'action' Verb -> show menu ("What action?", split ("discuss;equip;magic;items;steal;hide;sneak;etc choices of actions", ";"), false) { scripting }
etc etc etc

jaynabonne
Attached is one way you could do it.

I took over the "tell X about Y" command, changing it to "tell X to Y". This allows you to use the current editor GUI to add "tell to" commands instead of "tell about" topics. To add topics, click on tom and then the Ask/Tell tab. Then you can go down to the "Tell about:" list and add what you want.

I'm not saying this is ideal or even the way you want to do it. But it is one way.

If you wanted both "tell about" as well as "tell to", you could add a new "tell to" command variant fairly easily. However, you'd have to edit the topics dictionary yourself since the GUI won't support both at once.

dmarsh2014
Wow! Lots of help. Thanks, all.

While I was pondering, I came up with a solution. Using Commands, who's form is "Boris, verb", which will first check if Boris is even in the room with the player, then if so, have him do the verb. It's not elegant, perhaps (lots of coding for various possibilities, and LOTS of individual new commands for various actions), but it reads more naturally. And with the ability to give alternate commands, you can come up with many different phrasings for a single one.

Marzipan
In games where I've seen this implemented it usually is in that format: '>NPC, push button' or whatever. You know what command to type because it's the exact same verb+noun format you'd be using yourself, just with the other character's name in front of it.

The Pixie
I think that would be pretty difficult to implement. Ideally you would cover all the verbs and most commands already in Quest, and there are a lot. Also, Quest has the verb concept to make that easier, you would not have that either.

It may be possible to change the POV to the NPC, and then send the rest of the command to Quest to handle normally, but even then you will have to modify each command and verb to check the POV, and say "you" or "NPC" as appropriate.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums