mirror of
https://github.com/devZoGok/PlanetFleet.git
synced 2026-08-26 19:43:29 +00:00
CPU player AI that occupies spawn points
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
for i = 1, #game.players do
|
||||
game.players[i].behaviour = {
|
||||
type = BTNodeType.SEQUENCE,
|
||||
children = {
|
||||
{type = BTNodeType.FUNCTION, func = 'buildFort'},
|
||||
{type = BTNodeType.FUNCTION, func = 'trainEngineers'},
|
||||
{
|
||||
type = BTNodeType.PARALLEL,
|
||||
numMinSuccesses = 3,
|
||||
children = {
|
||||
{
|
||||
type = BTNodeType.SEQUENCE,
|
||||
children = {
|
||||
{type = BTNodeType.FUNCTION, func = 'buildLandFactory'},
|
||||
{type = BTNodeType.FUNCTION, func = 'buildHarvester'},
|
||||
}
|
||||
},
|
||||
{type = BTNodeType.FUNCTION, func = 'buildRefinery'},
|
||||
{
|
||||
type = BTNodeType.SEQUENCE,
|
||||
children = {
|
||||
{type = BTNodeType.FUNCTION, func = 'buildExtractor'},
|
||||
{type = BTNodeType.FUNCTION, func = 'startHarvesting'},
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
type = BTNodeType.PARALLEL,
|
||||
numMinSuccesses = 2,
|
||||
children = {
|
||||
{type = BTNodeType.FUNCTION, func = 'buildTaskForces'},
|
||||
{
|
||||
type = BTNodeType.PARALLEL,
|
||||
numMinSuccesses = 2,
|
||||
children = game.players[i]:generateTaskforceActions()
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
Reference in New Issue
Block a user