Jump to content

Recommended Posts

Has anybody already played with the conversation system (eg. kbAddTopic script commands) or is there already any documentation, which I've missed?

Share this post


Link to post
Share on other sites

You might want to check the comref.

The summary is:

kbAddTopic adds a topic (duh!) to a person with the .bikb (list of sentences), .fsm (conversation flow script for the AI) and/or .sqf (conversation flow script for a player) files as its parameters

kbTell makes the person actually say a specific sentence (defined in the .bikb file)

Conversation flow scripts are executed every time a sentence was said to the person with passed parameters being:

_sentenceId: the sentence as defined in the .bikb file

_topic: topic name registered via kbAddTopic

_this: the person that was talked to (receiver)

_from: the person that talked to the receiver and triggered the script

Share this post


Link to post
Share on other sites

Thanks Jezuro, I had a look at the wiki/comref but without examples it's a little tough to understand it ;).

Will try it out.

Share this post


Link to post
Share on other sites

Just unpack the campaign in yourarmafolder\Addons\missions:)

There are a lot of "examples". Sure you have to figure out how they work together but thats easy :p

Share this post


Link to post
Share on other sites

works well for NPC conversations, but what do I have to do if I wanna add a topic for the player?

Example:

c1 kbAddtopic["myTest", "myTest.bikb", "", "myTest.sqf"]; // works
sleep 2;
c1 kbTell [m1, "myTest", "myTest_A_0"];  // works fine

player kbAddtopic["myTest", "myTest.bikb", "", "myTest.sqf"]; // and now??

My thought was that I (as the player) could use the sentence(s) somehow to communicate to NPCs (similar to the standard 'Greetings' conversation'), now.

What's the flow here? Thx

Share this post


Link to post
Share on other sites

For the player you need to use call for the script.

player kbAddtopic["myTest", "myTest.bikb", "", {call compile preprocessFileLineNumbers "myTest.sqf"}];

Share this post


Link to post
Share on other sites

@Jezuro

I need your help again:

I did some further tests, here the code:

init.sqf

hint "KbTopic";
c1 kbAddtopic["myTest", "myTest.bikb", "", {call compile preprocessFileLineNumbers "myTest.sqf"}];
player kbAddtopic["myTest", "myTest.bikb", "", {call compile preprocessFileLineNumbers "myTest.sqf"}];

c1 doMove (position receiver);
sleep 10;
c1 lookAt receiver;
sleep 3;
c1 kbTell [receiver, "myTest", "myTest_A_0"]; 

event handler mytest.sqf:

hint format ["From:%1, Topic:%2, Sentence:%3", _from, _topic, _sentenceId];

When I run the testmission I get immediately the 'kbTell' event handled if I -as the player- approach any unit (_sentenceid is initial).

And I do not see my Topic in any menu...do I have to add it manually somehow?

And what is also strange is that the event handler for

<<<c1 kbTell [m1, "myTest", "myTest_A_0"]; >>>

is not triggered although c1 speaks to receiver

Probably I missed sth completely here :confused:

Share this post


Link to post
Share on other sites

Nevermind I think I found my solution, which when finished I will post for others. :)

Edited by Rommel

Share this post


Link to post
Share on other sites

I've had a look through some of the missions that come with the game to try and figure this conversation stuff out, and I keep finding a lot of lines like this:

_nic = [objNull, m1, rKBTELL, m4, "global", "s012"] call RE;

Can someone explain to me what "call RE" does? Is kbAddTopic even necessary? I never see it used in official missions. I just see a ton of these calls to the mysterious "RE."

Share this post


Link to post
Share on other sites

This stuff is way over my head. I did however come up with an easy way to get around using these scripts.

Its probly not the best way to do things and its not applicable to every conversation you may want to create but it does offer a way to ask single questions with single answers. In this example you can ask the AI 3 different questions.

in the AI units init.

this addaction ["Hows it hanging?", "answer1.sqf"]; this addaction ["Do you like Hockey?", "Answer2.sqf"]; this addaction ["Did you see the size of that chicken?", "Answer3.sqf"];

Make 3 sqf. files named Answer1.sqf Answer2.sqf Answer3.sqf

example:

Answer1.sqf

hint "A little to the left";

As you can tell this wouldnt work for full conversations but works well enough to ask simple questions to AI.

Share this post


Link to post
Share on other sites

I've actually figured out how to use the conversation system. I've even figured out how to use it with the conversation menu (that menu where you can choose your response). But I still have no idea what "call RE" means. Is that some sort of hard-coded function? How does it work? I AM SO CURIOUS.

Share this post


Link to post
Share on other sites
I've actually figured out how to use the conversation system. I've even figured out how to use it with the conversation menu (that menu where you can choose your response). But I still have no idea what "call RE" means. Is that some sort of hard-coded function? How does it work? I AM SO CURIOUS.

Please post an example conversation for dummies like me :D

Share this post


Link to post
Share on other sites

Most large conversations are in the fsm files, but i haven't been able to work out work yet. Things like this:

item0[] = {"React",0,250,-148.442688,-132.013092,-48.442719,-82.013107,0.000000,"React"};
item1[] = {"",7,210,-102.438477,48.426529,-94.438538,56.426514,0.000000,""};
item2[] = {"__",8,218,-245.799591,27.887707,-155.799591,77.887695,0.000000,"-"};
item3[] = {"END",1,250,-249.361267,105.329407,-149.361450,155.329422,0.000000,"END"};
item4[] = {"Is_that_right_",4,218,0.000000,225.000000,300.000000,275.000000,1.000000,"Is that right?"};
item5[] = {"So_I_hear__Only",1,250,350.000000,262.000000,650.000000,312.000000,0.000000,"So I hear. Only a few hours now huh? You nervous? I'm shitting it. Hey, you hang here and shoot the breeze some? Your team be cool with that?"};
item6[] = {"Sure__they_won_t",4,218,0.000000,300.000000,300.000000,350.000000,1.000000,"Sure, they won't mind. So, tell me about that new house of yours man!"};
item7[] = {"Oh_yeah__Man_you",1,4346,350.000000,337.000000,650.000000,387.000000,0.000000,"Oh yeah! Man you should see it! Eighteen acres of sweet, sweet..." \n "ADD ACTION, SET TALKER AS WAITING"};
item8[] = {"Na__I_got_stuff",4,218,-2.365997,374.528778,297.633972,424.528778,1.000000,"Na, I got stuff to do."};

Share this post


Link to post
Share on other sites

Before doing anything with conversations, you need to get yourself an FSM editor. The AI-side of any conversation in ArmA 2 must be controlled by an FSM, so if you are unfamiliar with FSM editing, familiarize yourself with that first.

Basically, the whole system works by automatically running scripts (for the player) or FSMs (for the AI) whenever kbTell is used. These scripts/FSMs can then be used to initiate more kbTells, creating a whole converstation. The kbAddTopic command is what ties everything together.

In order to give the player choices, you need to use an apparently reserved variable, BIS_convMenu. A typical player conversation script will look like this (taken from the official mission "Dogs of War"):

// collect reactions to BIS_convMenu _this _from _topic _sentenceid
BIS_convMenu = [];

//debug
if (!isNil "BIS_DEBUG_DIALOG") then
{
if (_sentenceId!="") then
{
 debugLog format["DIALOG- SQF of %1 initiated by %2 _sentenceId %3 sentence %4",_this, _from, _sentenceId,  localize ("STR_"+"_sentenceId")];
 };
};

switch (_sentenceId) do
{



case "beginning_cdf_briefing_S_2":
{//USEUCOM say we're close to convincing Moscow that NAPA had nothing to do with the bombing. Without that the Russians've got no reason to be here.

	if (BIS_evidenceGathered >= BIS_evidenceNeeded) then {
		_this kbtell [_from, "beginning_cdf_briefing","beginning_cdf_briefing_C_1"]; //We may even be able to redeploy the MEU. It seems we got enough evidence to convince the rest of the Security Council.
	} else {
		_this kbtell [_from, "beginning_cdf_briefing","beginning_cdf_briefing_C_2"]; //I think there's no chance of the MEU returning any time soon. The weight of evidence just wasn't enough to convince the Security Council to reinstate US control.
	};
	_this kbtell [bIS_CDFBegunov, "beginning_cdf_briefing","beginning_cdf_briefing_C_3"]; //Anyway, what do we do?
};


case "beginning_cdf_briefing_B_4":
{//You keep to your brief. Support the Chernarussian forces on the ground. However, due to your heroic efforts in the Sobor region, I am ready to offer you command over the operation.

	 BIS_convMenu = BIS_convMenu + [[ localize "str_command_yes", _topic, "beginning_cdf_briefing_C_4", []]];
	 BIS_convMenu = BIS_convMenu + [[ localize "str_command_no", _topic, "beginning_cdf_briefing_C_5", []]];
};


case "beginning_cdf_briefing_B_7":
{//You can still report to Marny and Stavovich here in the base for orders and intel but other than that you've got free reign to retake the north as you see fit.

_this kbtell [_from, "beginning_cdf_briefing","beginning_cdf_briefing_C_6"]; //Thank you Sir. With your permission, we'll get started.
};


};

// return the result
BIS_convMenu

BIS_convMenu is an array of arrays, each of which takes four arguments:

1. Text to show up in the menu (string)

2. Conversation topic as established using kbAddTopic (string)

3. Sentence ID of sentence to be said if option is chose, as defined by the bikb file tied to the conversation topic (string)

4. I suppose this is for optional arguments, but I've only seen it used as empty array (array).

Share this post


Link to post
Share on other sites

So if thats how to make a conversation what are all the items for and what do the numbers mean. For example:

item8[] = {"Na__I_got_stuff",4,218,-2.365997,374.528778,297.633972,424.528778,1.000000,"Na, I got stuff to do."};

Share this post


Link to post
Share on other sites
So if thats how to make a conversation what are all the items for and what do the numbers mean. For example:

item8[] = {"Na__I_got_stuff",4,218,-2.365997,374.528778,297.633972,424.528778,1.000000,"Na, I got stuff to do."};

Those are mouse pointer coords so you can click what you want to say.

Share this post


Link to post
Share on other sites

If you open up the FSM files and remove all the comments, you will notice those numbers are nothing but references to the design in BIS's FSM editor, and have no functionality what so ever.

Could BIS give us some easy insight to how make something simple out of this...

Share this post


Link to post
Share on other sites

I don't know if this is related to the Conversation system, but where is BIS_noCoreConversations used??? I can't find it in any .fsm anywhere..! Just the setting of it...

E.g. what module does the conv. between people in the game?

Edit: nevermind: found in characters

Edited by Doolittle

Share this post


Link to post
Share on other sites

Has anyone got a sample mission or some sample script for a an example of a simple conversation?

I've been trying to get it to work, with a .bikb file but no luck so far. Is there any documentation relating to how FSMs are related to the conversation logic (are they even required?).

All I want is 2 additional questions to ask a civilian on top of Weather/Targets/Location and a single response. For some reason, kbAddTopic and kbTell do not do anything when I have tried them!

Share this post


Link to post
Share on other sites
But I still have no idea what "call RE" means. Is that some sort of hard-coded function? How does it work? I AM SO CURIOUS.

Well, I've been having heaps of trouble with JIP and started looking into the Multiplayer Framework Editor Module (http://community.bistudio.com/wiki/Multiplayer_framework)- that's what RE references.

For example,

[nil,nil,rHINT, "Hello world"] call RE;

would broadcast hint "Hello world" to all players.

I am yet to test, but thats what I'm see atm. Would love to see some official BIS help on the multiplayer module - try to resolve JIP weather, time, markers, objectives, etc.

Share this post


Link to post
Share on other sites

In what folder sweets their custom sounds and how they prescribe to .bikb? I do not, there is no sound ...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×