Jump to content

delenda_est error.


gameboy
 Share

Recommended Posts

@wowgetoffyourcellphone

Today, I tested the latest SVN19942 and the latest delenda_est, and when I started a new game, these errors occurred:

ERROR: Error calling component script function GetFullRepresentation
ERROR: JavaScript error: simulation/ai/common-api/shared.js line 146 TypeError: state is undefined m.SharedScript.prototype.init@simulation/ai/common-api/shared.js:146:19 InitGame@simulation/helpers/InitGame.js:78:2
WARNING: JavaScript warning: simulation/ai/common-api/baseAI.js line 40 reference to undefined property sharedAI.gameState
ERROR: JavaScript error: simulation/ai/common-api/baseAI.js line 40 TypeError: sharedAI.gameState is undefined m.BaseAI.prototype.Init@simulation/ai/common-api/baseAI.js:40:2 InitGame@simulation/helpers/InitGame.js:78:2
ERROR: JavaScript error: simulation/components/Player.js line 178 ReferenceError: ApplyValueModificationsToPlayer is not defined Player.prototype.GetMaxPopulation@simulation/components/Player.js:178:2 Player.prototype.GetPopulationLimit@simulation/components/Player.js:168:18 GuiInterface.prototype.GetSimulationState@simulation/components/GuiInterface.js:100:16 AIInterface.prototype.GetNonEntityRepresentation@simulation/components/AIInterface.js:95:14 AIInterface.prototype.GetFullRepresentation@simulation/components/AIInterface.js:138:14 InitGame@simulation/helpers/InitGame.js:78:2
ERROR: JavaScript error: simulation/components/Player.js line 178 ReferenceError: ApplyValueModificationsToPlayer is not defined Player.prototype.GetMaxPopulation@simulation/components/Player.js:178:2 Player.prototype.GetPopulationLimit@simulation/components/Player.js:168:18 GuiInterface.prototype.GetSimulationState@simulation/components/GuiInterface.js:100:16 GuiInterface.prototype.ScriptCall@simulation/components/GuiInterface.js:2044:10 GetSimState@gui/session/session.js:197:16 updatePlayerData@gui/session/session.js:355:17 init@gui/session/session.js:290:2 reallyStartGame@gui/loading/loading.js:102:2
ERROR: Error calling component script function ScriptCall
WARNING: JavaScript warning: gui/session/session.js line 471 reference to undefined property g_Players[g_ViewedPlayer]
ERROR: JavaScript error: gui/session/session.js line 471 TypeError: g_Players[g_ViewedPlayer] is undefined initializeMusic@gui/session/session.js:471:1 init@gui/session/session.js:297:2 reallyStartGame@gui/loading/loading.js:102:2
ERROR: GUI page 'page_session.xml': Failed to call init() function
ERROR: JavaScript error: simulation/components/Player.js line 178 ReferenceError: ApplyValueModificationsToPlayer is not defined Player.prototype.GetMaxPopulation@simulation/components/Player.js:178:2 Player.prototype.GetPopulationLimit@simulation/components/Player.js:168:18 GuiInterface.prototype.GetSimulationState@simulation/components/GuiInterface.js:100:16 GuiInterface.prototype.ScriptCall@simulation/components/GuiInterface.js:2044:10 GetSimState@gui/session/session.js:197:16 appendSessionCounters@gui/session/session.js:1406:17 updateCounters@gui/common/functions_global_object.js:77:3 __eventhandler286 (tick)@dataCounter tick:0:1

 

Edited by gameboy
  • Like 1
Link to comment
Share on other sites

The ApplyValueModificationsToPlayer function was removed in r19924 and delenda est has a copy of Player.js.

The only change in the copy is the maxpop = 500. @wowgetoffyourcellphone this max pop change doesn't work, does it? It's the gamesetup determining that right? IIRC it's different for skirmish/scenario and random maps.

Modified copies from the public mod always run into that issue. A modified copy of population_capacities.json might do the trick already, dunno.

Link to comment
Share on other sites

4 hours ago, elexis said:

The ApplyValueModificationsToPlayer function was removed in r19924 and delenda est has a copy of Player.js.

The only change in the copy is the maxpop = 500. @wowgetoffyourcellphone this max pop change doesn't work, does it? It's the gamesetup determining that right? IIRC it's different for skirmish/scenario and random maps.

Modified copies from the public mod always run into that issue. A modified copy of population_capacities.json might do the trick already, dunno.

I have some thoughts about mods, especially in these cases. If we want to change small function we need to copy the whole file. Could we make a logic, when mods has a javascript file (i.e. Player.js), which has only one function, overloaded from the original one, and we replace it with new version of the function? Or at least make it for components, to prevent such issues.

Just an idea.

Edited by vladislavbelov
  • Like 2
Link to comment
Share on other sites

Most GUI magic numbers and strings are non-const globals and can be changed from an external file directly.

In the simulation it's more tricky, but it should be possible to change prototype variables with a trigger script or custom mod system component directly for example. There might be more systematic and/or nicer approaches.

  • Like 2
Link to comment
Share on other sites

14 hours ago, vladislavbelov said:

I have some thoughts about mods, especially in these cases. If we want to change small function we need to copy the whole file. Could we make a logic, when mods has a javascript file (i.e. Player.js), which has only one function, overloaded from the original one, and we replace it with new version of the function? Or at least make it for components, to prevent such issues.

Just an idea.

I was under the impression from a comment made some time ago, like a year ago or more, that this was already possible. Your comment just now jogged this from my memory.

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...