Jump to content
Sign in to follow this  
1para{god-father}

Help needed with Power-shell Script

Recommended Posts

OK this one is above my head I have made a lot of Towns using the 3D editor & (Terrain Editing Suite) and then I am using ZeroG Powershell script to export to .csv but the format is now incorrect to import back into TB

Would there be any chance ZeroG or anyone can let me know how to add in the correct parameters so i can fix the Powershell script so it will export this out so i can then import it into my TB ?

i belive it now need to export :- Template name;X;Y;Yaw;Pitch;Roll;Scale;Rel Height;

$d = gc mission.biedi 																								
$rows=@()   
for ($i=0; $i -le $d.count -2; ++$i) {                                          
   if( $d[$i] -match "POSITION" ) { 
       $pos = $d[$i].Replace('POSITION="[', '').Replace(',',';').Replace(']";','').Replace(' ', '').trim()
       if (($pos -split ';').count -eq 2) {$pos += ";0"}
       $typ = $d[$i+1].Replace('TYPE=', '').Replace(';', '').Replace(' ', '').trim().toLower() 
       $ori = $d[$i+2].Replace('AZIMUT="', '').Replace('"', '').Replace('PARENT=;', '0;').Replace(' ', '').trim() 
       $rows += $("{0};{1};{2}" -f $typ,$pos,$ori)            
   } 
}

$rows

sc -path 3DEditorExport.csv -value $rows																			
(gc 3DEditorExport.csv | select -Skip 1) | sc 3DEditorExport.csv

Edited by 1PARA{God-Father}

Share this post


Link to post
Share on other sites

God Father, I'm able to just use this handy tool from NeoArmageddon to convert from ZGM converter's output to CSV. However I cannot find that small tool right now. Hope anyone else can chime in on where to find it?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×