I formatted map.txt in a spreadsheet for different purposes, but will help here too. Import as space-delimited, export same. Also speeds up loading of finished map a bit, when you shave off 3-4 digits from that unnecessary accuracy
import os
import re
linematcher = re.compile("^(?P<n>111\.00)|((?P<f>.+)E\+(?P<e>.+))")
def format(string,righthand):
match = re.match(linematcher,string)
if match.group("n"):
string = "0.0001110"
else:
floatpart = float(match.group("f"))
exppart = int(match.group("e"))
if righthand:
exppart = (exppart/10)
exppart = exppart - 8
exppart = 10 ** exppart
string = str(floatpart*exppart)
return string
f = open("map.txt")
lines = f.readlines()
f.close()
formatted = []
for line in lines:
linesplit = line.split(" ")
splitlength = len(linesplit)
if splitlength == 3: # If one of the badly formatted lines.
linesplit[0] = format(linesplit[0],True)
linesplit[1] = format(linesplit[1],True)
linesplit[2] = format(linesplit[2],False) # False, no need to remove a trailing 0 from exponential part
line = (" ".join(linesplit))+"\n"
formatted.append(line)
f = open("map2.txt",'w')
fullstring = "".join(formatted)
f.write(fullstring)
f.close()
@echo off
"./obj to MB map converter.exe"
echo Fixing badly formed map file
python formatter.py
echo Replacing module map file
rm "../map.txt"
cp map2.txt ../map.txt
echo Map Compiled to "../map.txt"
echo Press any key to exit. . .
pause>nul
Clau24 said:at least the first makes you a map
my main proble is that thorgrim map editor makes the maps to small in my opinion and i wanted to try this to see if i can create a biger map
but this seems to not worck
if i put my map, made in 3ds max converted with thorgrim map editor,in game the game works with no problem
if i converted with this program....game craches
Clau24 said:this map is imported in wings 3d and reexported as obj