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
![]()
HOME 
Reply With Quote

