Basic Tutorial - BannerlordCE/TutorialCE GitHub Wiki
In this tutorial, we will be going over how to make basic element to create a captive event for the mod.
Captivity Events will be able to detect your mod when it detects a dependency. CE will attempt to load pictures/flags/sounds/events from the module into the game.
Steps
- Navigate to your modules folder (Mount & Blade II Bannerlord\Modules).
- Create a folder called
zNAMEOFMOD
(This will be your module folder). - Create an xml file called
SubModule.xml
(This should contain the content below)
<!-- SubModule.xml -->
<?xml version="1.0" encoding="utf-8"?>
<Module>
<Name value="NAME OF MOD" />
<Id value="zNAMEOFMOD" />
<Version value="v1.0.0" />
<SingleplayerModule value="true" />
<MultiplayerModule value="false" />
<DependedModules>
<DependedModule Id="zCaptivityEvents" DependentVersion="v1.8.0.1035"/>
</DependedModules>
<SubModules>
</SubModules>
</Module>
- Create
Images
andEvents
folders inside of thezNAMEOFMOD
folder. - Inside of the
Events
folder create a file calledDefaultExample.xml
// Your file structure should look like this
📂 zNAMEOFMOD
┣ 📄 SubModule.xml
┣ 📂 Images
┣ 📂 Events
┃ ┗ 📄 **DefaultExample.xml**
┗ 📂 ModuleData
┗ 📂 Languages
┗ 📂 English
┣ 📄 language_data.xml
┗ 📄 DefaultExample.xml
Here is a sample of a basic captivity event. You can copy and paste this into DefaultExample.xml
.
<?xml version="1.0" encoding="UTF-8"?>
<CEEvents xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://CEEventsModal.xsd">
<!-- SampleEvent -->
<CEEvent>
<Name>CE_common_example_1</Name>
<Text>Event Text Here.</Text>
<BackgroundName>CE_custom_background</BackgroundName>
<MultipleRestrictedListOfFlags>
<!-- Category Flag -->
<RestrictedListOfFlags>Common</RestrictedListOfFlags>
<!-- Type Flag -->
<RestrictedListOfFlags>Captive</RestrictedListOfFlags>
<!-- Location Flags -->
<RestrictedListOfFlags>LocationTavern</RestrictedListOfFlags>
<RestrictedListOfFlags>LocationCity</RestrictedListOfFlags>
</MultipleRestrictedListOfFlags>
<Options>
<Option>
<Order>0</Order>
<MultipleRestrictedListOfConsequences>
<RestrictedListOfConsequences>EmptyIcon</RestrictedListOfConsequences>
</MultipleRestrictedListOfConsequences>
<OptionText>Option One.</OptionText>
<TriggerEventName>CE_common_example_alt_1</TriggerEventName>
</Option>
<Option>
<Order>1</Order>
<MultipleRestrictedListOfConsequences>
<RestrictedListOfConsequences>ChangeHealth</RestrictedListOfConsequences>
<RestrictedListOfConsequences>EmptyIcon</RestrictedListOfConsequences>
</MultipleRestrictedListOfConsequences>
<OptionText>Option Two.</OptionText>
<HealthTotal>-10</HealthTotal>
</Option>
</Options>
<ReqCustomCode>true</ReqCustomCode>
<SexualContent>false</SexualContent>
<WeightedChanceOfOccuring>20</WeightedChanceOfOccuring>
</CEEvent>
<CEEvent>
<Name>CE_common_example_alt_1</Name>
<Text>Event Text Here.</Text>
<BackgroundName>CE_custom_background_2</BackgroundName>
<MultipleRestrictedListOfFlags>
<RestrictedListOfFlags>Captive</RestrictedListOfFlags>
<!-- CanOnlyBeTriggeredByOtherEvent Flag (Make sure this is set for events that you don't want to randomly call) -->
<RestrictedListOfFlags>CanOnlyBeTriggeredByOtherEvent</RestrictedListOfFlags>
</MultipleRestrictedListOfFlags>
<Options>
<Option>
<Order>0</Order>
<MultipleRestrictedListOfConsequences>
<RestrictedListOfConsequences>ChangeHealth</RestrictedListOfConsequences>
<RestrictedListOfConsequences>EmptyIcon</RestrictedListOfConsequences>
</MultipleRestrictedListOfConsequences>
<OptionText>Option One.</OptionText>
<HealthTotal>10</HealthTotal>
</Option>
</Options>
<ReqCustomCode>true</ReqCustomCode>
<SexualContent>false</SexualContent>
<WeightedChanceOfOccuring>20</WeightedChanceOfOccuring>
</CEEvent>
</CEEvents>
As you may notice it is actually two events. With one event calling another when the player selects the first option.
<Option>
<Order>0</Order>
<MultipleRestrictedListOfConsequences>
<RestrictedListOfConsequences>EmptyIcon</RestrictedListOfConsequences>
</MultipleRestrictedListOfConsequences>
<!-- Text of Option -->
<OptionText>Option One.</OptionText>
<!-- Trigger is Here (occurs by name) -->
<TriggerEventName>CE_common_example_alt_1</TriggerEventName>
</Option>
WORK IN PROGRESS