Jump to content

Infinitely spawning groups of planes with MOOSE


Recommended Posts

I want to achieve a fairly simple task, but something goes awry. 

 

SpawnZone = ZONE:New("Spawn Zone")
Bandits = SPAWN:New("Bandits")
               :SpawnInZone(SpawnZone, false, 2000, 4000)
               :SpawnScheduled(10, 0.1)

 

I assumed this would just spawn new groups of Bandits until the end of times every +- 10 seconds, but it seems to only spawn one group. 

 

What am I missing here?

Link to comment
Share on other sites

Posted (edited)

As was pointed out to me on the MOOSE discord, both SpawnInZone and SpawnScheduled were attempting to spawn the Bandits group and that errored out. So something like this does actually work just fine

 

SpawnZone = ZONE:New("Spawn Zone")
ZoneTable = { SpawnZone }

Bandits = SPAWN:New("Bandits")
               :InitRandomizeZones(ZoneTable)
               :SpawnScheduled(10, 0.1)

 


Edited by applepiefrost
Link to comment
Share on other sites

Posted (edited)
SpawnZone = ZONE:New("Spawn Zone")
Bandits = SPAWN:New("Bandits")
               :SpawnInZone(SpawnZone, false, 2000, 4000)
               :SpawnScheduled(10, 0.1)


--create more than one trigger zone for this to work

SpawnZones = {

ZONE:New("Spawn Zone1"), --trigger zone 1

ZONE:New("Spawn Zone2"), --trigger zone 2

}


Bandit_Group = SPAWN:New( "Bandits" )
:InitRandomizeZones( SpawnZones ) --randomizes position in trigger zones **requires more than one trigger zone to be created

:InitLimit( 1, 1 ) --(# max units at once, # max groups at once) both are needed. IE a two ship fighter group spawning maximum 1 time will need a (2, 1)

 

Bandit_Group:SpawnScheduled(10, 0.1) --performs the scheduled 10 sec+-6 sec deviation spawning


Edited by Stix_17
extra line
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...