[Outdated] Obj file to strategic map converter

Users who are viewing this thread

I uploaded the file to M&B repository, here is the link: http://www.mbrepository.com/file.php?id=1788
 
No problem!  That of course means I get to test drive 'Ogniem i Mieczem',  the mod, right?!

Pozdrawiam :smile:
 
Tul - Thanks for the great work. Is there any chance you could update this so that it works with the new "desert forest" (or whatever it is) terrain type? Also a reference wings3d file would be really awesome because I'm getting errors about the positioning of the party initially.
 
Hmm, I'm still getting an error:

"Unable to position party Main Party at (17.00,52.50)"

Have you tested this in warband? Or perhaps I have my .obj export settings done wrong. Any chance you could tell me what you use. (sorry to keep bugging you)
 
Yoshiboy said:
Hmm, I'm still getting an error:

"Unable to position party Main Party at (17.00,52.50)"

Have you tested this in warband? Or perhaps I have my .obj export settings done wrong. Any chance you could tell me what you use. (sorry to keep bugging you)

Everything is written in first post:
The package includes a referential Wings file and obj file. They are fit to warband so there shouldn't be any positioning problems in warband.

For Wings 3d users: remember to import and export the file with swapped x and y axes.  Scale factor should be set to 1.0.

Check axes swapping and scale factor.
 
Tul said:
Yoshiboy said:
Hmm, I'm still getting an error:

"Unable to position party Main Party at (17.00,52.50)"

Have you tested this in warband? Or perhaps I have my .obj export settings done wrong. Any chance you could tell me what you use. (sorry to keep bugging you)

Everything is written in first post:
The package includes a referential Wings file and obj file. They are fit to warband so there shouldn't be any positioning problems in warband.

For Wings 3d users: remember to import and export the file with swapped x and y axes.  Scale factor should be set to 1.0.

Check axes swapping and scale factor.

Ah sorry, missed that. Unfortunately I'm still getting the same error, even without editing the wings file at all and making sure all my export settings are right.
 
Try to put this file to your Warband  Native folder: http://www.sendspace.com/file/0su31f
It is produced by my converter from bare reference included in the package. It works fine for me. If you still get the error then try to start a new game, maybe your party is just in a strange point.
 
Hmm, that seems to work fine. What version of wings are you using to export? Perhaps that is causing trouble since they changed how "holes" are handled.

EDIT: when I run the converter on the reference map.obj (the bare reference in the pack) it still gives me the same error. Odd, perhaps it is something to do with my system. Very weird.
 
Can you tell me what size your output map.txt file have? It should have exactly 6107 B.
It may be a problem with NET. framework or something so stupid that we are unable to find it. By the way, I have the newest Wings: 1.3.0.1
 
Mine is 7,041 bytes - I think I know the problem too.

If you look at my map.txt in a text editor all the first sets of numbers are formatted as exponentials:

Code:
93
-4.014206E+100 -4.014206E+100 4.931329E+08
4.014206E+100 -4.014206E+100 4.931329E+08
-4.014206E+100 4.014206E+100 4.931329E+08
4.014206E+100 4.014206E+100 4.931329E+08
-4.014206E+100 -2.676137E+100 4.931329E+08
-4.014206E+100 -1.338069E+100 4.931329E+08
-4.014206E+100 111.00 4.931329E+08
-4.014206E+100 1.338069E+100 4.931329E+08
-4.014206E+100 2.676137E+100 4.931329E+08
4.014206E+100 -2.676137E+100 4.931329E+08
4.014206E+100 -1.338069E+100 4.931329E+08
4.014206E+100 111.00 4.931329E+08
4.014206E+100 1.338069E+100 4.931329E+08
4.014206E+100 2.676137E+100 4.931329E+08
-2.676137E+100 -4.014206E+100 4.931329E+08
-1.338069E+100 -4.014206E+100 4.931329E+08
...
...

Where as yours are formatted as floats

Code:
93
-401.42060 -401.42060 4.931329
401.42060 -401.42060 4.931329
-401.42060 401.42060 4.931329
401.42060 401.42060 4.931329
-401.42060 -267.61370 4.931329
-401.42060 -133.80690 4.931329
-401.42060 0.0001110 4.931329
-401.42060 133.80690 4.931329
-401.42060 267.61370 4.931329
401.42060 -267.61370 4.931329
401.42060 -133.80690 4.931329
401.42060 0.0001110 4.931329
401.42060 133.80690 4.931329
401.42060 267.61370 4.931329
-267.61370 -401.42060 4.931329
...
...


My wings map.obj looks like this:

Code:
# Exported from Wings 3D 1.3.0.1
mtllib map.mtl
o cube2
#93 vertices, 80 faces
v -401.42060330 -401.42060330 4.93132933
v 401.42060330 -401.42060330 4.93132933
v -401.42060330 401.42060330 4.93132933
v 401.42060330 401.42060330 4.93132933
v -401.42060330 -267.61373554 4.93132933
v -401.42060330 -133.80686777 4.93132933
v -401.42060330 -2.9946282e-14 4.93132933
v -401.42060330 133.80686777 4.93132933
v -401.42060330 267.61373554 4.93132933
v 401.42060330 -267.61373554 4.93132933
...
...

So it has a mix (not sure exactly how this sort of thing works.)

Hopefully that helps.
 
Extremely strange. Converter shouldn't save any exponential at all and yours numbers are huge. What version of NET. framework do you have? I'm running 3.5 on Windows 7.
 
I'll try downloading that and see if it works. I think I was running 2 on vista but I'm not sure. Worst comes to worst I might be able to write a regular expression or some other script which formats the file correctly.
 
Tried updating to 3.5 but no change. Script might be harder than I first though. It isn't enough to just get rid of the exponentials. The numbers are messed up in order of magnitude in more ways than that.
 
Multiply every value in first and second column by 100. If it is 111.00 then set 0.0001110 (this value is hardcoded and represent a 0 or a very small (originally exponential) number, the game crashes if you give it a pure 0)
 
I had a look but I think it's far more complicated than it looks. if you can see what it's doing then I can probably find an easy way to fix it but I simply can't. Some examples:

-4.014206E+100 -4.014206E+100 4.931329E+08

Straight forward enough, should be:

-401.42060 -401.42060 4.931329

Now this one:

-1.338069E+100 -1.338069E+100 2.498858E+09

Should be

-133.80690 -133.80690 24.98858

This one:

111.00 -7.613611E+090 2.498858E+09

Should be

0.0001110 -76.136110 24.98858

This one:

2.421128E+090 2.421128E+090 2.498858E+09

Should be:

24.211280 24.211280 24.98858

Now it's pretty clear from those examples how to get from one to the other but that's only a conditional basis from the exponential part. I'm scared anything like that will be impossible to scale over more complicated maps. Can anyone spot what is going on?

EDIT: So am I just being stupid. I'll try this: the first and second column remove a 0 from the end, then: multiply the number by 10^(exppart-:cool: [so 08 is multiply by 1, 09 is ten and 10 is one hundred]

EDIT2: Well that seems to work for this wings file. We'll see if it works for anything else.
 
Back
Top Bottom