kbAddTopic: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (seeAlso edited)
m (template:command argument fix)
Line 7: Line 7:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Register conversation topic to given person. See [[Conversations]] for more details. |= Description
| Register conversation topic to given person. See [[Conversations]] for more details. |DESCRIPTION=
____________________________________________________________________________________________
____________________________________________________________________________________________


| person [[kbAddTopic]] [topicName, conversationFile, fsmFile, eventHandler] |= Syntax
| person [[kbAddTopic]] [topicName, conversationFile, fsmFile, eventHandler] |SYNTAX=


|p1= person: [[Object]] |= Parameter 1
|p1= person: [[Object]] |PARAMETER1=


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


|p3= conversationFile: [[String]] - .bikb file path |= Parameter 3
|p3= conversationFile: [[String]] - .bikb file path |PARAMETER3=


|p4= fsmFile: [[String]] - (Optional) .fsm file path. Receives the following parameters:
|p4= fsmFile: [[String]] - (Optional) .fsm file path. Receives the following parameters:
Line 23: Line 23:
* '''_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 4
|PARAMETER4=


|p5= eventHandler: [[Code]] or [[String]] - (Optional) '''The event handler receives the same parameters as the fsm''' |= Parameter 6
|p5= eventHandler: [[Code]] or [[String]] - (Optional) '''The event handler receives the same parameters as the fsm''' |PARAMETER6=


| [[Nothing]] |= Return value
| [[Nothing]] |RETURNVALUE=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>[[player]] [[kbAddTopic]] ["myTest", "myTest.bikb", "myTest.fsm", [[compile]] [[preprocessFileLineNumbers]] "myTest.sqf"];</code> |= Example 1
|x1= <code>[[player]] [[kbAddTopic]] ["myTest", "myTest.bikb", "myTest.fsm", [[compile]] [[preprocessFileLineNumbers]] "myTest.sqf"];</code> |EXAMPLE1=


|x2= <code>[[player]] [[kbAddTopic]] ["itsGettingWarm", "weatherTalk.bikb"];</code> |= Example 2
|x2= <code>[[player]] [[kbAddTopic]] ["itsGettingWarm", "weatherTalk.bikb"];</code> |EXAMPLE2=


| [[Conversations]], [[kbHasTopic]], [[kbTell]], [[kbWasSaid]], [[kbReact]], [[kbRemoveTopic]], [[kbAddDatabase]], [[kbAddDatabaseTargets]], [[FSM]], [[FSM Editor]] |= See also
| [[Conversations]], [[kbHasTopic]], [[kbTell]], [[kbWasSaid]], [[kbReact]], [[kbRemoveTopic]], [[kbAddDatabase]], [[kbAddDatabaseTargets]], [[FSM]], [[FSM Editor]] |SEEALSO=


}}
}}

Revision as of 15:42, 7 April 2019

Hover & click on the images for description

Description

Description:
Register conversation topic to given person. See Conversations for more details.
Groups:
Uncategorised

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) The event handler receives the same parameters as the fsm
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:
ConversationskbHasTopickbTellkbWasSaidkbReactkbRemoveTopickbAddDatabasekbAddDatabaseTargetsFSMFSM 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

Notes

Bottom Section