{"name":"kbAddTopic","operator":null,"title":"kbAddTopic","type":"command","url":"https://community.bistudio.com/wiki/kbAddTopic","revid":353355,"updated":"2024-03-15T17:11:55Z","groups":["Conversations"],"status":"ok","replaced_by":[],"games":[{"game":"arma2","name":"Arma 2","version":"1.00"},{"game":"arma2oa","name":"Arma 2: Operation Arrowhead","version":"1.50"},{"game":"tkoh","name":"Take On Helicopters","version":"1.00"},{"game":"arma3","name":"Arma 3","version":"0.50"}],"since":{"game":"arma2","name":"Arma 2","version":"1.00"},"arma3_since":"0.50","branch":null,"locality":{"argument":"local","effect":"local","server_exec":false},"exec":null,"description":"Register conversation topic to given person. See Conversations for more details.\n\n> [!NOTE]\n> Only the speaker(s) need to have the topic added.","syntaxes":[{"syntax":"person kbAddTopic [topicName, conversationFile, fsmFile, eventHandler]","since":null,"effect":null,"exec":null,"params":[{"name":"person","type":"Object","optional":false,"default":null,"description":null,"types":["Object"],"since":null,"text":"person: Object"},{"name":"topicName","type":"String","optional":false,"default":null,"description":"the topic id for further reference","types":["String"],"since":null,"text":"topicName: String - the topic id for further reference"},{"name":"conversationFile","type":"String","optional":false,"default":null,"description":".bikb file path","types":["String"],"since":null,"text":"conversationFile: String - .bikb file path"},{"name":"fsmFile","type":"String","optional":true,"default":null,"description":".fsm file path. Receives the following parameters:\n- **_sentenceId:** the sentence as defined in the .bikb file\n- **_topic:** TopicName registered via kbAddTopic\n- **_this:** the person that was talked to (receiver)\n- **_from:** the person that talked to the receiver and triggered the script","types":["String"],"since":null,"text":"fsmFile: String - (Optional) .fsm file path. Receives the following parameters:\n- **_sentenceId:** the sentence as defined in the .bikb file\n- **_topic:** TopicName registered via kbAddTopic\n- **_this:** the person that was talked to (receiver)\n- **_from:** the person that talked to the receiver and triggered the script"},{"name":"eventHandler","type":"Code or String","optional":true,"default":null,"description":"code to execute - given String will be compiled. This is **not** an sqf file path.\n\nParameters: identical to *fsmFile* - see above.","types":["Code","String"],"since":null,"text":"eventHandler: Code or String - (Optional) code to execute - given String will be compiled. This is **not** an sqf file path.\n\nParameters: identical to *fsmFile* - see above."}],"returns":{"type":"Nothing","types":["Nothing"],"description":null,"text":"Nothing"},"form":"binary","operator":null,"left":{"text":"person","types":["Object"]},"right":{"text":"[topicName, conversationFile, fsmFile, eventHandler]","types":["Array"]}}],"examples":[{"text":"```sqf\nplayer kbAddTopic [\"myTest\", \"myTest.bikb\", \"myTest.fsm\", compile preprocessFileLineNumbers \"myTest.sqf\"];\n```","code":["player kbAddTopic [\"myTest\", \"myTest.bikb\", \"myTest.fsm\", compile preprocessFileLineNumbers \"myTest.sqf\"];"]},{"text":"```sqf\nplayer kbAddTopic [\"itsGettingWarm\", \"weatherTalk.bikb\"];\n```","code":["player kbAddTopic [\"itsGettingWarm\", \"weatherTalk.bikb\"];"]}],"multiplayer":null,"problems":null,"aliases":[],"see_also":["Conversations","kbHasTopic","kbTell","kbWasSaid","kbReact","kbRemoveTopic","kbAddDatabase","kbAddDatabaseTargets","FSM","FSM Editor"],"notes":[],"categories":["Arma 2: New Scripting Commands","Arma 2: Operation Arrowhead: Scripting Commands","Arma 2: Scripting Commands","Arma 3: Scripting Commands","Command Group: Conversations","Introduced with Arma 2 version 1.00","Scripting Commands","Scripting Commands: Local Effect","Take On Helicopters: Scripting Commands"]}