BIS fnc kbTell: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Add soundVolume default values)
 
(61 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= tkoh
____________________________________________________________________________________________
|version1= 1.00


| tkoh |= Game name
|game2= arma3
|version2= 0.50


|1.00|= Game version
|arg= global
____________________________________________________________________________________________


| <pre>/*
|eff= global


Description:
|gr1= Conversations
Plays conversation. Script terminates itself when conversation is finished.


Parameter(s):
|exec= spawn
_this select 0: STRING - Topic name
_this select 1 (Optional): STRING - container name (default: current mission ID)
_this select 2 (Optional): ARRAY - section to be played. Elements can be:
* STRING - "variant" - play specific variant
* ARRAY
* [startingSentence,(endingSentence)] - play al sentences between specific start and end
startingSentence can be in format:
* STRING - full sentence name (example: 04_intro_team_PLA_0")
* ARRAY - [<actorID>(,<sentenceID>)] (example: ["PLA",0] or just ["PLA_0"])
* BOOL - true to play random sentence, false to play first sentence
* default - first sentence
endingSentence can be in format:
* STRING - full sentence name (example: 04_intro_team_PLA_0")
* ARRAY - [<actorID>(,<sentenceID>)] (example: ["PLA",0] or just ["PLA_0"])
* BOOL - true to play only one sentence, false if continue to last sentence
* default - last sentence
* (default: play everything)
_this select 3 (Optional): BOOL or STRING or OBJECT or CODE - true to force radio, name of custom radio channel, listener's channel, returned value of code
_this select 4 (Optional): CODE - code executed at the start of every sentence (arguments are same as in kbAddTopic event handler) (default: {})
  ARRAY - code with arguments in format [code,arguments]
_this select 5 (Optional):
ARRAY - replacement units for those defined in .bikb file (in chronological order)
BOOL - when true, dummy logics will be created for all actor units which doesn't exist (default: false or value of 'bis_fnc_kbTell_createDummy' variable)
_this select 6 (Optional): NUMBER - music and sound volumes will be multiplied by this value when conversation starts (default: 0.1)
_this select 7 (Optional): BOOL - true to disable radio protocol message while the conversation is playing (default: true)


Returns:
|descr= Play given sentence/conversation. Script terminates itself when conversation is finished.<br>
NOTHING
Conversation must be declared in [[Description.ext#CfgSentences|Description.ext/CfgSentences]].
*/
{{Feature|informative|This function can also be executed with [[call]]. Doing so will make it internally [[spawn]] since it needs to be able suspend its execution.}}
//Todo: priority kbTell stppoing current conversation, split into several functions (config loading)
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_kbTell]]; --> |= Syntax
|s1= [topic, container, section, radioMode, code, speakers, soundVolume, radioProtocol] spawn [[BIS_fnc_kbTell]]


|p1= |= Parameter 1
|p1= topic: [[String]] - topic name


| |= Return value
|p2= container: [[String]] - (Optional, default [[missionName]]) container name ([[Description.ext#CfgSentences|CfgSentences]] sub-category)
____________________________________________________________________________________________


|x1= <code></code> |=
|p3= section: [[Array]] or [[String]] - (Optional, default "") section to be played. Elements can be:
____________________________________________________________________________________________
* [[String]] - "variant" - play specific variant
* [[Array]]
** [startingSentence(, endingSentence)] - play all sentences between specific start and end
*** startingSentence and endingSentence can be in format:
**** [[String]] - full sentence name (example: "04_intro_team_PLA_0")
**** [[Array]] - [<actorID>(, <sentenceID>)] (example: ["PLA", 0] or just ["PLA_0"])
**** [[Boolean]] - true to play random sentence, false to play first sentence
**** default - first sentence for startingSentence, last sentence for endingSentence
* default: play everything


| |= See also
|p4= radioMode: [[Boolean]], [[String]], [[Object]] or [[Code]] - (Optional, default: [[false]]) can be:
* [[Boolean]] - true to force radio
* [[String]] - name of radio channel ("DIRECT" or "VEHICLE") or [[radioChannelCreate|custom]]
* [[Object]] - listener's channel
* [[Code]] - returned value of code


}}
|p5= code: [[Code]] or [[Array]] - (Optional, default <sqf inline>{ true }</sqf>) can be:
* [[Code]] - executed at the start of every sentence (arguments are same as in kbAddTopic event handler)
* [[Array]] - code with arguments in format [code, arguments]
 
|p6= speakers: [[Array]] or [[Boolean]] - (Optional, default <sqf inline>[]</sqf>) can be:
* [[Array]] - replacement units for those defined in .bikb file (in chronological order)
* [[Boolean]] - when true, dummy logics will be created for all actor units which doesn't exist (default: false or value of 'BIS_fnc_kbTell_createDummy' variable)
 
|p7= soundVolume: [[Number]] - (Optional, default {{GVI|tkoh|1.00|size= 0.75}} 0.2, {{GVI|arma3|1.00|size= 0.75}} -1) music and sound volumes lowering ratio during the conversation, range 0..1 (e.g 0 = no music, 0.25 = a quarter of the current volume, 1 or out of range = no change)
 
|p8= radioProtocol: [[Boolean]] - (Optional, default [[true]]) true to disable radio protocol message while the conversation is playing


<h3 style="display:none">Notes</h3>
|r1= [[Nothing]]
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
|x1= <sqf>["01_Wave", "A_in", nil, "SIDE", nil, nil, 1, false] spawn BIS_fnc_kbTell;</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[Conversations]] [[kbTell]] [[BIS_fnc_kbCanSpeak]] [[BIS_fnc_kbCreateDummy]] [[BIS_fnc_kbIsSpeaking]] [[BIS_fnc_kbMenu]] [[BIS_fnc_kbPriority]] [[BIS_fnc_kbSentence]] [[BIS_fnc_kbSkip]] [[BIS_fnc_kbTellLocal]] [[BIS_fnc_kbTopicConfig]]
[[Category:Function Group: Conversations|{{uc:kbTell}}]]
}}
[[Category:Functions|{{uc:kbTell}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:kbTell}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:kbTell}}]]

Latest revision as of 00:00, 29 September 2024

Hover & click on the images for description

Description

Description:
Play given sentence/conversation. Script terminates itself when conversation is finished.
Conversation must be declared in Description.ext/CfgSentences.
This function can also be executed with call. Doing so will make it internally spawn since it needs to be able suspend its execution.
Execution:
spawn
Groups:
Conversations

Syntax

Syntax:
[topic, container, section, radioMode, code, speakers, soundVolume, radioProtocol] spawn BIS_fnc_kbTell
Parameters:
topic: String - topic name
container: String - (Optional, default missionName) container name (CfgSentences sub-category)
section: Array or String - (Optional, default "") section to be played. Elements can be:
  • String - "variant" - play specific variant
  • Array
    • [startingSentence(, endingSentence)] - play all sentences between specific start and end
      • startingSentence and endingSentence can be in format:
        • String - full sentence name (example: "04_intro_team_PLA_0")
        • Array - [<actorID>(, <sentenceID>)] (example: ["PLA", 0] or just ["PLA_0"])
        • Boolean - true to play random sentence, false to play first sentence
        • default - first sentence for startingSentence, last sentence for endingSentence
  • default: play everything
radioMode: Boolean, String, Object or Code - (Optional, default: false) can be:
  • Boolean - true to force radio
  • String - name of radio channel ("DIRECT" or "VEHICLE") or custom
  • Object - listener's channel
  • Code - returned value of code
code: Code or Array - (Optional, default { true }) can be:
  • Code - executed at the start of every sentence (arguments are same as in kbAddTopic event handler)
  • Array - code with arguments in format [code, arguments]
speakers: Array or Boolean - (Optional, default []) can be:
  • Array - replacement units for those defined in .bikb file (in chronological order)
  • Boolean - when true, dummy logics will be created for all actor units which doesn't exist (default: false or value of 'BIS_fnc_kbTell_createDummy' variable)
soundVolume: Number - (Optional, default tkoh logo small.png1.00 0.2, Arma 3 logo black.png1.00 -1) music and sound volumes lowering ratio during the conversation, range 0..1 (e.g 0 = no music, 0.25 = a quarter of the current volume, 1 or out of range = no change)
radioProtocol: Boolean - (Optional, default true) true to disable radio protocol message while the conversation is playing
Return Value:
Nothing

Examples

Example 1:
["01_Wave", "A_in", nil, "SIDE", nil, nil, 1, false] spawn BIS_fnc_kbTell;

Additional Information

See also:
Conversations kbTell BIS_fnc_kbCanSpeak BIS_fnc_kbCreateDummy BIS_fnc_kbIsSpeaking BIS_fnc_kbMenu BIS_fnc_kbPriority BIS_fnc_kbSentence BIS_fnc_kbSkip BIS_fnc_kbTellLocal BIS_fnc_kbTopicConfig

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