Graal Forums  

Go Back   Graal Forums > Development Forums > Level Design
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #17  
Old 05-09-2006, 05:17 AM
Prozac Prozac is offline
one of the good guys
Prozac's Avatar
Join Date: Jan 2006
Posts: 245
Prozac is on a distinguished road
Send a message via AIM to Prozac
this is the perl code
the level list names are at the top

i didn't write it for public use, but you should be able to get the algorithm from it

PHP Code:
#!/usr/bin/perl 
print "Content-type: text/html\n\n";

#gmap level tile swapping

$newmap="sanstrata_a01.nw,sanstrata_b01.nw,sanstrata_c01.nw,sanstrata_d01.nw,sanstrata_e01.nw,sanstrata_f01.nw,sanstrata_g01.nw,sanstrata_h01.nw,sanstrata_i01.nw,sanstrata_j01.nw,sanstrata_k01.nw,sanstrata_l01.nw,sanstrata_a02.nw,sanstrata_b02.nw,sanstrata_c02.nw,sanstrata_d02.nw,sanstrata_e02.nw,sanstrata_f02.nw,sanstrata_g02.nw,sanstrata_h02.nw,sanstrata_i02.nw,sanstrata_j02.nw,sanstrata_k02.nw,sanstrata_l02.nw,sanstrata_a03.nw,sanstrata_b03.nw,sanstrata_c03.nw,sanstrata_d03.nw,sanstrata_e03.nw,sanstrata_f03.nw,sanstrata_g03.nw,sanstrata_h03.nw,sanstrata_i03.nw,sanstrata_j03.nw,sanstrata_k03.nw,sanstrata_l03.nw,sanstrata_a04.nw,sanstrata_b04.nw,sanstrata_c04.nw,sanstrata_d04.nw,sanstrata_e04.nw,sanstrata_f04.nw,sanstrata_g04.nw,sanstrata_h04.nw,sanstrata_i04.nw,sanstrata_j04.nw,sanstrata_k04.nw,sanstrata_l04.nw,sanstrata_a05.nw,sanstrata_b05.nw,sanstrata_c05.nw,sanstrata_d05.nw,sanstrata_e05.nw,sanstrata_f05.nw,sanstrata_g05.nw,sanstrata_h05.nw,sanstrata_i05.nw,sanstrata_j05.nw,sanstrata_k05.nw,sanstrata_l05.nw,sanstrata_a06.nw,sanstrata_b06.nw,sanstrata_c06.nw,sanstrata_d06.nw,sanstrata_e06.nw,sanstrata_f06.nw,sanstrata_g06.nw,sanstrata_h06.nw,sanstrata_i06.nw,sanstrata_j06.nw,sanstrata_k06.nw,sanstrata_l06.nw,sanstrata_a07.nw,sanstrata_b07.nw,sanstrata_c07.nw,sanstrata_d07.nw,sanstrata_e07.nw,sanstrata_f07.nw,sanstrata_g07.nw,sanstrata_h07.nw,sanstrata_i07.nw,sanstrata_j07.nw,sanstrata_k07.nw,sanstrata_l07.nw,sanstrata_a08.nw,sanstrata_b08.nw,sanstrata_c08.nw,sanstrata_d08.nw,sanstrata_e08.nw,sanstrata_f08.nw,sanstrata_g08.nw,sanstrata_h08.nw,sanstrata_i08.nw,sanstrata_j08.nw,sanstrata_k08.nw,sanstrata_l08.nw,sanstrata_a09.nw,sanstrata_b09.nw,sanstrata_c09.nw,sanstrata_d09.nw,sanstrata_e09.nw,sanstrata_f09.nw,sanstrata_g09.nw,sanstrata_h09.nw,sanstrata_i09.nw,sanstrata_j09.nw,sanstrata_k09.nw,sanstrata_l09.nw,sanstrata_a10.nw,sanstrata_b10.nw,sanstrata_c10.nw,sanstrata_d10.nw,sanstrata_e10.nw,sanstrata_f10.nw,sanstrata_g10.nw,sanstrata_h10.nw,sanstrata_i10.nw,sanstrata_j10.nw,sanstrata_k10.nw,sanstrata_l10.nw,sanstrata_a11.nw,sanstrata_b11.nw,sanstrata_c11.nw,sanstrata_d11.nw,sanstrata_e11.nw,sanstrata_f11.nw,sanstrata_g11.nw,sanstrata_h11.nw,sanstrata_i11.nw,sanstrata_j11.nw,sanstrata_k11.nw,sanstrata_l11.nw,sanstrata_a12.nw,sanstrata_b12.nw,sanstrata_c12.nw,sanstrata_d12.nw,sanstrata_e12.nw,sanstrata_f12.nw,sanstrata_g12.nw,sanstrata_h12.nw,sanstrata_i12.nw,sanstrata_j12.nw,sanstrata_k12.nw,sanstrata_l12.nw,sanstrata_a13.nw,sanstrata_b13.nw,sanstrata_c13.nw,sanstrata_d13.nw,sanstrata_e13.nw,sanstrata_f13.nw,sanstrata_g13.nw,sanstrata_h13.nw,sanstrata_i13.nw,sanstrata_j13.nw,sanstrata_k13.nw,sanstrata_l13.nw,sanstrata_a14.nw,sanstrata_b14.nw,sanstrata_c14.nw,sanstrata_d14.nw,sanstrata_e14.nw,sanstrata_f14.nw,sanstrata_g14.nw,sanstrata_h14.nw,sanstrata_i14.nw,sanstrata_j14.nw,sanstrata_k14.nw,sanstrata_l14.nw";

$oldmap="s34.nw,s33.nw,s32.nw,s8.nw,sirus38.nw,sirus25.nw,sirus26.nw,sirus27.nw,sirus42.nw,sirus50.nw,sirus52.nw,sirus53.nw,s35.nw,s43.nw,s39.nw,s7.nw,sirus37.nw,sirus23.nw,sirus21.nw,sirus24.nw,sirus41.nw,sirus49.nw,sirus51.nw,sirus54.nw,s36.nw,s37.nw,s38.nw,s6.nw,sirus36.nw,sirus28.nw,sirus22.nw,sirus29.nw,sirus40.nw,castle3.nw,castle2.nw,stown5.nw,s40.nw,s41.nw,s4.nw,s5.nw,sirus35.nw,sirus33.nw,sirus20.nw,sirus34.nw,sirus39.nw,castle4.nw,stown3.nw,stown4.nw,s42.nw,s9.nw,s3.nw,zypher4.nw,zypher6.nw,zypher9.nw,sgrassland9.nw,smountain4.nw,smountain5.nw,smountain6.nw,stown1.nw,stown2.nw,prozac5.nw,prozac3.nw,s2.nw,zypher3.nw,zypher5.nw,zypher8.nw,sgrassland8.nw,smountain3.nw,smountain10.nw,smountain12.nw,smountain15.nw,smountain19.nw,prozac4.nw,prozac1.nw,prozac2.nw,zypher1.nw,zypher2.nw,zypher7.nw,sgrassland7.nw,smountain2.nw,smountain9.nw,smountain11.nw,smountain13.nw,smountain17.nw,slake3.nw,slake1.nw,sgrassland2.nw,sgrassland1.nw,sgrassland3.nw,sgrassland5.nw,sgrassland6.nw,smountain1.nw,smountain7.nw,smountain8.nw,smountain14.nw,smountain16.nw,s31.nw,slake2.nw,sirus44.nw,sforest1.nw,sforest3.nw,sforest4.nw,sforest5.nw,sgrassland10.nw,sgrassland12.nw,sgrassland13.nw,sgrassland14.nw,sgrassland15.nw,s30.nw,slake4.nw,sirus45.nw,sforest2.nw,sforest6.nw,sforest8.nw,sforest9.nw,sgrassland11.nw,sdesert1.nw,sdesert11.nw,sdesert24.nw,sdesert25.nw,s29.nw,sirus46.nw,sirus47.nw,sforest12.nw,sforest13.nw,sforest14.nw,sirus48.nw,sdesert4.nw,sdesert3.nw,sdesert9.nw,sdesert22.nw,sdesert26.nw,s28.nw,s1.nw,s14.nw,s13.nw,s21.nw,s22.nw,s23.nw,sdesert12.nw,sdesert6.nw,sdesert10.nw,sdesert21.nw,sdesert23.nw,s27.nw,s10.nw,s12.nw,s15.nw,s16.nw,s17.nw,s19.nw,sdesert13.nw,sdesert7.nw,sdesert17.nw,sdesert18.nw,sdesert19.nw,s00.nw,s11.nw,s25.nw,s24.nw,s26.nw,s18.nw,s20.nw,river1.nw,river2.nw,river3.nw,river4.nw,river5.nw";

@new=
split(/\,/,$newmap);
@
old=split(/\,/,$oldmap);


print 
"Howdy $new[5] <p> \n ";

######## old file

for ($i=0$i<$#old+1; $i++)
{

$count=0;
$from_old="GLEVNW01\n";

open (FILE"../graal-old/$old[$i]");
 
until (eof(FILE))
  {
   
$line=<FILE>;
   
chomp($line);
  
# @link=split(/þ/,$line);
  
$newline="";
  if (
$line=~"BOARD 0") {$from_old=$from_old.$line."\n";}
  
#{$newline=$newline.$line."\n";}
  
$count++;
  }
close(FILE);

#   print "line $ya found in file $i $old[$i] <br> \n";

# put board stuff in new levels

# open (>FILE2,"../graal-old/$old[$i]")

open (FILE2,">../graal-fixed/$new[$i]");
print 
FILE2 "$from_old";
close(FILE2);

}

#########################

######## new file
print "\n <hr> \n ";

for (
$i=0$i<$#old+1; $i++)
{

$count=0;
$from_new="";

open (FILE"../graal-new/$new[$i]");
 
until (eof(FILE))
  {
   
$line=<FILE>;
   
chomp($line);
  
# @link=split(/þ/,$line);
  
$newline="";
  if (
$line=~"LINK ")  {$from_new=$from_new.$line."\n";}
  
#{$newline=$newline.$line."\n";}
  
$count++;
  }
close(FILE);

   print 
"line $ya found in file $i $new[$i] <br> \n";


#################
# put link stuff in new levels

open (FILE2,">>../graal-fixed/$new[$i]");
print 
FILE2 "$from_new";
close(FILE2);

}

#####################

exit; 
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 06:02 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.