Random message display (bug)

Users who are viewing this thread

Twan

Sergeant Knight
Testing the last version of my mod (I was not doing anything, just pressing space and watching units behavior with the control T cheat) I encountered the following bug : suddenly messages started to be displayed or appear in the log without any logic (messages from the SoD upgrade system like "Upgrade All." or "You don't have heavy gear to upgrade these units" ; and also the message saying I had lost relation with factions - the one used when you are vassal and your kingdom declare war- ; but my relations stayed at 0).

It was especially strange as I never entered any dialog in this game nor any situation where these messages could have a reason to be loaded. There were some script errors in the RGL log about invalid parties/factions ID (I guess due to me forgeting to check if a party is active somewhere), but I would be surprised if it's the thing triggering this message bug (btw in earlier versions I had far more errors like that without the random messages). I rather suspect that something in my code bugs the compiler and make it create corrupted txt files (but there is no error message when I compile).

Do someone already had this bug and know how to fix it ?

ps : some particularities of my mod I suspect
- my scripts file is extremely long (more than 30k lines)
- I store data in high faction slots numbers (up to slot no. 1000+)
- one of my scripts is near the limit of local variables use (I had to cut a very big script in several parts the first time I compiled auxiliarii v2 because it was using too many local variables)
 
Twan - I've got some folks in 4.1 complaining of a similar problem.  Where the text they see is just bizarre!  Go to a city, and get messages about cows (as though the system was using the village menu instead of the town menu), and similar messages displayed on screen.

I've never known where this stuff comes from, or why it happens to some people and not others.

The only thing I ever did that came close to creating this was when I changed the troop.py file in the middle of a game (and I added some extra troops onto the end, with extra upgrade() tuples.  And in my case, it went back to normal when I rolled back those changes (at least as far as removing the new units - changes to the existing units seemed to be ignored, and to cause no harm).

So ???   Makes you wonder how stable their engine really is... :neutral:

One thing I've noticed about the MS is that its incredibly easy to misalign arguments both to primitives (operators) and to script calls.  Its also ridiculously easy to hand the wrong data through (a troop ID where a party ID is required, or vice verse, or a party template ID for a faction ID, etc.).

I had one bug which drove me nuts, and in the process of trying to figure it out, I found dozens of the above type of error... and each time they weren't the culprit.  Eventually I found my bug, but its amazing how many other bugs were easily baked in without my knowing.

Maybe one of us should write some extensions to the MS compiler to actually verify argument count, and read-only vs. writable arguments?  type-checking is probably too ambitious, but some simple "this operator requires two arguments, you supplied three" could be hugely useful.
 
This bug is really strange, I've made several changes hoping to fix it like using several units to store council datas to avoid to use very high faction slots numbers, changing the strings numbers I was using, splitting in several parts my longest scripts. But I continued to have the messages after that.

Then I let it be and continued to develop another part of the mod and some compilations later the random messages stopped to appear in my tests.

I can't say why/how the bug has been fixed (and if it is really).
 
I really am leaning towards the belief that the M&B runtime engine sometimes gets corrupted internally.  If you happen to save while its corrupt, your save becomes garbage (it may load, even likely to load, but thereafter you get stupid behavior like you describe).

And I think its probably non-trivial what causes the engine to corrupt.  Probably a combination of circumstances, so hard to stumble upon, or even know you've triggered it until after the fact.  And by then... well, good chance you've saved it into your game file & now must start a new game to get rid of the issue.

It may well be caused by script errors - but I think its not just "a script error" - but a combination of them that happen to cause the engine to get corrupted.

It explains everything I've seen or heard so far, anyways. :razz:
 
Back
Top Bottom