das Thema ist zwar schon etwas älter, aber wie es ausschaut wurde hier nich wirklich zu ende geredet.
Ich möchte ein Programm schreiben das mir eine Datei umwandelt. Ich habe mir den Code der Quell und der Zieldatei gut angeschaut und herausgefunden das nur die struktur etwas anders ist.
Ich hab noch nicht mit wirklich mit Python gearbeitet, habe nur ein Tutorial durchgearbeitet von dieser page: http://www.freenetpages.co.uk/hp/alan.g ... /index.htm
Mein Ziel ist es, dass das Programm folgenden Text in den darauf folgenden umwandelt.
QuellCode:
Code: Alles auswählen
solid
{
"id" "2"
side
{
"id" "1"
"plane" "(-1792 -640 160) (-1792 -640 128) (-1792 -128 128)"
"material" "WALL/STONEWALL02C"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 128] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "2"
"plane" "(-1776 -128 160) (-1776 -128 128) (-1776 -640 128)"
"material" "WALL/STONEWALL02C"
"uaxis" "[0 1 0 0] 0.25"
"vaxis" "[0 0 -1 128] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "3"
"plane" "(-1776 -640 160) (-1776 -640 128) (-1792 -640 128)"
"material" "WALL/STONEWALL02C"
"uaxis" "[-1 0 0 0] 0.25"
"vaxis" "[0 0 -1 128] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "4"
"plane" "(-1792 -128 160) (-1792 -128 128) (-1776 -128 128)"
"material" "WALL/STONEWALL02C"
"uaxis" "[-1 0 0 -448] 0.25"
"vaxis" "[0 0 -1 128] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "5"
"plane" "(-1792 -128 128) (-1792 -640 128) (-1776 -640 128)"
"material" "TOOLS/TOOLSNODRAW"
"uaxis" "[1 0 0 0] 0.5"
"vaxis" "[0 -1 0 0] 0.5"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
side
{
"id" "6"
"plane" "(-1792 -640 160) (-1792 -128 160) (-1776 -128 160)"
"material" "WALL/SITEBWALL05"
"uaxis" "[1 0 0 -305] 0.25"
"vaxis" "[0 -1 0 -128] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
}
}
Code: Alles auswählen
// brush 2
{
( -1792 -640 160 ) ( -1792 -640 128 ) ( -1792 -128 128 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -1776 -128 160 ) ( -1776 -128 128 ) ( -1776 -640 128 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -1776 -640 160 ) ( -1776 -640 128 ) ( -1792 -640 128 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -1792 -128 160 ) ( -1792 -128 128 ) ( -1776 -128 128 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -1792 -128 128 ) ( -1792 -640 128 ) ( -1776 -640 128 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
( -1792 -640 160 ) ( -1792 -128 160 ) ( -1776 -128 160 ) caulk 64 64 0 0 0 0 lightmap_gray 16384 16384 0 0 0 0
}
Frage ist wie schreib ich mein Programm so das es das tut? schreibt mir bitte nicht nur modul-namen rein, ich kenn mich damit noch net so ganz aus. Es sind noch mehr sachen drinn die ersetzt werden müssen aber wenn mir hierzu jemand helfen kann, werd ich vllt auch mit dem andern kram klarkommen, ansonsten müsst ich halt nochmal fragen. ^^
Danke im Voraus
Gruß Cassiopeia