Jump to content
IndeedPete

Spin-Off Release: Simple Conversation System

Recommended Posts

Another question:

Does if then else commands work in description? I need to make the covnersation with more conditions, I want to make two different conversations, driven by conditions under if then else.

in description.ext it should be somwthing like

if condition==1 then conversation 1

if condition==2 then conversation 2

conversation 1 and 2 will both be assigned to 1 person.

In conversation1 the player will be assigned the task. Reaction to this task will be in coversation 2, hidden under condition==2. Th reaction will switch the condition to "3", so this option will be visible only once, when the assigned task is done.

I just want to make the conversation system more believable. In real life, someone gives you a task. When you have done the task, you just tell the giver that the task is done. And after that, option to give a task and to succeed the task is obsolete, so I want to make it hidden.

Share this post


Link to post
Share on other sites

No, you can't have control structures within the description.ext. They should work from the expression attribute though. But I don't see any point in doing so, the condition attribute is perfectly fine for what you have in mind. You can hide / unhide parts of a conversation by using conditons wisely. And / or define different conversations for different NPCs instead of assigning the same convo to everyone.

Share this post


Link to post
Share on other sites

I have described it really poorly.

I tried doing it with conditions. But as I found out, only one condition works for conversation.

Here, example:

1 conversation, 1 person.

The person gives me task, for ex. kill a bandit. This task give option is under condition == 1. But I want to have a reaction to this task, something like (PC: "I have killed a bandit", NPC: "Cool, here have some cookies"), this reaction will be hidden under condition (!alive bandit). Also, this reaction will change the condition value to 2, so that will hide the "give task" option. I just want to have the option visible only once, when the NPC assignes player the task. Then I want to have the reaction visible only once under condition, that the task is done.

Everytime, I tried to put more that one condition into a conversation, worked only the first condition (in line).

Share this post


Link to post
Share on other sites

And how did you put multiple conditions in one line?

Share this post


Link to post
Share on other sites

I never said I'm putting multiple conditions in one line.

When I get back from work, I paste here my example conversation.

Share this post


Link to post
Share on other sites

That's a good idea I guess.^^

Share this post


Link to post
Share on other sites

Hi, so I got to it ... and it is working fine. I just have to be more careful with the conditions. It is all working good.

Here is the code. It maybe can help someone.

class Conversations
{



class exit
{
	exit = 1;
	expression = "nul = [iP_guy, 'Bye!', 'DIRECT', 3] spawn IP_fnc_simpleSentence;";
	sentences[] = {"Goodbye!"};
};

class Opener
{
	arguments[] = {"(name player)"};
	responses[] = {"whoAreYou", "giveTask", "finishTask", "exit"};
	sentences[] = {
		"Hello, may I have a question?",
		"Sure. What you want to know?"
	};

};

class back
{
	responses[] = {"whoAreYou",  "exit"};
	sentences[] = {
		"Tell me something else.",
		"Listening."
	};

};

class giveTask
{
	exit = 1;
	condition = "(tVar == 1)"
	expression = "[player, 'tSimple', ['Take care of bandit <marker name=''mBandit''>here</marker>.', 'Kill bandit', 'Bandit'], 'mSamotar', true, 1] call BIS_fnc_taskCreate; nul = [iP_guy, 'Sure. Kill the guy over there.', 'DIRECT', 3] spawn IP_fnc_simpleSentence;"
	sentences[] = {"Can you give me a job?"};

};

class finishTask
{
	exit = 1;
	condition = "!alive bandit AND tVar == 2" /////////////////////////////tVar is set 2 by a trigger with a condition !alive bandit placed in the editor
	expression = "['tSimple', 'SUCCEEDED'] call BIS_fnc_taskSetState; nul = [iP_Guy, 'Cool, have a cookie!', 'DIRECT', 3] spawn IP_fnc_simpleSentence; tVar = 3;";  //////tVar == 3 hides the response and the give_task option
	sentences[] = {"It is done!"};
};

class whoAreYou
{
	responses[] = {"back",  "exit"};
	sentences[] = {
		"Who are you.",
		"None of your concern."
	};

};

};

Share this post


Link to post
Share on other sites

Well, one more thing (now it's really silly):

How do I replace the image of the speaker npc with the livefeed picture? I tried putting in "IP_Livefeed", but it ended with errors.

Share this post


Link to post
Share on other sites

Sorry, I forget...

I meant put the livefeed picture from simple sentence into converastion.

And the link you provided me works like a charm, thank you a lot!

Share this post


Link to post
Share on other sites

Hey!

First off, id like to thank you for your contribution, and more-over for actively providing support!

After having read this entire thread, it pains me to ask you any questions : D Im sure you have answered many...

Im trying to implement your script into my A3Wasteland mission.

As you might know, A3Wasteland features an array of playable units, and I cannot name everyone IP_Master.

Is there some way of making an array of names that are recognized by your scripts and serve the same function as IP_Master?

Also, when i launch my mission i get the following error (which does not crash the game though): Script functions\IP_rscStructuredText\fn_Attributes.sqf was not found.

Thank you very much in advance!

Share this post


Link to post
Share on other sites

Hi, thanks!

1. Just give them a name. Any unique variable name is sufficient.

2. Don't know what's causing that. fn_Attributes.sqf is not something I wrote, it's not even my naming scheme. Do you use any more third pary dialogs?

Share this post


Link to post
Share on other sites

1. I dont understand how I can give them just any name : O Didnt you mention that the player has to be named IP_Master for this to function properly? Even though I didnt find but one mention of "IP_Master" In your scripts and that was an example. Or am i misunderstanding?

2. That was one of the things that was confusing me, such a filename is indeed not present in your files. I did have a previous dialogue script which i removed, its probably that... I just havent been able to successfully run your script so i didnt know if that error would be conflicting.

3. Heres the dropbox link to my mission file so you can take a look yourself if i have implemented your script correctly, if you have time, would probably speed things up considerably...

https://www.dropbox.com/sh/7f51tjt14wo3fdn/AADpbfWnIHDJjw5LA9uvjpDYa?dl=0

Edited by DisgustingLynx

Share this post


Link to post
Share on other sites

1. I can't remember where I could have ued IP_Master, must be from a post in this thread somewhere. Anyway, just give them a variable name. IP_Guy1, IP_Guy2, IP_GuyN, jack, jim, bloke1 - doesn't matter. Anything.

2. Try a clean approach, use the demo mission and integrate stuff step by step.

Share this post


Link to post
Share on other sites

Yes, the name field in the editor. Has something to do with saving and passing selected responses. I haven't found a more elegant way to do so yet. Dialogs are a bit tricky.

Share this post


Link to post
Share on other sites

Hi again : D

So gathering from those script not found errors i figured that the functions.hpp for your scripts isnt integrated into my description.ext properly, which happened to be the case since after I copied the contents of the function.hpp into the description file, (instead of #include) my NPC now finally has the action to initiate the conversation. However nothing happens when I select the action. Also the simplesentence function isnt working since the NPC says nothing at all.

(EDIT:i included my init and desc here but as you can see in the post below, my issues have been solved ^^)

Thank you very much for your time!

Edited by DisgustingLynx

Share this post


Link to post
Share on other sites

Oh wow, I just figured it out, everything works splendid.

Heres how I did it in case anybody has a similar issue:

When integrating this script into a mission file with conflicting files of the same nature, the #include command may not always work.

1. Instead, i did the same thing I did to the function.hpp file, to the rsctitles entry in the description.ext.

2. I cloned the dialogs.hpp, deleted its content, filled it with the IP_DLG_CONVERSATION entry, and saved it as dialogs2.hpp. Then I included it in its own spot in the description.ext with #include conv\cfg\dialogs2.hpp

3. This may produce a "IP_BOX not defined" error which crashes to desktop. This is solved by moving #include "conv\cfg\defines.hpp" somewhere on its own.

In essence, the contents of functions.hpp, missionconversations.hpp, and the first half of dialogs.hpp (until class IP_DLG_CONVERSATION), were copy pasted into the description.ext.

Pay attention to the structure, and mimic it.

I hope that might help someone out, for more examples, IndeedPete explains how configs work on page 4.

Edited by DisgustingLynx

Share this post


Link to post
Share on other sites

Okay, glad you made it!

Share this post


Link to post
Share on other sites

Yes thanks I am not having an easy time with it because I am new but I like your Sample..a tutorial would be awesome!!

Share this post


Link to post
Share on other sites

What is unclear?

Share this post


Link to post
Share on other sites

I am at work now so when I go home I will go through it again. Do I nedd to download kbtell? is that an addon? I keep looking for it an not finding anything so is it within the editor and we just have to make bikb files for it?

Share this post


Link to post
Share on other sites

No, the kbTell system is a native part of the game and used by BI to play voice-acted conversations: https://community.bistudio.com/wiki/kbTell

My system's main purpose is to provide a framework for text-based communication and multiple choice conversations. I do support kbTell but since it's a rather closed system my implementation is a bit clunky. If you don't want multiple choice dialogues or the (I think prettier) subtitle presentation my system provides you can just use the vanilla framework. There's some further documentation linked on the wiki site I posted. .bikb files are not necessary if you don't have any actual voice acting to play.

Share this post


Link to post
Share on other sites

Hi IndeedPete,

 

this conversation system sounds very promising - but before I wrestle my way through all the files I'd like to know:

 

 

Can this generally work in MP?

 

Can I freely choose if the conversation is a cutscene or an ingame event?

 

Which files do I need to work on if  the conversation is to be played as text without voice acting (I understand that kbTell doesn't work in MP)

 

To be a bit more specific: In a MP coop mission I want to have a conversation between an AI unit and the group leader of a group that consists of AI and human players.  The purpose of the conversation is to receive intel about enemy locations - after a successful conversation I want either new tasks to pop up or markers to become visible -whatever works with your conversation system. 

 

Hope you can get me started,

 

tourist

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

×