Ancestors Legacy Guide

[MOD] Spawn Points for Ancestors Legacy

[MOD] Spawn Points

Overview

One of the tools you will be using the most during missions creating are Spawn Points, which enables you spawning groups of player/enemy/allied warriors. Let’s take a look

Basic information

Spawn point are extremely useful for creating single-player missions. You can use them for giving the player initial army, creating encounters on the road and spawning reinforcements from the ally. Using Spawn Points (exact path: Blueprints/Game/BP_Anc_SpawnPoint) is the recommended way for spawning squads of warriors during the mission.

Start from just adding a Spawn Point into the level.

Now, let’s see what configuration options are there.

If you will feel overwhelmed, don’t worry, you don’t have to use all of the parameters, only a handful will be enough for a start. To simply spawn a squad at a level start, you only have to check Begin Play Should Spawn property and select a valid squad class via Begin Play Squad to Spawn property. Change Begin Play Owner ID if you want to assign squad to a different Player Start than player’s. That’s enough for a beginning.

Spawn Point parameters

There are A LOT of parameters which you can use for customizing your Spawn Point. We will cover them all one by one. Here goes the first part:

Begin Play Should Spawn: Whenever this Spawn Point should automatically spawn a squad on a game start, or not.

Begin Play Squad to Spawn: Class of squad this Spawn Point will be able to spawn. Important! You have to have this class loaded (guide focusing on assets loading can be found HERE).

Begin Play Owner ID: Index of player this squad should be assigned to. Important! You have to have properly set up Player Start with the same Desired Player Index (Player Start guide can be found HERE).

Armor Level: Choose between 0, 1 and 2 for determining armor level of squad spawned from this Spawn Point.

Initial Level: Experience level of a spawned squad, choose from 0 to 4 range.

Initial Specialization: If initial level is higher than 0, you can assign a specialization to a spawned squad. Please be sure to select only available specializations for a specified squad, i.e. choosing specialization Accuracy for a shieldmen squad won’t work.

Initial Pawn Amount: How many warriors should spawn. Default value 0 means this property will have no effect and squad will be spawn full. Please do not exceed default max warriors number for a specified squad.

B Defensive Formation: Check this property to put squad in defensive formation right after spawn.

Received Damage Mod: How vulnerable for damage spawned squad will be, basically all damage for warriors in this squad will be multiplied by this number. So 0 will make warriors immortal, 1 have no effect, 5 will make warriors highly vulnerable.

Immortal: By checking this property you are making warriors in a spawned squad immortal – they will take damage, their health indicator will turn red, but they will never die.

Begin Play Damage: All warriors will receive that amount of damage right after spawn. Useful for spawning a squad with no full health.

Initial HP Per Pawn: More precise way for spawning a squad with wounded warriors. You can use this array to determine initial HP for a single warriors in a spawned squad.

Text: Debug property, text visible above Spawn Point actor in the editor.

Show Banner: Whenever a spawned squad should have a visible banner or not.

Skill to Use After Spawn: A spawned squad will try to use this skill right after spawn. Be sure to only select skills available for a spawned squad and use its blueprint versions (i.e. BP_Anc_Skill_Ang_Chase for Anglosaxon Slingers).

Squad AI Paused?: Uncheck this property for enabling single-player AI on a spawned squad. Important! Please do not unpause single-player AI on player controlled squads.

Squad AI Sight Radius: If squad AI will be enabled/unpaused on a spawned squad this property will determine its sight distance. It’s a very important property, because single-player AI squads do not use Fog of War mechanics.

Squad AI Type: Type of behavior for single-player AI, if enabled/unpaused. There are two recommended ones:

  • Suicidal: Squad will just attack every enemy in its range (determined by Squad AI Sight Radius).
  • Alarming: Squad will be able to notify other ally nearby squads about noticed danger and will be able to react for a such notification.

    And the rest of the parameters:

    Has Torches?: A spawned squad will have torches lit. Important! Do not use on player’s squads, for this scenario select BP_Anc_Skill_All_Troches in Skill to Use After Spawn property.

    Move to Locations: By adding locations to this array you can set up an initial move path for a spawned squad. You can adjust this locations by using transform widgets in the editor viewport (look at a screen below).

    Should Loop Move: If this Spawn Point has at leat 2 entries in Move To Locations array you can check this property for making this initial path looped. Very useful for creating patrol routes.

    Squads AI Timer Override: Only applies if you have the property Squad AI Paused? unchecked (so single-player AI is enabled). Single-player AI evaluates its logic state only from time to time, not in every frame, for performance reasons. Default value is 2 seconds, but by selecting value bigger than 0 in this property you can override that value.

    Movement Speed: Speed of executing initial movement orders (Move to Locations array), -1 means default speed. You can’t use this property to exceed maximum squad speed derived from its statistics.

    Is True Neutral: By checking this property you are making this spawned squad neutral, which means it won’t be treated as an enemy for any single-player AI squads and player won’t be able to attack this squad – all of that despite of this squad’s Begin Play Owner ID.

    Override Offensive Formation: Check if you want to override warrior’s layout (locations) in offensive formation.

    Overridden Offensive Formation: If above boolen is checked, you can select overridden offensive formation here.

    Has Fake Camp: If you check this property a spawned squad’s medcamp will not heal warriors, they will be sitting in it forever.

    Spawn Instantly: By default warriors will spawn with a slight delay one after each other – for performance reasons. If you really want, you can spawn a whole squad instantaneously, just check this property.

    Disabler Returning to Position After Alarm: This property is relevant only if single-player AI is enabled and its type is Alarming. By default, when the squad was alarmed, but after moving to investigate there is no danger to be seen, squad will return to its previous activities (i.e. patrolling). If you would like a spawn squad to remain in location of alarm, check this property.

    Specialisations for AI to Choose: If single-player AI is enabled, it will choose specialization after level up. Here you can instruct AI which specializations should be available. The same rule as with Initial Specialization property applies here, select only available specializations for a specified squad class.

    B Visualize Pawn Positions: Whenever transform widgets indicating spawn locations of every single warrior should be visible in the editor viewport or not.

    Override Retreat Location: You can use this and the next property If you want to make this squad retreat in some other direction than towards its Player Start.

    Override Retreat Location Actor: If previous property is marked as true, you should select here an actor from the level. A spawned squad will be retreating in its direction.

    Should Update Sight Radius, Random Spawn Radius, Look at Actor for Pawns: Those properties are either not supported or not reliable, please ignore them 😉

    Register to Fog Of War: Uncheck this property if you want a spawn squad to be not affected by Fog Of War mechanics. You can change that behaviour in runtime calling F Register to FoW or F Unregister from FoW functions on AncSquad.

    Spawn AI Floating Texts: Unchecking this property will cause a spawned squad to not show alarm-connected floating texts above squad banner (so it applies only for squads with single-player AI enabled with Alarming mode).

    Text Render Color: Color of debug texts specified in Text property.

    Change Formation for Attack and Idle: This mechanics is not reliable, we don’t recommend using it 🙂

Blueprint handling

There are some very handy ways for making your scripter life easier with Spawn Points. We will take a look at them now.

Event Add Squad Spawned

In order to use create Add Squad Spawned event select a Spawn Point in the level viewport and then click RMB in the Level Blueprint. Search for Add Squad Spawned event.

This event will fire when squad spawning from the specified Spawn Point is complete – which means squad is fully initialized and all of the warriors have been spawned. Using this event is a recommended way for getting a reference to a AncSquad object, which you can i.e. save in a variable and use for AI scripting (for info on basic AI scripting look HERE).

Event Add Squad Dies

To create Add Squad Dies event select a Spawn Point in the level viewport and click RMB in the Level Blueprint, search for Add Squad Dies event.

This event will fire when a last squad spawned from this Spawn Point will die. It’s an alternate way of getting an info about squad death, second being binding to squad’s Destroy event. Choose which one is more convenient for you in any given situation.

Function Manual Spawning Start

Remember that Begin Play Should Spawn property? By unchecking it you will prevent a Spawn Point from spawning a squad on a level start. If you do that you have to manually called a function on a Spawn Point to give it an order of spawning a squad.

Call Manual Spawning Start function on a Spawn Point placed in the level to spawn a squad (specified by this Spawn Point parameters). Note that after spawning will be finished Add Squad Spawned event will be fired.

SteamSolo.com