Fandom

BattleForge Wiki

Action Script Example - Spawning a Squad

1,156pages on
this wiki
Add New Page
Talk0 Share
Description
The following script will spawn a squad immediately at map start.
Code
State
{
   StateName = "INIT",
   OnOneTimeEvent
   {
      Conditions =
      {
      },
      Actions =
      {
         PlayerSquadSpawnWithTag { 
            Tag = "creep",
            Team = "tm_Enemy1",
            Player = "pl_Enemy1",
            TargetTag = "dest",
            HealthPercent = 100,
            SquadId = 561,
            Amount = 1
         },
         PlayerSquadSpawn {
            Team = "tm_Enemy1",
            Player = "pl_Enemy1",
            TargetTag = "dest",
            HealthPercent = 100,
            SquadId = 561,
            Amount = 1
         }
      },
   };
};
Notes
  • Tag is the tag given to the squad upon spawn. Spawning multiple squads with the same tag will cause an assertion failure.
  • TargetTag is the destination at which the squad will spawn, it can be any entity.
  • Team is the team the spawned squad will belong to.
  • Player is the owner of the spawned squad.
  • HealthPercent is the percentage of max health the squad spawns with.
  • SquadId is the Database ID found in the Map Editor only without the leading 2000.
  • Amount is the number of squads you wish to spawn.
  • You may use any tag names you wish.
  • You can add any Script Event Condition in the condition section to force this script to only trigger when the condition is true.


.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.