kbAddTopic: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Add examples)
m (Text replacement - "\{\{Feature *\| *Informative *\| ([^↵]+) *\}\}" to "{{Feature|informative|$1}}")
 
(48 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma2
|version1= 1.00


|1.00|= Game version
|game2= arma2oa
____________________________________________________________________________________________
|version2= 1.50


| Register conversation topic to given person.|= Description
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| person [[kbAddTopic]] [topicName, conversationFile, fsmFile, eventHandler] |= Syntax
|game4= arma3
|version4= 0.50


|p1= person: [[Object]] |= Parameter 1
|gr1= Conversations


|p2= topicName: [[String]] - the topic id for further reference |= Parameter 2
|arg= local


|p3= conversationFile: [[String]] - .bikb file path, mandatory |= Parameter 3
|eff= local


|p4= fsmFile: [[String]] - (Optional) .fsm file path |= Parameter 4
|descr= Register conversation topic to given person. See [[Conversations]] for more details.
{{Feature|informative|Only the speaker(s) need to have the topic added.}}


|p5= eventHandler: [[Code]] or [[String]] - (Optional) New to Arma2.
|s1= person [[kbAddTopic]] [topicName, conversationFile, fsmFile, eventHandler]
The event handler receives parameters:
 
|p1= person: [[Object]]
 
|p2= topicName: [[String]] - the topic id for further reference
 
|p3= conversationFile: [[String]] - .bikb file path
 
|p4= fsmFile: [[String]] - (Optional) .fsm file path. Receives the following parameters:
* '''_sentenceId:''' the sentence as defined in the .bikb file
* '''_sentenceId:''' the sentence as defined in the .bikb file
* '''_topic:''' TopicName registered via kbAddTopic
* '''_topic:''' TopicName registered via kbAddTopic
* '''_this:''' the person that was talked to (receiver)
* '''_this:''' the person that was talked to (receiver)
* '''_from:''' the person that talked to the receiver and triggered the script  
* '''_from:''' the person that talked to the receiver and triggered the script
|= Parameter 6


| [[Nothing]] |= Return value
|p5= eventHandler: [[Code]] or [[String]] - (Optional) code to execute - given String will be [[compile]]d. This is '''not''' an sqf file path.<br>
____________________________________________________________________________________________
Parameters: identical to ''fsmFile'' - see above.


|x1= <code>[[player]] [[kbAddTopic]] ["myTest", "myTest.bikb", "myTest.fsm", { execVM "myTest.sqf" }];</code> |= Example 1
|r1= [[Nothing]]


|x2= <code>[[player]] [[kbAddTopic]] ["itsGettingWarm", "weatherTalk.bikb"];</code> |= Example 2
|x1= <sqf>player kbAddTopic ["myTest", "myTest.bikb", "myTest.fsm", compile preprocessFileLineNumbers "myTest.sqf"];</sqf>


| [[kbRemoveTopic]], [[kbHasTopic]], [[kbTell]], [[FSM]] |= See also
|x2= <sqf>player kbAddTopic ["itsGettingWarm", "weatherTalk.bikb"];</sqf>


|seealso= [[Conversations]] [[kbHasTopic]] [[kbTell]] [[kbWasSaid]] [[kbReact]] [[kbRemoveTopic]] [[kbAddDatabase]] [[kbAddDatabaseTargets]] [[FSM]] [[FSM Editor]]
}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<dt class="note">[[User:Mikero|Mikero]]
<dd class="note">
*.bikb extension is by convention only. It can be anything.
*There is no default extension.
*Even tho bikb's are standard class text they cannot be raPified.
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Command Group: Conversations|{{uc:{{PAGENAME}}}}]]

Latest revision as of 19:11, 15 March 2024

Hover & click on the images for description

Description

Description:
Register conversation topic to given person. See Conversations for more details.
Only the speaker(s) need to have the topic added.
Groups:
Conversations

Syntax

Syntax:
person kbAddTopic [topicName, conversationFile, fsmFile, eventHandler]
Parameters:
person: Object
topicName: String - the topic id for further reference
conversationFile: String - .bikb file path
fsmFile: String - (Optional) .fsm file path. Receives the following parameters:
  • _sentenceId: the sentence as defined in the .bikb file
  • _topic: TopicName registered via kbAddTopic
  • _this: the person that was talked to (receiver)
  • _from: the person that talked to the receiver and triggered the script
eventHandler: Code or String - (Optional) code to execute - given String will be compiled. This is not an sqf file path.
Parameters: identical to fsmFile - see above.
Return Value:
Nothing

Examples

Example 1:
player kbAddTopic ["myTest", "myTest.bikb", "myTest.fsm", compile preprocessFileLineNumbers "myTest.sqf"];
Example 2:
player kbAddTopic ["itsGettingWarm", "weatherTalk.bikb"];

Additional Information

See also:
Conversations kbHasTopic kbTell kbWasSaid kbReact kbRemoveTopic kbAddDatabase kbAddDatabaseTargets FSM FSM Editor

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note