{"name":"kbAddTopic","title":"kbAddTopic","type":"command","url":"https://community.bistudio.com/wiki/kbAddTopic","revid":353355,"updated":"2024-03-15T17:11:55Z","groups":["Conversations"],"status":"ok","games":{"arma2":"1.00","arma2oa":"1.50","tkoh":"1.00","arma3":"0.50"},"since":"arma2 1.00","arma3_since":"0.50","locality":{"argument":"local","effect":"local"},"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]","params":[{"name":"person","type":"Object","type_expr":"Object"},{"name":"topicName","type":"String","description":"the topic id for further reference","type_expr":"String"},{"name":"conversationFile","type":"String","description":".bikb file path","type_expr":"String"},{"name":"fsmFile","type":"String","optional":true,"description":".fsm file path. Receives the following parameters:\n\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","type_expr":"String","text":"fsmFile: String - (Optional) .fsm file path. Receives the following parameters:\n\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,"description":"code to execute - given String will be compiled. This is **not** an sqf file path.\nParameters: identical to *fsmFile* - see above.","type_expr":"Code | String","text":"eventHandler: Code or String - (Optional) code to execute - given String will be compiled. This is **not** an sqf file path.\nParameters: identical to *fsmFile* - see above."}],"returns":{"type":"Nothing","type_expr":"Nothing"},"form":"binary","left":{"text":"person"},"right":{"text":"[topicName, conversationFile, fsmFile, eventHandler]"}}],"examples":[{"code":["player kbAddTopic [\"myTest\", \"myTest.bikb\", \"myTest.fsm\", compile preprocessFileLineNumbers \"myTest.sqf\"];"]},{"code":["player kbAddTopic [\"itsGettingWarm\", \"weatherTalk.bikb\"];"]}],"see_also":["Conversations","kbHasTopic","kbTell","kbWasSaid","kbReact","kbRemoveTopic","kbAddDatabase","kbAddDatabaseTargets","FSM","FSM Editor"]}