Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Conversation System... confusing and cant get it to work

  1. #1

    Conversation System... confusing and cant get it to work

    Hi there all (again) lol!

    I thought to try the Conversation system in Arma 2, following a certain tutorial which i find very difficult to understand and slightly unclear. I just cant seem to get the system to work.

    Can someone please review my script and see why it wont work?

    Many thanks for your time

    3RD TIME UPDATED SCRIPTS FOR THE QUESTION I ASKED REGARDING WHY THE AI IS NOT MAKING CONVERSATION
    UPDATE: Welcome_boss.sqf, start.sqf, welcome.bikb, FSM Image and Welcome_boss.fsm (FILE)


    ****
    The player (mainguy) starts in a helicopter (HeliStart) with his group.

    HeliStart is going to land at helipad1 to drop of my group.

    When mainguy walks out of the helicopter compound, the CO (boss) is standing in front of him.

    When mainguy reaches a certain distance between boss the conversation starts. The animation has already been set up.

    While chatting with boss the player is given a choice of missions he would like to do.

    When the player chooses a mission it executes another script (i havent made any yet, i just want to get the conversation working).


    ****

    Also as you may probably notice in the scripts i havent fully completed it the way i want it to be complete, i just cant seem to work out how to make it work. Once i understand how to do it, then i can probably do it all myself. I would REALLY appreciate it so much if someone can help me out here. Its for a practice mission but i want to learn much about scripting before i go on to do stuff for the community.


    Start.sqf
    Code:
    //////////////////////////////////////////////////////////////////
    // Function file for Armed Assault
    // Created by: WoodyUK
    //***************************************************************/
    // A very big thanks to: Muzzleflash, Cobra4v320 and IndeedPete!
    //***************************************************************/
    //////////////////////////////////////////////////////////////////
    private ["_megrp","_player","_del"];
    
    {_x setVariable ["BIS_noCoreConversations", TRUE]} forEach [player, boss];
    
    _this select 0;
    _megrp = group mainguy;
    _player = mainguy;
    _del = deletevehtrig;
    _boss = boss;
    
    boss setBehaviour "safe";
    
    {_x moveincargo HeliStart} foreach units _megrp;
    
    while {HeliStart distance helipad1 >= 100} do
    {
    	HeliStart Move getpos helipad1;
    
    	HeliStart flyinHeight 50;
    };
    
    HeliStart land "LAND";
    
    {doGetOut _x} foreach units _megrp;
    
    waituntil {{ !( _x in HeliStart)} foreach (units _megrp) };
    
    HeliStart land "NONE";
    
    boss doWatch leader _megrp;
    boss setSpeedMode "LIMITED";
    
    waituntil {_player distance boss <= 4};
    
    player kbAddTopic ["GoodMorning", "Conversations\Boss\Welcome.bikb", "", {call compile preprocessFileLineNumbers "Conversations\Boss\Welcome_Boss.sqf"}];
    _boss kbAddTopic ["GoodMorning", "Conversations\Boss\Welcome.bikb", "Conversations\Boss\Welcome_boss.fsm"];
    
    _boss kbTell [player,"GoodMorning","GoodMorning"];
    
    waitUntil {boss kbWasSaid [_player,"finishconvo", "bossfin", 999999]};
    
    HeliStart move getpos _del;

    Welcome_Boss.sqf
    Code:
    //////////////////////////////////////////////////////////////////
    // Function file for Armed Assault
    // Created by: WoodyUK
    //////////////////////////////////////////////////////////////////
    BIS_convMenu = [];
    
    if (_from == boss && _sentenceId == "" && !(boss kbWasSaid [_from, _topic, "GoodMorning", 999999])) then {
    	BIS_convMenu = BIS_convMenu + [["Commander Sunny?", _topic, "GoodMorning", []]];
    	};
    
    switch (_sentenceId) do
    {	
    	case "GoodMorning":
    	{
    		boss playMove "AmovPercMstpSlowWrflDnon_Salute";
    		player playMove "AmovPercMstpSlowWrflDnon_Salute";
    		BIS_convMenu = BIS_convMenu + [["Good Morning and thank you Sir!",  _topic, "GMorningSir", []]];
    	};
    	
    	case "ChooseMission":
    	{
    		boss playMove "";
    		player playMove "";
    		BIS_convMenu = BIS_convMenu + [["Protect Convoy",  _topic, "p_convoy", []]];
    		BIS_convMenu = BIS_convMenu + [["Help Defend Town", _topic, "d_town", []]];
    		BIS_convMenu = BIS_convMenu + [["Sneak into Village and Steal Documents",  _topic, "s_docs", []]];
    
    	};
    	
    	case "p_convoy":
    	{
    		BIS_convMenu = BIS_convMenu + [["Yes Sir.",  _topic, "p_convoy_agree", []]];
    		BIS_convMenu = BIS_convMenu + [["No Sir", _topic, "disagree", []]];
    	};
    	
    	case "p_convoy_explain":
    	{
    		BIS_convMenu = BIS_convMenu + [["I understand",  _topic, "p_convoy_understand", []]];
    		BIS_convMenu = BIS_convMenu + [["Please Explain Again", _topic, "p_convoy_again", []]];
    		BIS_convMenu = BIS_convMenu + [["I want a different mission", _topic, "disagree", []]];
    	};
    	
    	case "p_convoy_understand":
    	{
    		
    	};
    	
    	case "d_town":
    	{
    		BIS_convMenu = BIS_convMenu + [["Yes Sir.",  _topic, "d_town_agree", []]];
    		BIS_convMenu = BIS_convMenu + [["No Sir", _topic, "disagree", []]];
    	};
    	
    	case "s_docs":
    	{
    		BIS_convMenu = BIS_convMenu + [["Yes Sir.",  _topic, "s_docs_agree", []]];
    		BIS_convMenu = BIS_convMenu + [["No Sir", _topic, "s_docs_disagree", []]];
    	};
    
    };
    
    BIS_convMenu;

    Welcome.bikb
    Code:
    class Sentences
    {
    // BOSS CONVO
    	class GoodMorning
    	{
    		text = "Good Morning! I am Commander Sunny indeed! Welcome to Firefly base Sergeant.";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    
    	class ChooseMission
    	{
    		text = "Well look on the bright side! Now that you are here, the action can start. You will have a choice to choose one of three missions. What would you like to do?";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    
    	class p_convoy
    	{
    		text = "You will need to protect the convoy that will be heading from --- to ---. Are you sure you want to do this mission?";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    	
    	class p_convoy_agree
    	{
    		text = "Good! This mission should be a total piece of cake.";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    	
    	class p_convoy_explain
    	{
    		text = "The mission details are as followed. A convoy will be dispatched from the weapons factory in Chernogorsk. Your task will be to protect it at all cost, until it reaches its destination. Do you understand?";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    	
    	class p_convoy_understand
    	{
    		text = "Good! Go to your tent that we have set up for you, and stay the night. The convoy will be leaving at 0600 tomorrow.";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    	
    	class d_town
    	{
    		text = "You will need to defend ---. Are you sure you want to do this mission?";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    	class s_docs
    	{
    		text = "You will need to steal the docs from ---. Are you sure you want to do this mission?";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    
    
    	class Bossfin
    	{
    		text = "Carry On Sergeant! Good luck!";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    
    // PLAYER CONVO
    	
    	class GMorningSir
    	{
    		text = "Good Morning and thank you Sir!";
    		speech[] = {};
    		class Arguments {};		
    	};
    	
    	class agree
    	{
    		text = "Yes Sir.";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    	
    	class disagree
    	{
    		text = "No Sir";
    		speech[] = {};
    		class Arguments {};
    		
    	};
    	
    };
    class Arguments{};
    class Special{};
    startWithVocal[] = {hour};
    startWithConsonant[] = {europe, university};

    Welcome_boss.fsm
    I have uploaded my latest fsm file, please download it to see what it's doing in conjunction with these scripts above.
    FSM - http://www.mediafire.com/file/ctsh7a...lcome_Boss.fsm
    http://www.mediafire.com/file/g4oht9...lcome_Boss.rar

    Last edited by WoodyUK; Aug 20 2010 at 21:17.

  2. #2
    It's been a while since I've worked with the conversation system, but you'll need to use an FSM file for all AI speech. Scripts only work with players.

  3. #3
    Corporal
    Join Date
    Sep 18 2009
    Location
    UK
    Posts
    85
    Author of the Thread
    Thats going to take me a long time to get the hang of, i tried it out today, constant failure. There just dont seem to be any clear documentation that i can find on the net...

    When you mean speech, do you mean the AI is using a sound file i provide for the speech? I just want to make it with no speech, just text for now and thats just it.

    I saw in the tutorial i mentioned (its very hard to understand that tutorial) that you dont need an fsm file. It said it was optional.

    So i wonder if i have just typed a line of a code wrong...

  4. #4
    The FSM is optional for playable units. AI controlled units always need a FSM to respond. I know it's very hard to understand and it took me a lot of time to get a simple conversation working. I think you should use Jezuro's example and try to expand it more. That's how i got started.
    | My Campaigns | Grey Sky | Operation Red Star |

  5. #5
    Corporal
    Join Date
    Sep 18 2009
    Location
    UK
    Posts
    85
    Author of the Thread
    Yes that's the tutorial I was using. Great tut, just very hard to understand some parts of it. So I see what you are saying, so basically a unit will require fsm to respond to what the player is saying (via choices for example)?

    Thats where I dropped into a deadzone, there's very little mention of how to use fsm in conjunction with the conversation.

    I'll look more into this later. Thanks for your reply

    Edit*****
    quick question, let's say I use the manual conversation flow as shown in jezuro tutorial, how would I go about adding choices? (I was thinking of using this as my backup)
    Last edited by WoodyUK; Aug 19 2010 at 00:14.

  6. #6
    quick question, let's say I use the manual conversation flow as shown in jezuro tutorial, how would I go about adding choices? (I was thinking of using this as my backup)
    You can't add choices this way, but you could just add actions that correspond to various conversation branches. If you want to use the built-in conversation menu, though, you're going to have to learn how to create FSM files. Thankfully, FSM files actually aren't that hard to make if you have a decent FSM editor. They use the same scripting language, and they're presented in a graphical way that's really quite intuitive.

  7. #7
    Corporal
    Join Date
    Sep 18 2009
    Location
    UK
    Posts
    85
    Author of the Thread
    Thanks for replying

    I have now sort of understood the logic of .fsm, and have made a very basic one. But for some reason the AI dont seem to be saying anything to the player at all . Can someone help me with this script please? and identify whats wrong?

    Many thanks.

    ps - check the first post for the scripts and the fsm =) or click here http://forums.bistudio.com/showpost....77&postcount=1
    Last edited by WoodyUK; Aug 19 2010 at 20:56.

  8. #8
    If i ignore the fact that i'm a little drunk right now i'd recommend to replace the local "_player" variable with "player" in your welcome_boss.sqf. Maybe that solves the problem. If not i'll take a closer look tommorrow...^^

  9. #9
    Corporal
    Join Date
    Sep 18 2009
    Location
    UK
    Posts
    85
    Author of the Thread
    updated first post heavily... changed it to make it easier to read
    __________________________________________________ _______________

    Haha at least you got drunk! i have done that in ages! You had a good time? :P

    Thanks for the suggestion matey, that did work a little indeed(pete) only for the first sentence of the conversation. At one point i managed to get the conversation to go through with the action boxes and stuff, and when the game crashed at the end of the bikb script i change some setting and now i cant work out what i did.

    But from listening to your advice i managed to get boss1 to say his first sentence to me! *gets a video camera to record this special moment*

    So i have been having problems since that moment i changed a part of ONE of the scripts (this was about 3 hours ago ) Is it ok if you can take a gander at me script?

    Thanks a lot for all the help you have given me so far

  10. #10
    Oh, great time...^^

    Well, the problem is that the Boss does not receive the first sentence. I guess you could do a workaround by putting the first two sentences "GoodMorning" and "boss1" into one sentence.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •