Campaign Conversations
The campaign conversation system provides an interface for easy scripting of conversations. This is when multiple items of advice (or similar types of content, such as VO with subtitles) are played back-to-back with the player observing, and clicking through each.
| Loaded in Campaign |
|
| Loaded in Battle |
|
| Loaded in Frontend |
|
A conversation is first declared with campaign_conversation:new. This returns a campaign conversation object.
Once declared, a conversation may optionlly be configured with the functions in the Configuration section of this documentation. It is mandatory, however, to add actions with campaign_conversation:add_advice or similar.
A conversation that is configured can then be started with campaign_conversation:start. A running conversation may be skipped by calling campaign_conversation:skip.
Example:
local conv_example = campaign_conversation:new(
"example_conversation",
function(),
out("Conversation completed!")
true
)
conv_example:set_default_delay(1.5)
conv_example:add_advice("example_advice_key_1")
conv_example:add_advice("example_advice_key_2")
conv_example:add_advice("example_advice_key_3")
conv_example:add_advice("example_advice_key_4")
conv_example:start()
-
campaign_conversation:new(namestring, [end callbackfunction]) -
Creates and returns a new campaign conversation object.
Parameters:
1
String name for the conversation. This is used for output.
2
optional, default value=nil
Callback to call when the conversation ends.
Returns:
nil
defined in ../../Warhammer/working_data/script/_lib/lib_campaign_conversation.lua, line 73
-
campaign_conversation:set_proceed_on_advice_finished([proceed automaticallyboolean]) -
Sets whether the conversation should automatically proceed to the next section when advice audio has finished playing. By default this is set to
falsewhich means the player will need to dismiss advice items manually to progress.
This default value can also be overridden on a per-advice basis as it is added withcampaign_conversation:add_advice.Parameters:
1
optional, default value=true
Proceed automatically on advice audio finished.
Returns:
nil
defined in ../../Warhammer/working_data/script/_lib/lib_campaign_conversation.lua, line 114
-
campaign_conversation:set_default_delay(delay interval snumber) -
Sets the default delay between one conversation item finishing and the next starting. By default this is half a second.
This default value can also be overridden on a per-advice basis as it is added withcampaign_conversation:add_advice.Parameters:
1
Delay interval in seconds.
Returns:
nil
defined in ../../Warhammer/working_data/script/_lib/lib_campaign_conversation.lua, line 127
-
campaign_conversation:set_play_with_cutscene_bars([play with cutscene barsboolean]) -
Sets whether the conversation should play out with cutscene bars. This is disabled by default - use this function to enable this behaviour.
Parameters:
1
optional, default value=true
play with cutscene bars
Returns:
nil
defined in ../../Warhammer/working_data/script/_lib/lib_campaign_conversation.lua, line 140
-
campaign_conversation:add_advice(advice key
string,infotext
[table],show topic leader
[boolean],dismiss before playing
[boolean],initial delay
[number],proceed on advice finished
[boolean],start callback
[function]
) -
Adds an advice record to play in sequence as part of the conversation.
Parameters:
1
Advice key, from the
advice_threadsdatabase table.2
optional, default value=nil
Infotext to show with the advice. This should be a table of strings.
3
optional, default value=false
Use the first line of infotext as a topic leader.
4
optional, default value=nil
Dismiss the advisor before playing this item of advice. This happens by default, but this flag can be set to
falseto disable this behaviour.5
optional, default value=nil
Delay in seconds between this section of the conversation starting and the advice being triggered. If supplied, this value overrides the default behaviour set with
campaign_conversation:set_default_delay, but just for this advice.6
optional, default value=nil
Proceed immediately after this advice has finished playing to the next advice (or end of the conversation). If supplied, this value overrides the default behaviour set with
campaign_conversation:set_proceed_on_advice_finished, but just for this advice.7
optional, default value=nil
Optional callback to call when this conversation item starts playing.
Returns:
nil
defined in ../../Warhammer/working_data/script/_lib/lib_campaign_conversation.lua, line 167
-
campaign_conversation:start() -
Starts the conversation. Conversation records need to have been added with
campaign_conversation:add_adviceor equivalent before this function is called.Returns:
nil
defined in ../../Warhammer/working_data/script/_lib/lib_campaign_conversation.lua, line 217
-
campaign_conversation:is_active() -
Returns whether this conversation is currently playing or not.
Returns:
is conversation playingboolean
defined in ../../Warhammer/working_data/script/_lib/lib_campaign_conversation.lua, line 392
-
campaign_conversation:skip(reasonstring) -
Skips the running conversation, ending it immediately. A string reason may be supplied for output purposes.
Parameters:
1
reason
Returns:
nil
defined in ../../Warhammer/working_data/script/_lib/lib_campaign_conversation.lua, line 400