Closed pandaro closed 8 years ago
and after few minute of suicide i get this error:
`[f=0037620] Error: LuaRules::RunCallIn: error = 2, GameFrame, [Internal Lua error: Call failure] [string "luarules/gadgets/ai/BAR/bomberbehaviour.lua"]:57: attempt to index a nil value
stack traceback:
`
Was there an enemy team when this happened?
in my experiment yes
i noticed that ground units sometime make the same and try to attack for example herself mex
was the enemy team another ShardLua in either or both of these cases?
is shard
You mean a non-lua Shard, or ShardLua? It makes a big difference which one.
sorry is a shardLluaAI
if can help: t1 submarine always try to attack floating radar and turrets.
https://github.com/eronoobos/BABAR-The-Shardifant/commit/0e9faa0f464a5e0ddb82b86f059109b80eb457c8
i'm not sure if this solved the issue, but using self.ai
instead of ai.
is a good precautionary measure for all modules. also updated debug drawing to the new system
don't resolve at all but is a great improvement on map like barbary coves sometime this append again edit* submarine attack units
i'm not sure if this solved the issue, but using self.ai instead of ai. is a good precautionary measure for all modules. also updated debug drawing to the new system
ok only an info about this
need to replace with self.ai only vars or all the things? (function like ai.maphandler:mobilitynetworkhere()
need to replace, can cause problem, is totally indifferent?)
It doesn't matter whether it's a variable or a function, the ai
, game
, and map
objects ideally shouldn't be used as globals. I don't really understand what's going on, but the way they are set to the correct ones before every AI callin, is a bad hack. (For the non-Lua AI this is not a problem because each AI is an entirely separate Lua environment.)
The biggest problem using the ai
objects attached to behaviours and modules is taskqueues. All of them ought to take the taskqueuebehaviour as an argument so that they can get the behaviour.ai. But I should figure out what's even happening before doing all that
watch at my last commit, say if are ok, it fix a large amount of target problem
anyway my attempt don't fix target errors, bombers bombard itself units again
https://github.com/eronoobos/BABAR-The-Shardifant/pull/37 (because it's relevant to the issue)
https://github.com/eronoobos/BABAR-The-Shardifant/commit/02731ff01d0dc2a47a0c2f4882c2a4f4c8081149 local variables in modules are a problem in the Lua AI, because the local variables are shared by all ShardSpringLua teams. Anything that isn't a constant should be within a module function, and part of the module's table.
i noticed that some bombers bombard herself factory, i see it on sailaway map .