Jump to content

Javascript error PetraBot TypeError


DangerousI
 Share

Recommended Posts

Within your ai (petra) javascript code you have on line 140 a typeError, saying

Quote

ERROR: JavaScript error: simulation/ai/petra/_petrabot.js line 140
TypeError: savedEvents[key][ i] is undefined

I'm using the latest 0 A.D. version (Ken Wood, bless him) for Linux [Mint]..

See attachment for more info.

For some reason the key and i variable combination results in a non-existing object from this 2d array.

Kind regards,

Melroy van den Berg

 

Schermafdruk van 2018-08-10 22-18-36.png

Edited by DangerousI
Link to comment
Share on other sites

No mods (only 0ad itself as 'mod').
Yes, sorry I forgot to say indeed when this happens.

This error actually happens during multiplayer LAN game, directly after the moment ceasefire count-down reached zero (the moment the AI is allowed to attack me/us).

So its NOT during a save game.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

@Angen When I load the game into the game screen, the error message appears, using this patch.

WARNING: JavaScript warning: simulation/ai/petra/diplomacyManager.js line 181 reference to undefined property events.CeasefireEnded

ERROR: JavaScript error: simulation/ai/petra/diplomacyManager.js line 181 TypeError: events.CeasefireEnded is undefined PETRA.DiplomacyManager.prototype.checkEvents@simulation/ai/petra/diplomacyManager.js:181:1 PETRA.DiplomacyManager.prototype.update@simulation/ai/petra/diplomacyManager.js:524:2 PETRA.HQ.prototype.update@simulation/ai/petra/headquarters.js:2774:2 PETRA.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:118:3 m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:2

ERROR: JavaScript error: simulation/ai/petra/diplomacyManager.js line 181 TypeError: events.CeasefireEnded is undefined PETRA.DiplomacyManager.prototype.checkEvents@simulation/ai/petra/diplomacyManager.js:181:1 PETRA.DiplomacyManager.prototype.update@simulation/ai/petra/diplomacyManager.js:524:2 PETRA.HQ.prototype.update@simulation/ai/petra/headquarters.js:2774:2 PETRA.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:118:3 m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:2

ERROR: JavaScript error: simulation/ai/petra/diplomacyManager.js line 181 TypeError: events.CeasefireEnded is undefined PETRA.DiplomacyManager.prototype.checkEvents@simulation/ai/petra/diplomacyManager.js:181:1 PETRA.DiplomacyManager.prototype.update@simulation/ai/petra/diplomacyManager.js:524:2 PETRA.HQ.prototype.update@simulation/ai/petra/headquarters.js:2774:2 PETRA.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:118:3 m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:2

ERROR: JavaScript error: simulation/ai/petra/diplomacyManager.js line 181 TypeError: events.CeasefireEnded is undefined PETRA.DiplomacyManager.prototype.checkEvents@simulation/ai/petra/diplomacyManager.js:181:1 PETRA.DiplomacyManager.prototype.update@simulation/ai/petra/diplomacyManager.js:524:2 PETRA.HQ.prototype.update@simulation/ai/petra/headquarters.js:2774:2 PETRA.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:118:3 m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:2

ERROR: JavaScript error: simulation/ai/petra/diplomacyManager.js line 181 TypeError: events.CeasefireEnded is undefined PETRA.DiplomacyManager.prototype.checkEvents@simulation/ai/petra/diplomacyManager.js:181:1 PETRA.DiplomacyManager.prototype.update@simulation/ai/petra/diplomacyManager.js:524:2 PETRA.HQ.prototype.update@simulation/ai/petra/headquarters.js:2774:2 PETRA.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:118:3 m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:2

  • Thanks 1
Link to comment
Share on other sites

@Angen My friend, I tested your new patch and still found that the error occurred:

WARNING: JavaScript warning: simulation/ai/petra/diplomacyManager.js line 181 reference to undefined property events.CeasefireEnded

ERROR: JavaScript error: simulation/ai/petra/diplomacyManager.js line 181 TypeError: events.CeasefireEnded is undefined PETRA.DiplomacyManager.prototype.checkEvents@simulation/ai/petra/diplomacyManager.js:181:1 PETRA.DiplomacyManager.prototype.update@simulation/ai/petra/diplomacyManager.js:524:2 PETRA.HQ.prototype.update@simulation/ai/petra/headquarters.js:2774:2 PETRA.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:118:3 m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:2

ERROR: JavaScript error: simulation/ai/petra/diplomacyManager.js line 181 TypeError: events.CeasefireEnded is undefined PETRA.DiplomacyManager.prototype.checkEvents@simulation/ai/petra/diplomacyManager.js:181:1 PETRA.DiplomacyManager.prototype.update@simulation/ai/petra/diplomacyManager.js:524:2 PETRA.HQ.prototype.update@simulation/ai/petra/headquarters.js:2774:2 PETRA.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:118:3 m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:2

ERROR: JavaScript error: simulation/ai/petra/diplomacyManager.js line 181 TypeError: events.CeasefireEnded is undefined PETRA.DiplomacyManager.prototype.checkEvents@simulation/ai/petra/diplomacyManager.js:181:1 PETRA.DiplomacyManager.prototype.update@simulation/ai/petra/diplomacyManager.js:524:2 PETRA.HQ.prototype.update@simulation/ai/petra/headquarters.js:2774:2 PETRA.PetraBot.prototype.OnUpdate@simulation/ai/petra/_petrabot.js:118:3 m.BaseAI.prototype.HandleMessage@simulation/ai/common-api/baseAI.js:64:2

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...