gameboy Posted May 11, 2018 Report Share Posted May 11, 2018 (edited) @stanislas69 Today, I tested the latest https://github.com/0ADMods/terra_magna and warnings in combat: WARNING: JavaScript warning: simulation/components/Player.js line 380 reference to undefined property this.resourceCount[type] WARNING: JavaScript warning: simulation/components/StatisticsTracker.js line 428 reference to undefined property this.resourcesUsed[type] WARNING: JavaScript warning: simulation/ai/petra/diplomacyManager.js line 83 reference to undefined property availableResources[res] Edited May 11, 2018 by gameboy Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted May 11, 2018 Report Share Posted May 11, 2018 This 0 A.D art not terra magna forum, isn't the first time.... 1 Quote Link to comment Share on other sites More sharing options...
elexis Posted May 11, 2018 Report Share Posted May 11, 2018 Moved the topic, hopefully to the right subforum. I don't see any template in TM that uses a custom resource. @gameboy can you upload the replay? Perhaps a second mod was enabled? I would have guessed gamesetup keeping some information somewhere (e.g. custom StartingResources), but we changed it to not load data of different mods. 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted May 11, 2018 Author Report Share Posted May 11, 2018 WARNING: JavaScript warning: simulation/ai/petra/diplomacyManager.js line 83 reference to undefined property availableResources[res] Quote Link to comment Share on other sites More sharing options...
elexis Posted May 11, 2018 Report Share Posted May 11, 2018 Replay pls Quote Link to comment Share on other sites More sharing options...
elexis Posted May 11, 2018 Report Share Posted May 11, 2018 There are a number of hardcoded resources in simulation/ai/, but the Terra Magna ones are the same as in 0ad Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 11, 2018 Report Share Posted May 11, 2018 Sounds like the Hans of delenda est 1 Quote Link to comment Share on other sites More sharing options...
niektb Posted May 11, 2018 Report Share Posted May 11, 2018 @gameboy: do you play other mods together with Terra Magna (at the same time)? Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted May 11, 2018 Report Share Posted May 11, 2018 @wowgetoffyourcellphone Quote Link to comment Share on other sites More sharing options...
gameboy Posted May 12, 2018 Author Report Share Posted May 12, 2018 @Alexandermb 1 Quote Link to comment Share on other sites More sharing options...
Alexandermb Posted May 12, 2018 Report Share Posted May 12, 2018 17 minutes ago, gameboy said: @Alexandermb My hands are limited with this one, i only know basic templates and some components if i read carefully. Petra behavior is not in my field yet. 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 12, 2018 Report Share Posted May 12, 2018 On 5/11/2018 at 12:14 PM, gameboy said: WARNING: JavaScript warning: simulation/components/Player.js line 380 reference to undefined property this.resourceCount[type] WARNING: JavaScript warning: simulation/components/StatisticsTracker.js line 428 reference to undefined property this.resourcesUsed[type] WARNING: JavaScript warning: simulation/ai/petra/diplomacyManager.js line 83 reference to undefined property availableResources[res] This is likely cause by the Xiongnu not having a civ center at some point. Quote Link to comment Share on other sites More sharing options...
elexis Posted May 12, 2018 Report Share Posted May 12, 2018 Step 1: Replay or explain how to reproduce Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 12, 2018 Report Share Posted May 12, 2018 @elexis Couldn't find a way to reproduce it. The only similar warnings I managed to get was by playing in atlas switching the civ in atlas and then playing again. But I guess that's an edge case. I tried to play Xiongnu against IA (Chinese)and nothing happened maybe trying the converse. Quote Link to comment Share on other sites More sharing options...
elexis Posted May 13, 2018 Report Share Posted May 13, 2018 @gameboy commands.txt please! Quote Link to comment Share on other sites More sharing options...
gameboy Posted May 13, 2018 Author Report Share Posted May 13, 2018 @elexis my friend, please help me! Today, I tested the latest https://github.com/0ADMods/terra_magna, The same warning appears again: WARNING: JavaScript warning: simulation/components/Player.js line 380 reference to undefined property this.resourceCount[type] WARNING: JavaScript warning: simulation/components/StatisticsTracker.js line 428 reference to undefined property this.resourcesUsed[type] WARNING: JavaScript warning: simulation/ai/petra/diplomacyManager.js line 83 reference to undefined property availableResources[res] commands.txt Quote Link to comment Share on other sites More sharing options...
elexis Posted May 13, 2018 Report Share Posted May 13, 2018 WARNING: The mod 'public' with version '0.0.27' is required by the replay file, but version '0.0.23' is present! o_O 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted May 13, 2018 Author Report Share Posted May 13, 2018 (edited) @elexis The true talent is right. Please help me! 1commands.txt Edited May 13, 2018 by gameboy Quote Link to comment Share on other sites More sharing options...
elexis Posted May 13, 2018 Report Share Posted May 13, 2018 While waiting for a clean git compile to build, I reproduced the originally posted error with the latest replay. Don't have to be a well versed developer to just get more information from the error: Index: binaries/data/mods/public/simulation/components/Player.js =================================================================== --- binaries/data/mods/public/simulation/components/Player.js (revision 21819) +++ binaries/data/mods/public/simulation/components/Player.js (working copy) @@ -377,7 +377,15 @@ } for (var type in amounts) + { + if (!this.resourceCount[type]) + { + warn("broken: " + uneval(type)) + warn(new Error().stack); + } + this.resourceCount[type] -= amounts[type]; + } return true; }; This yields Turn 3324 (200)... WARNING: broken: "glory" WARNING: Player.prototype.SubtractResourcesOrNotify@simulation/components/Player.js:384:9 Player.prototype.TrySubtractResources@simulation/components/Player.js:395:7 ProductionQueue.prototype.AddBatch@simulation/components/ProductionQueue.js:352:9 g_Commands.research@simulation/helpers/Commands.js:370:4 ProcessCommand@simulation/helpers/Commands.js:47:3 From the first line we see something contains a "glory" resource (which doesn't exist in both mods). From the last two lines we see it occurs when processing a research command on turn 3324. In the replay there is only one research command on that turn. But commands are processed two turns later as I recall, so its likely the first one: cmd 1 {"type":"research","entity":4847,"template":"attack_soldiers_will"} end turn 3323 200 end turn 3324 200 cmd 1 {"type":"research","entity":4847,"template":"chinese/art_of_war"} Searching for glory in terra_magna/simulation yields an occurrence in about every chinese tech. So this means either glory is a new addition or it got removed unintendedly recently. Doing a git log yields: commit 022f463eb34ff6e5cac36cee39df96223c095edd Author: Niek ten Brinke <niektb95@gmail.com> Date: Sat Aug 12 12:16:09 2017 +0200 Implement some of Delenda Est's changes to the Chinese @niektb you either want to remove the glory costs or add the glory resource </case> 2 Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 13, 2018 Report Share Posted May 13, 2018 Thanks for investigating elexis. 2 Quote Link to comment Share on other sites More sharing options...
niektb Posted May 13, 2018 Report Share Posted May 13, 2018 Seems like I was a little careless when copying the tech files over I never intended to add the glory resource (weird though that this pops up a whopping 9 months after commit) 2 Quote Link to comment Share on other sites More sharing options...
Stan` Posted May 13, 2018 Report Share Posted May 13, 2018 Well not really surprising considering there hasn't been a release till then, and we did not have any either for at least a year 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted May 13, 2018 Report Share Posted May 13, 2018 LOL Quote Link to comment Share on other sites More sharing options...
gameboy Posted May 13, 2018 Author Report Share Posted May 13, 2018 Good. It's time to solve the problem. Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted May 13, 2018 Report Share Posted May 13, 2018 (edited) Too much mixing like alcohol+drugs+redbull (energy drink you know). Gameboy the health of your 0 A.D is in trouble. Edited May 13, 2018 by Lion.Kanzen Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.