Ship Size Mod for 1.2.7.9

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

Moderator: MOD_DW2

StoddardOXC
Posts: 5
Joined: Sun Nov 24, 2024 10:31 pm

Re: Ship Size Mod for 1.2.7.9

Post by StoddardOXC »

rxnnxs wrote: Tue Dec 10, 2024 12:43 pm I installed python now through the microsoft store and used pip3 to uninstall and istall lxml and icon
now the message is coming again:
ImportError: cannot import name 'icon_png' from 'icon'
Oh, I forgot completely. Sorry, I took too much for granted.

icon_png is in https://github.com/StoddardOXC/dw2tools ... in/icon.py which is supposed to be in same dir as sizemodgen.py

One really has to use git and clone the github repo then just pull updates when tracking this sort of fast iterative development.
User avatar
rxnnxs
Posts: 611
Joined: Sat Jun 01, 2013 10:25 am
Location: what goes on
Contact:

Re: Ship Size Mod for 1.2.7.9

Post by rxnnxs »

No, I have icon.py in the folder where I start sizemodgen.py
Still it asks for it..
And when I place this icon.py inside the "python-3.13.1-embed-amd64\Lib\site-packages\icon"
then the next problem WAS the "tree" in lxml.
Now I am stuck again with the icon problem.

wellwell.. with another pc it worked out!

It must be a wrong installation where the paths are not set correct

But now:

Using the original data folder gives me this:
PS X:\SteamLibrary\steamapps\common\Distant Worlds 2\mods\mysizemod> python .\sizemodgen.py ..\..\data .\mysizemod
Traceback (most recent call last):
File "X:\SteamLibrary\steamapps\common\Distant Worlds 2\mods\mysizemod\sizemodgen.py", line 293, in <module>
c = etree.parse(open(fn, "r"))
File "src\\lxml\\etree.pyx", line 3589, in lxml.etree.parse
File "src\\lxml\\parser.pxi", line 1979, in lxml.etree._parseDocument
File "src\\lxml\\parser.pxi", line 1999, in lxml.etree._parseFilelikeDocument
File "src\\lxml\\parser.pxi", line 1893, in lxml.etree._parseDocFromFilelike
File "src\\lxml\\parser.pxi", line 1224, in lxml.etree._BaseParser._parseDocFromFilelike
File "src\\lxml\\parser.pxi", line 633, in lxml.etree._ParserContext._handleParseResultDoc
File "src\\lxml\\parser.pxi", line 739, in lxml.etree._handleParseResult
File "src\\lxml\\etree.pyx", line 351, in lxml.etree._ExceptionContext._raise_if_stored
File "src\\lxml\\parser.pxi", line 384, in lxml.etree._FileReaderContext.copyToBuffer
File "C:\Users\fred88\AppData\Local\Programs\Python\Python313\Lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 6481: character maps to <undefined>
I had to create a folder where I copied all relevant xml files as an original to get needed results:
python .\sizemodgen.py .\origData .\.
mysizemod.7z
resulting mod
(744.21 KiB) Downloaded 3 times
For me on the actuak dw2 game it crashes. Its maybe the factor 12.

I will do another try with 1/6th.
Tomorrow I am going to make a video to show how I did it.
I extract all sizes and then look for the smallest size. Then i divide through the smallest size and round them so that they are integers.
mysizemodOneSixth.7z
1/6
(579.08 KiB) Downloaded 4 times
The 1/6th is not crashing but the models look like they are untouched..

Here is my 1/6th mod
my mod
my mod
rx.jpg (62.39 KiB) Viewed 216 times
Here is you 1/6th mod
yours.jpg
yours.jpg (110.37 KiB) Viewed 216 times
User avatar
rxnnxs
Posts: 611
Joined: Sat Jun 01, 2013 10:25 am
Location: what goes on
Contact:

Re: Ship Size Mod for 1.2.7.9

Post by rxnnxs »

I am sure it is my fault.

I am going to write a new program that is doing it in a way that I can understand whats going on.
Meanwhile playing the game should be not forgotten :-)

But so many things are nagging me, I have to have a game running 100%. Before that, I can not play :-/
User avatar
rxnnxs
Posts: 611
Joined: Sat Jun 01, 2013 10:25 am
Location: what goes on
Contact:

Re: Ship Size Mod for 1.2.7.9

Post by rxnnxs »

Ahh.. now I compared the files..
The Problem lies only in the orbit.xml

And I think there is an ID limit. you can not go over a id of.. lets SAY 59 or so..
Yours go over 100, thats definitely too much.

Now Your mod can get startet when I delete the orbtype.xml
ChrisGb
Posts: 64
Joined: Thu Mar 21, 2024 8:10 pm
Location: Spain

Re: Ship Size Mod for 1.2.7.9

Post by ChrisGb »

rxnnxs wrote: Sat Dec 28, 2024 1:29 pm And I think there is an ID limit. you can not go over a id of.. lets SAY 59 or so..
Yours go over 100, thats definitely too much.
Orb Type ID is an UnsignedByte, the value range is 0 to 255 (256 values), a Byte value goes from -128 to 127
so 100 should not be a problem really...just sayin ;)
Conquest: Frontier Wars 2.0 (Human Faction DLC) May 2025
https://www.matrixgames.com/forums/view ... 9&t=403676
Image
User avatar
rxnnxs
Posts: 611
Joined: Sat Jun 01, 2013 10:25 am
Location: what goes on
Contact:

Re: Ship Size Mod for 1.2.7.9

Post by rxnnxs »

It has nothing to do with the unsigned byte..
ChrisGb
Posts: 64
Joined: Thu Mar 21, 2024 8:10 pm
Location: Spain

Re: Ship Size Mod for 1.2.7.9

Post by ChrisGb »

rxnnxs wrote: Mon Apr 21, 2025 10:18 am It has nothing to do with the unsigned byte..
Just run a quick test and with ID 128 it indeed crashed with OutOfArray error. :?
Did you test how high it would allow ?
Conquest: Frontier Wars 2.0 (Human Faction DLC) May 2025
https://www.matrixgames.com/forums/view ... 9&t=403676
Image
User avatar
rxnnxs
Posts: 611
Joined: Sat Jun 01, 2013 10:25 am
Location: what goes on
Contact:

Re: Ship Size Mod for 1.2.7.9

Post by rxnnxs »

rxnnxs wrote: Sat Dec 28, 2024 1:29 pm Ahh.. now I compared the files..
The Problem lies only in the orbit.xml

And I think there is an ID limit. you can not go over a id of.. lets SAY 59 or so..
Yours go over 100, thats definitely too much.

Now Your mod can get startet when I delete the orbtype.xml
Post Reply

Return to “Design and Modding”