[SOLVED] Problem when I switch theme

Please post here for questions and discussion about scenario, art and sound modding and the game editor for Distant Worlds.

Moderators: elliotg, Icemania

Post Reply
Geekea
Posts: 7
Joined: Sat May 26, 2012 10:59 am

[SOLVED] Problem when I switch theme

Post by Geekea »

Hi,

I'm trying to realise my first mod.
I'd like to just add some races for the moment.
But when I switch the theme, here is the error message i get :

Image

On the right you can see the content of my repertory.
Files in "races" are a simple copy paste of the "human.txt" files with just the name and the picture id modified.
Files in "raceImages" are named as "Race_0.png" ...etc... (1,2,3...)
Files in policy are copy paste of the human policy file but renamed.

What am I doing wrong ?
I tried to follow the instruction in the modding pdf.

Thanks to anyone who'll try to help me.
Geekea
Posts: 7
Joined: Sat May 26, 2012 10:59 am

RE: Problem when I switch theme

Post by Geekea »

Here is more information, if it can help :

Consultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.

************** Texte de l'exception **************
System.ArgumentNullException: La valeur ne peut pas être null.
Nom du paramètre : image
à System.Drawing.Graphics.DrawImage(Image image, Int32 x, Int32 y, Int32 width, Int32 height)
à System.Drawing.Graphics.DrawImage(Image image, Rectangle rect)
à DistantWorlds.Controls.InfoPanel.PrescaleImage(Bitmap originalBitmap, Int32 width, Int32 height)
à DistantWorlds.Controls.InfoPanel.InitializeImages(CharacterImageCache characterImageCache, Bitmap[] troopImages, Bitmap[] resourceImages, Bitmap[] raceImages, Bitmap[] builtObjectImages, Bitmap[] fighterImages, Bitmap[] ruinImages, Bitmap[] habitatImages, Bitmap[] facilityImages, Bitmap approvalSmileImage, Bitmap approvalNeutralImage, Bitmap approvalSadImage, Bitmap approvalAngryImage, Bitmap developmentImage, Bitmap colonyImage, Bitmap firepowerImage, Bitmap shipGroupLeadShipImage, Bitmap capitalColonyImage, Bitmap regionalCapitalColonyImage, Bitmap automateImage, Bitmap blockadeImage)
à DistantWorlds.Main.o100AqEsmv()
à DistantWorlds.Start.BtOAW9uqe(String , Boolean , Boolean )
à DistantWorlds.Start.P6WAtBILGC(Object , EventArgs )
à System.Windows.Forms.Control.OnClick(EventArgs e)
à System.Windows.Forms.Button.OnClick(EventArgs e)
à DistantWorlds.Controls.GlassButton.OnClick(EventArgs e)
à System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
à DistantWorlds.Controls.GlassButton.OnMouseUp(MouseEventArgs e)
à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ButtonBase.WndProc(Message& m)
à System.Windows.Forms.Button.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Assemblys chargés **************
mscorlib
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.5456 (Win7SP1GDR.050727-5400)
CodeBase : file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
DistantWorlds
Version de l'assembly : 1.7.0.13
Version Win32 : 1.7.0.13
CodeBase : file:///D:/jeux/Distant%20Worlds/DistantWorlds.exe
----------------------------------------
System
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.5456 (Win7SP1GDR.050727-5400)
CodeBase : file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
mscorlib.resources
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.5456 (Win7SP1GDR.050727-5400)
CodeBase : file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
System.Drawing
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.5458 (Win7SP1GDR.050727-5400)
CodeBase : file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Windows.Forms
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.5456 (Win7SP1GDR.050727-5400)
CodeBase : file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
DistantWorlds.Controls
Version de l'assembly : 1.7.0.13
Version Win32 : 1.7.0.13
CodeBase : file:///D:/jeux/Distant%20Worlds/DistantWorlds.exe
----------------------------------------
DistantWorlds.Types
Version de l'assembly : 1.7.0.13
Version Win32 : 1.7.0.13
CodeBase : file:///D:/jeux/Distant%20Worlds/DistantWorlds.exe
----------------------------------------
WindowsBase
Version de l'assembly : 3.0.0.0
Version Win32 : 3.0.6920.5448 built by: Win7SP1GDR
CodeBase : file:///C:/Windows/assembly/GAC_MSIL/WindowsBase/3.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
Microsoft.DirectX.DirectSound
Version de l'assembly : 1.0.2902.0
Version Win32 : 5.04.00.2904
CodeBase : file:///C:/Windows/assembly/GAC/Microsoft.DirectX.DirectSound/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.DirectSound.dll
----------------------------------------
AxInterop.WMPLib
Version de l'assembly : 1.0.0.0
Version Win32 : 1.0.0.0
CodeBase : file:///D:/jeux/Distant%20Worlds/AxInterop.WMPLib.DLL
----------------------------------------
System.Windows.Forms.resources
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.5420 (Win7SP1.050727-5400)
CodeBase : file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_fr_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------
Interop.WMPLib
Version de l'assembly : 1.0.0.0
Version Win32 : 1.0.0.0
CodeBase : file:///D:/jeux/Distant%20Worlds/Interop.WMPLib.DLL
----------------------------------------
System.Deployment
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.5420 (Win7SP1.050727-5400)
CodeBase : file:///C:/Windows/assembly/GAC_MSIL/System.Deployment/2.0.0.0__b03f5f7f11d50a3a/System.Deployment.dll
----------------------------------------
System.Deployment.resources
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase : file:///C:/Windows/assembly/GAC_MSIL/System.Deployment.resources/2.0.0.0_fr_b03f5f7f11d50a3a/System.Deployment.resources.dll
----------------------------------------
Microsoft.VisualBasic
Version de l'assembly : 8.0.0.0
Version Win32 : 8.0.50727.5420 (Win7SP1.050727-5400)
CodeBase : file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
PresentationCore
Version de l'assembly : 3.0.0.0
Version Win32 : 3.0.6920.5448 built by: Win7SP1GDR
CodeBase : file:///C:/Windows/assembly/GAC_32/PresentationCore/3.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
Microsoft.DirectX
Version de l'assembly : 1.0.2902.0
Version Win32 : 5.04.00.2904
CodeBase : file:///C:/Windows/assembly/GAC/Microsoft.DirectX/1.0.2902.0__31bf3856ad364e35/Microsoft.DirectX.dll
----------------------------------------
Accessibility
Version de l'assembly : 2.0.0.0
Version Win32 : 2.0.50727.4927 (NetFXspW7.050727-4900)
CodeBase : file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------

************** Débogage JIT **************
Pour activer le débogage juste-à-temps (JIT), le fichier de configuration pour cette
application ou cet ordinateur (machine.config) doit avoir la valeur
jitDebugging définie dans la section system.windows.forms.
L'application doit également être compilée avec le débogage
activé.

Par exemple :

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

Lorsque le débogage juste-à-temps est activé, les exceptions non gérées
seront envoyées au débogueur JIT inscrit sur l'ordinateur
plutôt que d'être gérées par cette boîte de dialogue.
User avatar
Shark7
Posts: 7936
Joined: Tue Jul 24, 2007 4:11 pm
Location: The Big Nowhere

RE: Problem when I switch theme

Post by Shark7 »

Unfortunately I can't read French(?)...that is a guess yes.

However one thing you might be missing or have an error in is the Bias.txt (I'm at work and can't remember exactly what the file is called) file. This little file is a significant source of all mod problems. this is the file that tells the game how each race feels about all the other races, IE if race a hates, loves or is indifferent to race b, etc. Without it, the game will create and exception and crash.
Distant Worlds Fan

'When in doubt...attack!'
Geekea
Posts: 7
Joined: Sat May 26, 2012 10:59 am

RE: Problem when I switch theme

Post by Geekea »

Thank you for your answer :)

...does the id of the race in the biases file have to be the same than the picture id ?
User avatar
tjhkkr
Posts: 2430
Joined: Wed Jun 02, 2010 11:15 pm
Contact:

RE: Problem when I switch theme

Post by tjhkkr »

I can read Frencyh; I cannot speak it worth a hoot...
No, I do not think this is is the bias.txt

[
Files in "races" are a simple copy paste of the "human.txt" files with just the name and the picture id modified.
Files in "raceImages" are named as "Race_0.png" ...etc... (1,2,3...)
]

based on this:
[La valeur ne peut pas être null.
Nom du paramètre : image]

I think you are on the right track... Look for an index value of the race images or
Perhaps the ship family parameter and make sure that it points to a folder that exists.
Remember that the evil which is now in the world will become yet more powerful, and that it is not evil which conquers evil, but only love -- Olga Romanov.
User avatar
Shark7
Posts: 7936
Joined: Tue Jul 24, 2007 4:11 pm
Location: The Big Nowhere

RE: Problem when I switch theme

Post by Shark7 »

ORIGINAL: Geekea

Thank you for your answer :)

...does the id of the race in the biases file have to be the same than the picture id ?

I don't think it is a requirement, but it may be best to go ahead and put them in the biases.txt file in the order that the race ID number is. If nothing else, it keeps it better organized.
Distant Worlds Fan

'When in doubt...attack!'
Geekea
Posts: 7
Joined: Sat May 26, 2012 10:59 am

RE: Problem when I switch theme

Post by Geekea »

Don't worry for the french part, what it says is not really important or easy to understand :
"La valeur ne peut pas être null" = "the value can't be null".
It seems like it's talking about an image.
All my images are 300x300, and don't seem to have any problem.

So in order to find where could be the mistake I made, I did some test...

First i downloaded a race mod here (Star Trek Picard Era - excellent one by the way).
I tried it, it works fine.

I have 16 races and STPE has 23.
I replaced the pictures of the 16 first races with my races pictures.
Tried it, and works fine.
So my pictures seem fines, they're all there.

Then I tried to remove the 7 races i didn't use from STPE. (from 16 to 22 then, and kept races 0 to 15)
I removed the pictures associated with those races, and the 7 races files of those same races from the race folder.
Adding to that, I edited the biases.txt to remove the 7 last lines and the 7 last colomns.

I start the theme.... same mistake than with my mod.

Am I missing something incredibly obvious ?
Because the 16 races I left should still have the correct index to their ship family etc...
User avatar
ehsumrell1
Posts: 2529
Joined: Tue Aug 17, 2010 7:53 am
Location: The Briar Patch Nebula
Contact:

RE: Problem when I switch theme

Post by ehsumrell1 »

Also remember that the related Race Policy files need to added/deleted
accordingly as well. [:)]
Shields are useless in "The Briar Patch"...
Geekea
Posts: 7
Joined: Sat May 26, 2012 10:59 am

RE: Problem when I switch theme

Post by Geekea »

Thank you for the advice.
I removed the concerned policy files but the problem is still there...
User avatar
tjhkkr
Posts: 2430
Joined: Wed Jun 02, 2010 11:15 pm
Contact:

RE: Problem when I switch theme

Post by tjhkkr »

Please look where it blew up:

Somewhere in the initialization, it is not finding some image file...

DistantWorlds.Controls.InfoPanel.InitializeImages(CharacterImageCache characterImageCache, Bitmap[] troopImages, Bitmap[] resourceImages, Bitmap[] raceImages, Bitmap[] builtObjectImages, Bitmap[] fighterImages, Bitmap[] ruinImages, Bitmap[] habitatImages, Bitmap[] facilityImages, Bitmap approvalSmileImage, Bitmap approvalNeutralImage, Bitmap approvalSadImage, Bitmap approvalAngryImage, Bitmap developmentImage, Bitmap colonyImage, Bitmap firepowerImage, Bitmap shipGroupLeadShipImage, Bitmap capitalColonyImage, Bitmap regionalCapitalColonyImage, Bitmap automateImage, Bitmap blockadeImage
Remember that the evil which is now in the world will become yet more powerful, and that it is not evil which conquers evil, but only love -- Olga Romanov.
Geekea
Posts: 7
Joined: Sat May 26, 2012 10:59 am

RE: Problem when I switch theme

Post by Geekea »

Thank you tjhkkr.

I finally solved the problem !
And... it seems that it had nothing to do with the images.

First, when i tried STPE, I removed some races without changing anything about the pictures, and the error message was still there.
This morning, i decided to do it again but bit by bit.
I removed 1 race instead of 7 .... and guess what ? it worked.
I kept deleting 1 race each time until the bug appears again.

So the reason of all of it : it seems that there is a minimum of 20 races to have in the mod for it to work correctly.
Is it because the game needs your race + 19 he can place in the map at the start ?

So I took my mod and added 4 random race "aaa", "bbb", "ccc", "ddd"... and it works fine now :)

Thank you for your help guys !

User avatar
Haree78
Posts: 1269
Joined: Tue May 18, 2010 7:58 am

RE: Problem when I switch theme

Post by Haree78 »

Now I can't be sure here but Distant Worlds remembers your game set up options to display as default next time you start a game. I have seen in the past that if you set up an option in set up that won't be available when you change to another theme it will crash when switching to that theme.
I wonder if in your last set up you had a setting that wasn't compatible with less than 20 races, such as saying start with 19 empires?
Just a thought.
Geekea
Posts: 7
Joined: Sat May 26, 2012 10:59 am

RE: Problem when I switch theme

Post by Geekea »

Yes Haree78, I actually did.

I think i will stick with 20 races so that if someone try my mod one day I'm sure it won't crash because of the same situation.
Post Reply

Return to “Design and Modding”