[PETRA] TransportPlan onBoarding causes errors for units that are already on a boat
- reported by
zyli
in the forum
- the issue starts to occur at turn 20371
Turn 20370 (200)...
Turn 20371 (200)...
ERROR: JavaScript error: simulation/ai/petra/transportPlan.js line 384
oldPos is undefined
PETRA.TransportPlan.prototype.onBoarding@simulation/ai/petra/transportPlan.js:384:9
PETRA.TransportPlan.prototype.update@simulation/ai/petra/transportPlan.js:290:8
PETRA.NavalManager.prototype.update@simulation/ai/petra/navalManager.js:832:42
PETRA.HQ.prototype.update@simulation/ai/petra/headquarters.js:2285:20
PETRA.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:118:11
m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:7
Turn 20372 (200)...
- adding a debug message:
-
a
|
b
|
PETRA.TransportPlan.prototype.onBoarding = function(gameState)
|
379 | 379 | |
380 | 380 | if (time - ent.getMetadata(PlayerID, "timeGarrison") > 2) |
381 | 381 | { |
| 382 | API3.warn("timeGarrison" + ent.getMetadata(PlayerID, "timeGarrison")) |
| 383 | API3.warn("posGarrison" + ent.getMetadata(PlayerID, "posGarrison")) |
| 384 | API3.warn("ent" + ent) |
382 | 385 | let oldPos = ent.getMetadata(PlayerID, "posGarrison"); |
383 | 386 | let newPos = ent.position(); |
384 | 387 | if (oldPos[0] == newPos[0] && oldPos[1] == newPos[1]) |
WARNING: PlayerID 2 | timeGarrison4071.2
WARNING: PlayerID 2 | posGarrisonundefined
WARNING: PlayerID 2 | ent[Entity 5531 units/pers/champion_cavalry_archer]
timeline
- ~55min entity (5531) is spawned
- ~57min it is loaded into a boat and transported to another island
- unloaded
- ~58min it is loaded into a boat and will remain in that boat till the errors get triggered, it is the only passenger
- entity id of the boat is 2667
- ~68min the errors appear
- entity 5531
units/pers/champion_cavalry_archer
has no position, because it is garrisoned within a ship
useful console commands
# get the position of the units/pers/champion_cavalry_archer
Engine.GuiInterfaceCall("GetEntityState", 5531).position
# get the position of the ship, where 5531 is garrisoned within
Engine.GuiInterfaceCall("GetEntityState", 2667).position
# jump to the action
Engine.CameraMoveTo(x,z)
to reproduce
- the issue can be noticed in the latest dev [27570] version by starting a
random/migration
map with a Large
map size in DeathMatch
mode and ~5 AI players, start some simulations and wait ~20min
- attaching 1 replay (~20min long, errors start to occur around ~19min)
note
- this bug seems to be unrelated to #6385