Narrative
The narrative table contains data and functions that help drive the narrative system.
Loaded in Campaign | |
Loaded in Battle | |
Loaded in Frontend |
- The narrative table is created when this file is loaded.
- Data setup callbacks are added to the narrative system as scripts are loaded using calls to
narrative.add_data_setup_callback
. - These data setup callbacks contain calls to functions that set up narrative override data, such as
narrative.add_playable_faction
,narrative.add_data_for_faction
andnarrative.add_data_for_campaign
. - These data setup callbacks contain calls to functions that set up narrative override data, such as
narrative.add_playable_faction
,narrative.add_data_for_faction
andnarrative.add_data_for_campaign
. -
narrative.add_data_setup_callback(
callbackfunction
)
-
Adds a callback which sets up data for the narrative system. The callback can make calls to functions such as
narrative.add_playable_faction
andnarrative.add_data_for_faction
to set up narrative override data.
Callbacks added here will be called whennarrative.start
is called.Parameters:
1
callback
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 62
-
narrative.add_playable_faction(
faction keystring
)
-
Adds a playable faction, by key, to the narrative data. Calls to this function should be made within setup functions that are passed to
narrative.add_data_setup_callback
.
Factions will need to be added to the narrative data with this function before any data can be added for them withnarrative.add_data_for_faction
.Parameters:
1
faction key
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 86
-
narrative.add_exception_faction(
faction keystring
)
-
Adds a playable faction, by key, to the narrative exception faction list data. Calls to this function should be made within setup functions that are passed to
narrative.add_data_setup_callback
.
Factions will need to be added to the exception list to skip some elements of the narrative data.Parameters:
1
faction key
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 95
-
narrative.add_data_for_faction(
faction keystring
,
data keystring
, value
data)
-
Adds a data override for a faction within the narrative system. Factions must have been added with
narrative.add_playable_faction
before data overrides can be added for them.
Ifnarrative.get
is later called and the faction and data keys supplied to it match a data override, then the data associated with that override is returned. This can be used to override data keys for specific factions.
Calls tonarrative.get
should be made within the narrative event declarations.Parameters:
1
faction key
2
data key
3
value
data
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 104
-
narrative.add_data_for_campaign()
-
Adds a data override for a particular data key to the narrative system. This override is for all playable factions in the campaign, rather than any specific faction.
Ifnarrative.get
is later called and the data key supplied to it matches the campaign data override, then the data associated with that override is returned bynarrative.get
. Note that faction data overrides added withnarrative.add_data_for_faction
are checked before campaign-wide overrides.Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 135
-
narrative.add_loader(
loaderfunction
)
-
Adds a narrative event loader callback. When the narrative system is started with
narrative.start
, each loader function is called for each human-controlled faction in the campaign, with the faction key supplied to that function as a single argument. In a multiplayer game, each loader function will be called multiple times.Parameters:
1
loader
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 159
-
narrative.add_loader_for_faction(
faction keystring
,
loaderfunction
)
-
Adds a narrative event loader callback for a specific faction. If the subject faction is controlled by a human when the narrative system is started with
narrative.start
this loader function will be called with the faction key supplied as a single argument.Parameters:
1
faction key
2
loader
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 172
-
narrative.add_loader_for_culture(
culture keystring
,
loaderfunction
)
-
Adds a narrative event loader callback for a specific culture. When the narrative system is started with
narrative.start
, for each human-controlled faction that matches the supplied culture, this loader function will be called with the faction key supplied as a single argument.Parameters:
1
culture key
2
loader
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 194
-
narrative.add_loader_for_subculture(
subculture keystring
,
loaderfunction
)
-
Adds a narrative event loader callback for a specific subculture. When the narrative system is started with
narrative.start
, for each human-controlled faction that matches the supplied subculture, this loader function will be called with the faction key supplied as a single argument.Parameters:
1
subculture key
2
loader
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 216
-
narrative.start()
-
Calls all setup and loader functions associated with the narrative system, setting up all data.
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 250
-
narrative.get(
faction keystring
,
data keystring
)
-
Gets a data override for the specified faction key and data key, if one exists. Faction data registered with
narrative.add_data_for_faction
will be checked first, then campaign data registered withnarrative.add_data_for_campaign
.Parameters:
1
faction key
2
data key
Returns:
value
data
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 367
-
narrative.output_chain_header(
chain namestring
,
faction keystring
)
-
Helper function which produces header output for a narrative chain when it's loaded.
Parameters:
1
chain name
2
faction key
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 388
-
narrative.output_chain_footer()
-
Helper function which produces footer output for a narrative chain when it's loaded.
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 399
-
narrative.unimplemented_output(
messagestring
)
-
Helper function which prints output about unimplemented narrative chains.
Parameters:
1
message
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 407
-
narrative.todo_output(
messagestring
)
-
Helper function which prints output about narrative improvements to do.
Parameters:
1
message
Returns:
nil
defined in ../../warhammer/working_data/script/campaign/_narrative/wh3_narrative_system.lua, line 419
Data setup callbacks for the narrative system may be added with narrative.add_data_setup_callback
. Callbacks added with this function are not called until narrative.start
is called, which doesn't happen until the first tick. This structure allows narrative data to be added as scripts are loaded (potentially before the model is loaded) and only quer