Hunting the "Fall of France" crash, I need your help.

Status
Not open for further replies.
Relation setting and war/peace change, there are a lot of loop in there:

Code:
	Dprint("Updating relations ...", bDebug)	

	pVichy:ChangeMinorCivFriendshipWithMajor( iGermany, 50 )
	pVichy:ChangeMinorCivFriendshipWithMajor( iItaly, 50 )
				
	pAlgeria:ChangeMinorCivFriendshipWithMajor( iFrance, - pAlgeria:GetMinorCivFriendshipWithMajor(iFrance) )
	pAlgeria:ChangeMinorCivFriendshipWithMajor( iEngland, - pAlgeria:GetMinorCivFriendshipWithMajor(iEngland) )
	pMorocco:ChangeMinorCivFriendshipWithMajor( iFrance, - pMorocco:GetMinorCivFriendshipWithMajor(iFrance) )
	pMorocco:ChangeMinorCivFriendshipWithMajor( iEngland, - pMorocco:GetMinorCivFriendshipWithMajor(iEngland) )
	pSyria:ChangeMinorCivFriendshipWithMajor( iFrance, - pSyria:GetMinorCivFriendshipWithMajor(iFrance) )
	pSyria:ChangeMinorCivFriendshipWithMajor( iEngland, - pSyria:GetMinorCivFriendshipWithMajor(iEngland) )
	pTunisia:ChangeMinorCivFriendshipWithMajor( iFrance, - pTunisia:GetMinorCivFriendshipWithMajor(iFrance) )
	pTunisia:ChangeMinorCivFriendshipWithMajor( iEngland, - pTunisia:GetMinorCivFriendshipWithMajor(iEngland) )
	pLebanon:ChangeMinorCivFriendshipWithMajor( iFrance, - pLebanon:GetMinorCivFriendshipWithMajor(iFrance) )
	pLebanon:ChangeMinorCivFriendshipWithMajor( iEngland, - pLebanon:GetMinorCivFriendshipWithMajor(iEngland) )
				
	--Pause(1)
	coroutine.yield()
				
	Dprint("Updating war/peace ...", bDebug)	

	--DeclarePermanentWar(iFrance, iAlgeria) -- wait for Operation Torch
	teamGermany:MakePeace( pAlgeria:GetTeam() )
	coroutine.yield()
	teamItaly:MakePeace( pAlgeria:GetTeam() )
	coroutine.yield()
	pAlgeria:ChangeMinorCivFriendshipWithMajor( iGermany, 50 - pAlgeria:GetMinorCivFriendshipWithMajor(iGermany) )
	pAlgeria:ChangeMinorCivFriendshipWithMajor( iItaly, 50 - pAlgeria:GetMinorCivFriendshipWithMajor(iItaly) )
				
	--DeclarePermanentWar(iFrance, iMorocco) -- wait for Operation Torch
	teamGermany:MakePeace( pMorocco:GetTeam() )
	coroutine.yield()
	teamItaly:MakePeace( pMorocco:GetTeam() )
	coroutine.yield()
	pMorocco:ChangeMinorCivFriendshipWithMajor( iGermany, 50 - pMorocco:GetMinorCivFriendshipWithMajor(iGermany) )
	pMorocco:ChangeMinorCivFriendshipWithMajor( iItaly, 50 - pMorocco:GetMinorCivFriendshipWithMajor(iItaly) )
				
	DeclarePermanentWar(iFrance, iSyria)
	coroutine.yield()
	teamGermany:MakePeace( pSyria:GetTeam() )
	coroutine.yield()
	teamItaly:MakePeace( pSyria:GetTeam() )
	coroutine.yield()
	pSyria:ChangeMinorCivFriendshipWithMajor( iGermany, 50 - pSyria:GetMinorCivFriendshipWithMajor(iGermany) )
	pSyria:ChangeMinorCivFriendshipWithMajor( iItaly, 50 - pSyria:GetMinorCivFriendshipWithMajor(iItaly) )
				
	--DeclarePermanentWar(iFrance, iTunisia) -- wait for Operation Torch
	teamGermany:MakePeace( pTunisia:GetTeam() )
	coroutine.yield()
	teamItaly:MakePeace( pTunisia:GetTeam() )
	coroutine.yield()
	pTunisia:ChangeMinorCivFriendshipWithMajor( iGermany, 50 - pTunisia:GetMinorCivFriendshipWithMajor(iGermany) )
	pTunisia:ChangeMinorCivFriendshipWithMajor( iItaly, 50 - pTunisia:GetMinorCivFriendshipWithMajor(iItaly) )	

	--DeclarePermanentWar(iFrance, iLebanon) -- wait for Operation Torch
	teamGermany:MakePeace( pLebanon:GetTeam() )
	coroutine.yield()
	teamItaly:MakePeace( pLebanon:GetTeam() )
	coroutine.yield()
	pLebanon:ChangeMinorCivFriendshipWithMajor( iGermany, 50 - pLebanon:GetMinorCivFriendshipWithMajor(iGermany) )
	pLebanon:ChangeMinorCivFriendshipWithMajor( iItaly, 50 - pLebanon:GetMinorCivFriendshipWithMajor(iItaly) )

remove the whole block or put "--[[" before and "--]]" after (without the quotes)
 
Ok, I'm working on that now, but this is the last test I can do today, I will have to go soon
 
Thank you already :)
 
Firstly Gedemon thanks for the reply to my question.

Secondly, I have amazing news:

Upon removing all three sections (as requested above) the script works perfectly without any crash.
:goodjob::goodjob::goodjob:

I've included the Lua log in case it's of any use, but I can't give you the turn after save because civfanatics won't allow the file size.

Hopefully now you can work out exactly what is happening and we can end this bug once and for all
 

Attachments

Thank you, but there is still some work left !

Can you take a screenshot of France after the event ?

(zoom out at max, try to have as many cities as possible, with at least Paris and some of Vichy's)

And then can you try to put back the units ?

(you or anyone following the thread of course and wanting the crash fixed ;))

TIA

(edit: and I need confirmation from other players having the crash that removing those parts of the code fix the crash, after all it wasn't happening on all computers, it may fix it for some players only)
 
I now have another problem - taking screenshots with steam crashes the game - it freezes and then goes blank with a "microsoft visual runtime" error message.

EDIT: Don't worry, I've fixed that, ill have screenshots soon
 
Ok, so by 'put back the units' I assume you mean add some French and British units back onto France. If so that seems to work fine as the territory is liberated. Having De Gaulle take back Paris liberates it, however the rest of the cities stay vichy/german.

The one issue i can see with the current map is the three tiles of French territory between Dijon and Mulhouse that stay in the hands of the Free French.
 

Attachments

  • 2015-05-24_00002.jpg
    2015-05-24_00002.jpg
    371.1 KB · Views: 111
  • 2015-05-24_00003.jpg
    2015-05-24_00003.jpg
    388.7 KB · Views: 166
ho, sorry, I mean put back the code related to units:
http://forums.civfanatics.com/showpost.php?p=13832777&postcount=22

and see if it crashes again, my suspect is now city flipping combined with the final code, but I need to clean the honor of the units' code before going further...

And thanks for the screens, I'll have a look at those remaining tiles and I'll found a way for the occupied status of the Vichy cities and the resistance in the Germany occupied cities (I don't want that gameplay side)
 
and updated OP for those that want to join the hunt now :)
 
The unit code works too, the UK seems to lose some units and a Matilda returns to London, the French have some units moved to Palmyra although nothing stays in France (I assume this is intended)

The Vichy gain French Navy.
 

Attachments

  • 2015-05-24_00006.jpg
    2015-05-24_00006.jpg
    337.3 KB · Views: 142
  • 2015-05-24_00004.jpg
    2015-05-24_00004.jpg
    339.3 KB · Views: 74
Allright, so as jaffaaddict said, no crash occured for me, either. Peace and war was succesfully made with france's colonies, as well. Italy annexed Nice and renamed it, also. After this, I opened IGE and put down some French infantry around Paris. The land was liberated. After this, I made France retake Paris and all worked well. I attached my log and 2 screenshots.
 

Attachments

  • Lua.zip
    Lua.zip
    16.7 KB · Views: 78
  • 2015-05-24_00003.jpg
    2015-05-24_00003.jpg
    321.3 KB · Views: 77
  • 2015-05-24_00002.jpg
    2015-05-24_00002.jpg
    290.8 KB · Views: 127
Oh yeah, and this isn't related to the crash at all, but Vichy's borders are a little strange. After fixing the crash, you may want to edit some tiles to make it look more like vvv
 

Attachments

  • Vichy-France.jpg
    Vichy-France.jpg
    35 KB · Views: 59
Thank you :D

I'm making some change in the function, them I'll post a v.40 beta for all to test.
 
should not, I'll try the old save before releasing and tell if it does.
 
Status
Not open for further replies.
Back
Top Bottom