Page 1 of 1

Unhandled exception when loading MP map

Posted: Thu Aug 22, 2013 2:39 pm
by rf900
Hi, I am working on a multiplayer mode, since one of the recent changes it gives me this error when starting the MP match. I don't have the previous version, :cry: (but with time I could try to undo all the last changes) is there any way to trace down the problem? What is it looking at when starting the game, the main bsf file? all bsf files? does it look also at UI files?

ExpCode: 0xC000005
ExpAddress: 0x00509C72

Re: Unhandled exception when loading MP map

Posted: Thu Aug 22, 2013 2:49 pm
by rf900
Seems it is a problem with one of the UI files, I will track it down.

It appears that it does not like the AddCustomOrder inside the UI_OBJ_INIT function.

Re: Unhandled exception when loading MP map

Posted: Thu Aug 22, 2013 3:19 pm
by pipfromslitherine
Hmmm - that seems odd - although it depends on where the UI object it being created (my guess would be that it might be before the battle object has had a chance to sort itself out). AddCustomOrder is really intended to reflect user input so I doubt any has happened before the UI objects have been created ;).

Crash details can be found in the error.log file generally, and posting that can give me more to work on if you have any other problems.

Have to mention that your mod looks utterly awesome btw! :)

Cheers

Pip

Re: Unhandled exception when loading MP map

Posted: Thu Aug 22, 2013 3:30 pm
by rf900
It may be an error on my part as I was initializing the same universal vars both in the UI_OBJ_INIT and in the main BSF file. That may be the cause of the sporadic crashes in the SP version.

About the MP I haven another issue, the same panel I use to select options when starting the game that does work in SP, does not responds to clicks on MP. The only change is using the AddCustomOrder to process the options. The panel is shown inside StartTurn -> if (GetTurn() == -1 )

Can be something specific to MP? Also the match appears to run fine, but each turn I get the message saying that the script may have changed for one side. All this is testing in hotseat mode.

Edit: Seems AddCustomOrder is not been executed at that point, at least the universal var is not been updated with that call inside the panel.

Re: Unhandled exception when loading MP map

Posted: Thu Aug 22, 2013 4:05 pm
by pipfromslitherine
When is the panel showing? Is it possible it's coming up too soon and getting caught in the replay phase (and blocking it moving on because it is up)? Or do you mean nothing happens when you do the clicks (e.g. the UI is responsive but the results don't happen). This could be because if you have a modal dialog then the model won't tick and no orders will be processed. So you might want to either store up the orders and do them all when OK is pressed, or mimic the UI response without needing to get the order itself (if that makes sense).

Cheers

Pip

Re: Unhandled exception when loading MP map

Posted: Fri Aug 23, 2013 11:04 am
by rf900
Thanks, mimicking the custom orders works fine, I think I am trying to understand how AddCustomOrder works.

About the message each turn saying the script has changed for the players is there anything I could check.

Re: Unhandled exception when loading MP map

Posted: Fri Aug 23, 2013 3:01 pm
by pipfromslitherine
You say you are getting the message in hotseat - and are certain there have been no changes in script/map/etc between turns? On what platform?

Cheers

Pip

Re: Unhandled exception when loading MP map

Posted: Fri Aug 23, 2013 4:06 pm
by rf900
No changes in the script, I am testing on PC.

Re: Unhandled exception when loading MP map

Posted: Mon Sep 02, 2013 6:31 am
by rf900
I am close to releasing a version to all the players, I sent one for testing to a few and they all got the not matching script message. Both in PC and iPad. This is the link to the version they were testing.

http://personales.ya.com/anyone/Files/BaseSki_MP_v1.zip

Can you help me with this or is there anything I can try or check.

Re: Unhandled exception when loading MP map

Posted: Tue Sep 03, 2013 5:57 pm
by AndrewGardner
One thing to check would be the SCRIPTID entries for your UI files. These must be unique. The values D0000000 to DFFFFFFF should be available for user campaigns (numbers are in hex without any prefix).

I think you were on the right track with universals in UI_OBJ_INIT being a problem. This function may be called before the universals are set up for the scenario so I recommend not using SetUniversalVar or GetUniversalVar in UI_OBJ_INIT.

Re: Unhandled exception when loading MP map

Posted: Thu Sep 05, 2013 6:26 am
by rf900
That was it Andrew, I think I was using IDs from some of the plugins.