Modding Guide - dakkhuza/MoreLevelContent GitHub Wiki
All content added by More Level Content is fully extendable by other xml mods.
This guide is currently WIP but you should be able to get most of the way there with it and by reading the files. If you have any questions feel free to ping me (_dak) on either the official barotrauma server or the MLC server.
See this file for an example.
- Create the pirate base in a sub editor
- Save it as a
OutpostModule - Set the
Location Typeof the module toilo_pirateoutpost - Create a new mission xml file
<Missions tags="MLC, pirateoutposts">
<PirateOutposts
identifier="youridentifierhere"
tags="mlc, pirateoutpostset"
type="GoTo">
</PirateOutposts>
</Missions>
Take note of the tags, these are important as without them the mod will not pick up your pirate base
- Add your pirate base as a sub element of
PirateOutpostsusing the following format
<PirateOutpost path="%ModDir%/Path/To/Sub.sub" mindiff="0" maxdiff="10" placement="Bottom"/>
Path - The path to the pirate base
mindiff - The minimum difficulty the level has to be for this base to spawn
maxdiff - The maximum difficulty the level can be for this base to spawn
placement - If the base will be placed on the top of bottom of the passage, Bottom or Top are the valid inputs
Do note that min and max are not hard limits, high diff bases can still spawn at low difficulties but are VERY rare
And that's it, you've added your new pirate base!
See this file
- Create a new submarine
- Ensure there is some container capable of holding crates tagged with
dropoff - Save it as an outpost module with the location set to
mlc_BeaconConstruction
Distress missions randomly spawn on the campaign map and will disappear after some time. Distress missions can be any mission type valid for a non-outpost level, however if you use one of the custom mission types added by this mod the reward will be hidden until the mission is completed.
See this file for an example.
- Create a new missions xml file
- Create a new mission
- Tag it with
distress - You're done! Typically mission setup like commonness will affect how often this mission gets picked as a distress mission
To setup the custom missions added by this mod takes an additional step
- Set the
typeof the mission toGoTo - Add an additional attribute called
customType, this can be any of the followingDistressEscort,DistressSubmarine,DistressGhostship
See below on how to setup each of these custom mission types, these custom mission types are intended to be used during distress missions but can be used as regular missions as well.
This custom mission type is similar to an escort mission but the escort target spawns somewhere in the level.
- Set
customTypetoDistressEscort - Add a sub element to the mission called
Characters
<Characters
spawntype="Cave"
hostile="false">
<Item
from="mlc_distress_npcs"
identifier="lostdiver"
allowordering="true" />
</Characters>
spawntype - Where the characters will spawn, see here for valid spawn locations. You can use many locations as well by separating them with a |, e.g. MainPath | SidePath Do note that if the location isn't available the targets will spawn at 0,0
hostile - Depreciated, do not use this. Was used for ambushes but these were a bit jank and confusing to players so they were removed. You can still try using this but it's unsupported.
Item - This element defines a character that will need to be escorted out of the level.
from - The NPCSet to pull this character from
identifier - The identifier of an NPC prefab in the set
allowordering - If the player should be able to give this character orders
minmoney - The minimum amount of money in this NPCs wallet, this will be looted off their body by a player grabbing them if they are dead
maxmoney - The maximum amount of money in this NPCs wallet
All NPCs spawned by distress missions also support the following sub-attributes.
<AdditionalItems>
<Item identifier="captains_notebook" />
</AdditionalItems>
This is an additional set of items that will get added onto the items defined by the NPC prefab.
Distress missions also support the color attribute, e.g. <Item from="npcset" identifier="prefab" color="250,164,107" /> to set the color of the NPCs name.
This custom mission spawns a shuttle on the level that the players must escort out. The player gets additional rewards for each surviving crew member of the shuttle.
- Set
customTypetoDistressSubmarine
This mission a few attributes added to the base mission element
<DistressSubmarine
crewsurviveidentifier="distress.submarinesuccess.crew"
subsalvagedidentifer="distress.submarinesuccess.sub"
revealedFailureidentifer="distress.submarinefail">
crewsurviveidentifier - This is the text shown on the end screen if the crew of the shuttle survives.
subsalvagedidentifer - This is the text shown on the end screen if the crew does not survive but the shuttle is brought to the end of the level.
revealedFailureidentifer - This is the text shown if the mission is failed after the player has seen the shuttle, e.g. the player does not bring the shuttle to the end of the level.
- Add a sub-element to the mission named
Submarine
<Submarine path="path/to/sub.sub" />
path - The path to the submarine you want to spawn.
- Add a sub-element to the mission named
monsters
This works exactly like the monsters element on beacon stations
- Add a sub-element to the mission named
Characters
<Characters>
<Item from="mlc_distress_npcs" identifier="shuttlecaptain" allowordering="true" isCaptain="true" payout="150" color="250,164,107" />
<Item from="outpostnpcs1" identifier="commoner" allowordering="true" payout="500" />
</Characters>
isCaptain - Forces additional orders onto the NPC, specifically: fightintruders, repairsystems & fixleaks.
payout - An additional sum of money added to the missions payout if this NPC survives. Displays under their name.
color - The color of the NPCs name, this is supported by all distress missions
All spawn points on a submarine spawned in by this distress mission are automatically tagged with distress_ghostship. This allows you to use the tag distress_ghostship in scripted events to spawn things on the sub. Typically ghostship missions use the config options of the mission to "set the scene" and then spawn in the meat of the mission using a scripted event.
- Set the
customTypetoDistressGhostship - Add a sub-element named
Submarines
Ghostship type missions support having a list of subs to choose from.
<Submarines>
<Sub path="path/to/sub.sub" commonness="100" />
</Submarines>
The <Submarines> element has some additional attributes you can add.
traveltarget - Where the auto-pilot of the sub will try to travel to, Start, Maintain, End. Defaults to Maintain.
ReactorActive - When set to turn the game will turn on the reactor and set it to auto-operate as well as disabling it's fuel consumption. Defaults to true.
AllowStealing - If the player is allowed to steal from the sub.
floodtargets - A comma separated list of room names to flood, room1, room2, ....
minfloodpercentage - The minimum amount to flood the room by, 0.5 is 50% full of water, 1 is 100% full.
maxfloodpercentage - The maximum amount to flood the room by.
- (OPTIONAL) Add a sub-element named
Characters
<Characters>
<Item
from="mlc_distress_corpses"
identifier="distress_captain"
minmoney="100"
maxmoney="300"
alive="false">
<AdditionalItems>
<Item identifier="captains_notebook" />
</AdditionalItems>
<Affliction identifier="gunshotwound" randomLimb="true"
randomStrength="true" count="4" />
</Item>
</Characters>
Ghostship type missions support the standard distress mission npcs config as well as these additional attributes.
alive - Setting this to false will spawn in this character already dead.
minmoney - The minimum amount of money on this character, players will receive this when looting the body.
maxmoney - The maximum amount of money on this character.
<Affliction /> - This sub-element will apply afflictions to the character, use for set-dressing (bullet wounds on a ship taken over by bandits) or for turning this character into a husk.
identifier - The identifier of the affliction to apply.
randomLimb - If this affliction should go on a random limb.
randomStrength - If this affliction should have a random strength (10-70).
count - How many times to apply this affliction.
limb - The specific limb to apply this affliction to, see here for a list of valid limbs.
strength - The strength of the affliction.
- (OPTIONAL) Add a sub-element named
Decals
<Decals>
<Item prefab="blood" count="20" />
<Item prefab="explosion" count="2" preferedhull="roomname.commandroom" />
</Decals>
prefab - The identifier of the decal prefab you want to spawn
count - How many of this decal should spawn.
preferedhull - The name of the hull this decal will spawn in.
- (OPTIONAL) Add an element named
<RemoveItems>
<RemoveItems>
<Item tag="reactorfuel" />
</RemoveItems>
tag - The tag of an item type you want to remove from the sub.
- (OPTIONAL) Add an element named
<TagDevices>
<TagDevices>
<Item identifier="reactor1" tag="distress_reactor" />
</TagDevices>
This will apply the specified tag to devices with the given identifier, you can use this if you need to tag a specific item on the sub for an event without tagging an item on the player sub or somewhere in the level.
identifier - The identifier of the item to tag.
tag - The tag to apply to the item.
Map Features are unique points of interest that are spawned on certain campaign levels.
See this file for an example.
- Create a new missions xml file
- Tag it with
mlc, mapfeatureset - Create a new GoTo mission
- Tag it with
mlc, mapfeatureset - Add a sub element named
MapFeatureBreak down of theMapFeatureelement and properties
<MapFeature path="%ModDir%/path/to/sub/file.sub"
identifier="unique_identifier_for_feature" spawnPosition="PathWall or AbyssIsland"
placement="Top or Bottom" commonnessperzone="1: 0.25, 2: 0.5, 3: 0.45, 4: 0.3, 5: 0.2"
chance="0.2f" allowstealing="false">
<Display icon="IconDefinedInAStyleXML" tooltip="text_identifier_of_map_tooltip" hideuntilrevealed="true" />
</MapFeature>
path - The path to the submarine file you want this feature to use
identifier - A unique string to identify this feature by
spawnPosition - Where this feature will spawn on a level, values are either PathWall for wreck like spawning or abyssIsland to spawn it on an island in the abyss
placement - Either Top or Bottom, if you want to feature to spawn on the top or bottom of the placement type you've selected
commonnessperzone - The likelihood this feature gets picked for consideration for spawning in a given zone, this uses weighted probability against all other options
chance - The chance for this map feature to be place if it's chosen for a given connection
allowstealing - If items spawned on this feature are allowed to be stolen or not
Display - This element handles how the map visually appears on the campaign map screen
icon - The name of the icon this feature will display as on the map screen, see here for an example of how to define an icon.
tooltip - A text identifier that will be displayed when the player hovers over the icon on the campaign map
hideuntilrevealed - If this feature is visible to the user by default or if they have to either find the feature in a level or have an event reveal it.
This is a pool of events that can happen at a given map feature. One event from the pool will be chosen at the start of the round. Event sets from multiple mods will be added to the pool a given map feature can choose from.
See this file for an example.
- Create a new missions xml file
- Tag it with
MLC, mapfeatureeventset - Create a new GoTo mission
- Tag it with
mlc, mapfeatureeventset - Add a sub element named
EventsBreak down of theEventselement and properties
<Events features="comma_separated_list_of_map_features_to_target, you_can_have_multiple">
<ScriptedEvent identifier="identifier_of_scripted_event_to_trigger" commonness="3" probability="1" />
</Events>
features - A comma separated list of the identifiers of map features this set of events can appear on
<ScriptedEvent /> - This element defines the event that can be triggered, you can have multiple.
identifier - The identifier of the scripted event you want to happen here.
commonness - How likely this event is to be chosen
probability - The probability this event will activate if it is chosen, 0.5 = 50% of the time, 1 = 100% of the time.
More Level Content adds in some custom event actions for interacting with map features
<RevealMapFeatureAction mapfeatureidentifier="feature_identifier" />
This action reveals a nearby map feature that matches the mapfeatureidentifier given and then displays a popup notifying the players that the feature was revealed.
<TeleportCharacterAction TargetTag="tag" />
This action will teleport the targeted character to: A random point inside a ruin, if there is no ruin it will choose a random point in a wreck, if there is no wreck it will choose a random point in an abyss cave, if all else fails it will choose a random point on the main or side path.
(If there is interest, I can add the option to choose one of these as the primary target)
(DO NOT USE, WILL CAUSE DE-SYNC IN MULTIPLAYER)
<AlterMapFeatureAction mapfeatureidentifier="identifier_to_chance_to"/>
This action will change the current map feature to the feature specified by mapfeatureidentifier.
This is NOT synced in multiplayer and WILL cause de-sync and kicks. I didn't finish the syncing on this action because I ended up not needing it but if there is interest in this feature by other modders I'll finish it up.