Statistics: Posted by Redmoth — 14 Apr 2016, 22:03
Cortex = Class ({
__init = function(self, args)
self.strategy = args.strategy
end,
DoSomething = function(self)
end,
})
OnCreateAI = function(self, planName)
...
self.cortex = Cortex({strategy='Rush'})
...
end
Statistics: Posted by Crotalus — 14 Apr 2016, 07:48
Exampleloop = function(self)
CurPlayer = 0
NbPlayer = 4
For CurPlayer < NbPlayer do
army = GetArmyIndex(CurPlayer)
army:DoSomeFunction()
end
--OR
Players = GetAllPlayersInGame
For i, p in players do
brain = GetaiBrain(player)
brain:DoSomething()
end
end,
Statistics: Posted by Redmoth — 14 Apr 2016, 01:03
ForkThread(import('/link/to/some/module.lua').InitCleverAI, brain)
Statistics: Posted by Crotalus — 14 Apr 2016, 00:55
Statistics: Posted by Redmoth — 14 Apr 2016, 00:31
SomeUnit = Class(Unit) {
OnCreate = function(self) {
--[[local spec = {
Owner = unit
}
local entity = Entity(spec)
self:ForkThread(self.DoSomethingWithEntity)
]]--
self:ForkThread(self.DoSomethingWithUnit)
end)
}
Statistics: Posted by Redmoth — 14 Apr 2016, 00:29
SomeUnit = Class(Unit) {
OnCreate = function(self) {
local spec = {
Owner = unit
}
self.entity = Entity(spec)
self:ForkThread(self.DoSomethingWithEntity)
end),
}
Statistics: Posted by Crotalus — 14 Apr 2016, 00:26
Statistics: Posted by Redmoth — 14 Apr 2016, 00:17