User Tools

Site Tools


modding:tutorials:encounter-sample

Tutorial: Creating a Sample Encounter

Encounters are similar to a D&D “random encounter” system. Encounters can be defined at the Module and Mission levels. Encounters at the mission level will override Encounters at the module level that have the exact same name.

For more information about the different options when creating an encounter, read the Encounter article.

01: Tutorial Goal

Let's create an encounter that spawns one object and triggers one action. Our goals are to:

  1. Spawn (1) Cargo Train
  2. Give the Cargo Train (10) Wasp Missiles
  3. Have the Cargo Train send a message that reads, “Horizons, it looks like you could use these.”
  4. Make it so that this encounter can only happen once.
  5. Make it so that this encounter has a 10% chance of triggering every time an Alliance Player enters a system.

02: Adding an Encounter

Open the Module or Mission that you wish to add this encounter to.

Click on the Encounters page for that Mission or Module.

Select “Add An Encounter”

Set the Name to something unique.

Set the Faction to Alliance, so that Alliance player ships can trigger this Encounter. (Goal #5)

Leave the location field blank because we don't want to limit this to a Planet, System, or Tag.

Set the chance to 0.1, which translates to 10%. (Goal #5)

Uncheck the Repeating? box so that this Encounter only happens once.

Check the box that makes this Encounter Active. (Goal $4) (If you wanted this to wait until a specific point in the mission to be a potential Encounter, leave it as inactive and activate it using an Event Action.)

03: Add An Encounter Group

Press the green Add button.

Give this Encounter Group an Index and a Name.

04: Add an Object

Under Objects, select Add. (Goal #1)

Set up the object's General information as you normally would, setting the Class to Cargo Train. In the Cargo menu, add 10 Wasp Missiles to the ship's inventory. Set other settings, as needed. Save the Object to close the Object editor. (Goal #2)

05: Add an Action

Under Actions, select Add.

Set the Action Type to “Send Message”. (Goal #3) TO = Player. FROM = Cargo Train (or whatever you named it on a previous step). Text: “Horizons, it looks like you could use these.”

Save the action and the Encounter Group.

06: Testing!

Run your mission or module and see if it works well! Remember, it may take a bit of trial and error before it is ready to go.

Questions?

Join our Discord Server so that we can help you!

modding/tutorials/encounter-sample.txt · Last modified: 2021/05/07 00:47 by jazzy