don't finish mission after load game #4428
Comments
Cyp changed blocking which not transferred by tractive |
Cyp changed blockedby which not transferred by tractive |
Cyp commented If loading the campaign savegame and destroying the remaining scavenger bunker and tower, I get this log, not sure if it's relevant.
|
Cyp uploaded file |
Cyp edited the issue description |
rockking commented I am also facing the same problem, Campaing is not finish even I fulfilled all objective ...Version is 3.1.5. |
rockking uploaded file Saved Games - not finishing |
abid_naqvi83 uploaded file Patch file for data/base/script/campaign/libcampaign.js (fixes bug) |
abid_naqvi83 changed _comment0 which not transferred by tractive |
abid_naqvi83 commented I faced the same problem in the 3.2 release. I debugged data/base/script/campaign/libcampaign.js and discovered that the cause was the victory condition not being met, in particular the function 'camAllEnemyBasesEliminated'. In mission Alpha-1 the problem was that _camNumEnemyBases was for some reason exceeding the number of entries in the dictionary _camEnemyBases. I fixed that by replacing the equality check with >= (patch attached: libcampaign.patch). In mission Alpha-2 the problem was that _camEnemyBases contained a fourth base with group -1 and cleanup starting with an underscore. This mission was never detected and therefore never eliminated even after every part of the map had been uncovered. I fixed that by adding a private variable and function for ignoring this fourth strange entry. (patch attached). The patch fixes this problem completely but may have introduced a subtle but not critical error in Alpha-5. In my opinion the patch likely deals with the symptoms of a deeper bug in the code which I am not qualified to root out. The 'Uncaught Exception' in the logs related to "eventDestroyed" is likely an unrelated problem which I resolved by simply not calling the function when 'eventname' was equal "eventDestroyed" (also in the patch attached). |
NoQ commented Thanks for the patch!!! Will have a look as soon as possible, hope it doesn't break things on other converted levels :) |
NoQ commented Hmm. No, i think that's not it: there should not ever exist a group with id '-1'. I'd probably suspect a problem in the save-load code (rather than in scripts), which would lead to such groups appearing. Need to have a look at eventDestroyed. If we disable this pre-hook, then we'd never be able to place artifacts below destroyed buildings; so it must be working from time to time. The thing is, the original event exists, but it doesn't have the 'apply' method, so it's essentially not a function. Will have a closer look on that one, might be a bug in my fancy hook system. |
abid_naqvi83 commented The bug in eventDestroyed popped up in another event (eventDroidBuilt). As you said the problem was that the object doesn't have an 'apply' method. Since on line 2228 in libcampaign.js we are already testing if '_camOriginalEvents[eventname]' exists I removed the test for eventDestroyed and replaced it with an additional test to check if the '.apply()' method for the object also exists. The if statement on 2228 now reads (in my patch): if (camDef(_camOriginalEvents[eventname]) && camDef(_camOriginalEvents[eventname].apply)) With this change I don't see this error any more (although I haven't played for very long afterwards). This treats the symptom. Note: I have replaced two underscores with a single one in all code in this post otherwise it starts underlining text and I don't know how to escape it on this forum. Sorry. |
Cyp changed status from |
Cyp changed resolution from `` to |
Cyp commented See #4587. |
resolution_fixed
type_bug
| by andrvautdont finish mission after save and load 2 mission camp.
broken save:
https://drive.google.com/open?id=0B4UhCQW7aFOLcWNIaWVFUS1VVHM (now attached to bug ticket)
Issue migrated from trac:4428 at 2022-04-16 11:59:38 -0700
The text was updated successfully, but these errors were encountered: