CPU player AI that occupies spawn points

This commit is contained in:
devZoGok
2025-03-12 20:13:26 +02:00
parent 572ec2e12b
commit c18666fde2
5 changed files with 190 additions and 135 deletions
+42
View File
@@ -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