Payload String Constructor
When constructing mission definitions from a string, a particularly fiddly point is assembling the payload strings for mission rewards. The payload table contains utility functions that should hopefully make this process a bit easier.
The various functions provided in the payload table can each be called with the minimum of vital data. Each will return a string which can be plugged in to mission_manager:add_payload (or equivalent functions) to specify that the mission should deliver that reward.
The payload table also provides a basic remapping feature. This is useful for when a particular faction doesn't take a particular reward (usually money) but another reward in its place (e.g. a race-specific currency like daemonic glory). Rather than having to manually override each mission record for a particular faction which would be time-consuming and error-prone, data is provided which a remapping function can use to replace the mission rewards with something more appropriate.
Example:
local mm = mission_manager:new(faction_key, mission_key);
mm:add_new_objective("SEARCH_RUINS");
mm:add_condition("total 1");
mm:add_payload(payload.money(500));
| Loaded in Campaign |
|
| Loaded in Battle |
|
| Loaded in Frontend |
|
-
payload.add_money_equivalence_mapping(faction keystring,remapping callbackfunction) -
Adds a payload remapping for a particular faction, for money. Once this remapping is established, payloads for this faction set up with
payload.moneywill instead be replaced with an alternative. The alternative is determined by the callback that is supplied to this function.
When a money payload is requested, the callback will be called and supplied three arguments - the amount of money to add, the faction key, and a table of arbitrary parameters supplied topayload.moneythat can be used to determine the equivalent payload. What goes in to this table of arbitrary parameters can be decided by the implementer, but what is added to each mission specification should match what the callback looks for.Parameters:
1
faction key
2
remapping callback
Returns:
nil
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2133
-
payload.add_ancillary_equivalence_mapping(faction keystring,remapping callbackfunction) -
Adds a payload remapping for a particular faction, for ancillary payloads. Once this remapping is established, payloads for this faction set up with
payload.ancillary_mission_payloadwill instead be replaced with an alternative. The alternative is determined by the callback that is supplied to this function.
When an ancillary payload is requested, the callback will be called and supplied three arguments - the faction key, the ancillary categorystring, and the ancillary raritystring.Parameters:
1
faction key
2
remapping callback
Returns:
nil
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2151
-
payload.money_direct(amountnumber) -
Returns a payload string which defines a money reward for a string mission definition. No money-equivalence is looked up when this function is called - use
payload.moneyto return a money-equivalent reward when appropriate.Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2176
-
payload.money(amountnumber,faction keystring,equivalence parameterstable) -
Returns a payload string which defines a money reward (or equivalent) for a string mission definition. When this function is called, a money-equivalence mapping is looking up based on the supplied faction key. If one was previously added with
payload.add_money_equivalence_mappingthen the mapping callback that was supplied to that function is called, and the returned result of that callback is returned by this function. If no remapping for this faction is found, then a money payload string is returned.Parameters:
1
amount
2
faction key
3
equivalence parameters
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2189
-
payload.text_display(text keystring) -
Returns a payload string which defines a text override for the payload description. If a text override is specified, the mission panel will display that message as the mission reward instead of trying to generate one itself. This is useful in certain circumstances, such as if completing the mission brings some custom scripted reward that the game does not natively support.
Parameters:
1
Key of text to display, from the
campaign_payloads_ui_detailsdatabase table.Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2218
-
payload.agent(spawn regionstring,agent typestring,agent subtypestring, [action pointsnumber]) -
Returns a payload string which defines an agent reward for a string mission definition. No kind of equivalence is looked up.
Parameters:
1
Key of region in which to spawn the agent, from the
regionsdatabase table.2
Agent type key, from the
agentsdatabase table.3
Agent subtype key, from the
agent_subtypesdatabase table.4
optional, default value=100
Percentage of action points that the spawned agent should start with. By default the agent starts with 100% action points.
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2245
-
payload.agent_at_faction_leader(agent typestring,agent subtypestring, [action pointsnumber]) -
Returns a payload string which defines an agent reward that is created at the event's faction leader for a string mission definition. No kind of equivalence is looked up.
Parameters:
1
Agent type key, from the
agentsdatabase table.2
Agent subtype key, from the
agent_subtypesdatabase table.3
optional, default value=100
Percentage of action points that the spawned agent should start with. By default the agent starts with 100% action points.
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2283
-
payload.agent_for_faction(faction key
string,agent type
string,agent subtype
[string],action points
[number]
) -
Returns a payload string which defines an agent reward for a string mission definition, for a faction. This differs from
payload.agentin that this function takes a faction key, and looks up the home region of that faction. If the faction has no home region, then a script error is thrown and money is substituted.Parameters:
1
Key of faction for which the agent is being spawned, from the
factionstable. This is used to specify the region in which the agent is spawned - the home region of the faction is used.2
Agent type key, from the
agentsdatabase table.3
optional, default value=nil
Agent subtype key, from the
agent_subtypesdatabase table.4
optional, default value=100
Percentage of action points that the spawned agent should start with. By default the agent starts with 100% action points.
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2316
-
payload.ancillary_mission_payload(faction key
string,ancillary category
[string],ancillary rarity
[string]
) -
Returns a mission reward string that adds the specified ancillary to the faction pool when the mission being constructed is completed.
Parameters:
1
Faction key, from the
factionsdatabase table.2
optional, default value=nil
Ancillary category. Valid values are presently
"armour","enchanted_item">,"banner">,"talisman">,"weapon"and"arcane_item". Arcane items may only be equipped by spellcasters.3
optional, default value=nil
Ancillary rarity. Valid values are presently
"common","uncommon"and"rare".Returns:
ancillarymission reward string
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2356
-
payload.ancillary_mission_payload_specific(faction keystring) -
Returns a mission reward string that adds the specified ancillary to the faction pool when the mission being constructed is completed.
Parameters:
1
Faction key, from the
factionsdatabase table.Returns:
ancillarymission reward string
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2387
-
payload.pooled_resource_mission_payload(pooled resource keystring,factor keystring,quantitynumber) -
Returns a mission reward string that adds the specified quantity of the specified pooled resource with the specified factor when the mission being constructed is completed.
Parameters:
1
Pooled resource key, from the
pooled_resourcesdatabase table.2
Factor key, from the
factorfield in thepooled_resource_factor_junctionsdatabase table.3
Quantity of pooled resource to award.
Returns:
pooled resource mission reward stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2419
-
payload.khorne_glory(amountnumber) -
Returns a payload string which defines a Khorne glory reward for a Daemons of Chaos string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2430
-
payload.nurgle_glory(amountnumber) -
Returns a payload string which defines a Nurgle glory reward for a Daemons of Chaos string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2443
-
payload.slaanesh_glory(amountnumber) -
Returns a payload string which defines a Slaanesh glory reward for a Daemons of Chaos string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2456
-
payload.tzeentch_glory(amountnumber) -
Returns a payload string which defines a Tzeentch glory reward for a Daemons of Chaos string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2469
-
payload.undivided_glory(amountnumber) -
Returns a payload string which defines an Undivided glory reward for a Daemons of Chaos string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2482
-
payload.skulls(amountnumber) -
Returns a payload string which defines a Skulls reward for a Khorne string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2495
-
payload.infections(amountnumber) -
Returns a payload string which defines an Infections reward for a Nurgle string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2508
-
payload.devotees(amountnumber) -
Returns a payload string which defines a Devotees reward for a Slaanesh string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2521
-
payload.grimoires(amountnumber) -
Returns a payload string which defines a Grimoires reward for a Tzeentch string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2534
-
payload.devotion(amountnumber) -
Returns a payload string which defines a Devotion reward for a Kislev string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2547
-
payload.supporters(amountnumber) -
Returns a payload string which defines a Supporters reward for a Kislev string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2560
-
payload.meat(amountnumber) -
Returns a payload string which defines a Meat reward for an Ogre Kingdoms string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2573
-
payload.chivalry(amountnumber) -
Returns a payload string which defines a Chivalry reward for a Bretonnia string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2586
-
payload.slaves(amountnumber) -
Returns a payload string which defines a Slaves reward for a Dark Elf string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2599
-
payload.infamy(amountnumber) -
Returns a payload string which defines a infamy reward for a Vampire Coast string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2612
-
payload.souls(amountnumber) -
Returns a payload string which defines a souls reward for a Warriors of Chaos string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2625
-
payload.canopic(amountnumber) -
Returns a payload string which defines a canopic_jars reward for a Tomb Kings string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2638
-
payload.spirit(amountnumber) -
Returns a payload string which defines a spirit_essence reward for a Mother Ostankya (Kislev) string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2651
-
payload.khorne's(amountnumber) -
Returns a payload string which defines a khornes_favour reward for a Arbaal (Khorne) string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2664
-
payload.champion's(amountnumber) -
Returns a payload string which defines a champions_essence reward for a Skultaker (Khorne) string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2677
-
payload.Thralls(amountnumber) -
Returns a payload string which defines a Thralls for a Dechala (Slaanesh) string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2689
-
payload.iron_favour(amountnumber) -
Returns a payload string which defines Iron Favour resource for a Bhashiva (Grand Cathay) string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2701
-
payload.Warpstone(amountnumber) -
Returns a payload string which defines a Warpstone reward for a Thanquol (Skaven) string mission definition. No kind of equivalence is looked up.
Parameters:
1
amount
Returns:
payload stringstring
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2713
-
payload.mercenary_mission_payload(unit keystring,quantitynumber) -
Returns a mission reward string that adds the specified quantity of the specified unit to the faction's mercenary pool when the mission being constructed is completed. This would only have an effect for faction's that feature a mercenary pool.
Parameters:
1
Unit key, from the
main_unitsdatabase table.2
Quantity of units to add.
Returns:
nil
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2737
-
payload.effect_bundle_mission_payload(effect bundle keystring,turnsnumber) -
Returns a mission reward string that applies the specified effect bundle to the faction when the mission being constructed is completed. An optional duration in turns may be specified.
Parameters:
1
Effect bundle key, from the
effect_bundlesdatabase table.2
Number of turns the effect should be applied for. If this is omitted
Returns:
nil
defined in ../../../warhammer/working_data/script/_lib/lib_campaign_mission_manager.lua, line 2759