Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
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
  #17  
Old 05-09-2006, 05:21 PM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
Quote:
Originally Posted by excaliber7388
Anything to get a gmap with the current OW
and it would take MUCh more than a few hours to convert DR by hand, it's a huge OW with a lot of links on it.
Hm, alright.

One question before I can assist with that though.

So for example, let's have a 2x2 overworld map.

"darkrival_town1-0.nw","darkrival_town1-1.nw"
"darkrival_forest1-0.nw","darkrival_forest1-1.nw"

Then it's wished to convert those levels into a GMAP.

"dr_a01.nw","dr_b01.nw"
"dr_a02.nw","dr_b02.nw"

Of course, this can be optimized to create a GMAP file and have it loaded on Dark Rival.

GRMAP001
WIDTH 2
HEIGHT 2
MAPIMG dr_bigmap.png
MINIMAPIMG dr_minimap.png
LEVELNAMES
"dr_a01.nw","dr_b01.nw"
"dr_a02.nw","dr_b02.nw"
LEVELNAMESEND

Then can be saved as dr.gmap in Notepad or some word editor.

Though, this is what is wanted, right? Oh, and note, it will change the links within the level, so don't need to stress out about that, but might have to change links to "inside" levels.

Of course, the first example I provided

"darkrival_town1-0.nw","darkrival_town1-1.nw"
"darkrival_forest1-0.nw","darkrival_forest1-1.nw"

can be converted into a GMAP.

I guess it depends on what is wished to do, from personal peference. You can attach the current map file and I'm sure I or someone else here will convert it into a GMAP file and attach it on the forums, then it can be learned how to do.
Reply With Quote
  #18  
Old 05-09-2006, 07:14 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
I've tried putting the old levels txt file in gmap format, it didn't work.
Reply With Quote
  #19  
Old 05-09-2006, 07:15 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Quote:
Originally Posted by Prozac
this is the perl code
...
Thanks, I'll use that
Reply With Quote
  #20  
Old 05-10-2006, 04:59 PM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
If the PEARL doesn't function, then I would attach the GMAP file to a post, I'm sure there was some error made, because it sure does work.
Reply With Quote
  #21  
Old 05-10-2006, 07:08 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Quote:
Originally Posted by Malinko
If the PEARL doesn't function, then I would attach the GMAP file to a post, I'm sure there was some error made, because it sure does work.
I might rewrite it to C++, but I am going to use it. It should work I'll post if it doesn't
Reply With Quote
  #22  
Old 05-10-2006, 09:48 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
With Dark Rivals old design, a program wouldn't work. I'm going to have to do it by hand. Unless V4 accepts old maps, this is going to take a while
Reply With Quote
  #23  
Old 05-14-2006, 05:46 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Okay, what I did was make a gmap with the level editor that was large enough to fit the old OW. Then I replaced the levels in the gmap file with the ones from the old gmap. I press M in editor, and it goes through it fine, however, the map image it generates is messed up, it cannot be opened, and it showes no image. I don't think I did anything wrong. The map is 25x37 levels, could it's size be a problem?
Reply With Quote
  #24  
Old 05-16-2006, 10:01 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Our gmap produces images the one below, and never makes a map image. What's wrong (support center is down, btw).
It's 25 by 37 levels.
Attached Thumbnails
Click image for larger version

Name:	badmap.gif
Views:	88
Size:	113.2 KB
ID:	36431  
Reply With Quote
  #25  
Old 05-17-2006, 04:57 PM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
As I said before, post the old map, which can be converted into a GMAP.

We can't solve a problem unless we see what is going on. I'm guessing breaks are in the wrong place, because it shouldn't do that.

To answer the problem about the map image, v4 does not support that right now. Stefan said it could be added soon. Of course, walking around the GMAP, and press M in game will load the parts of the map that were visited.
Reply With Quote
  #26  
Old 05-17-2006, 05:18 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
I'd post the gmap I'm trying to use, but it's too long. x_X
Reply With Quote
  #27  
Old 05-18-2006, 01:07 AM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
Quote:
Originally Posted by excaliber7388
I'd post the gmap I'm trying to use, but it's too long. x_X
Upload it somewhere, or the GraalBible for now, then we can delete it afterwards.

I'm sure the moderators will not mind uploading it to an external host, because it is for GraalOnline development.
Reply With Quote
  #28  
Old 05-18-2006, 03:18 AM
VulcanP2P VulcanP2P is offline
Registered User
VulcanP2P's Avatar
Join Date: May 2005
Location: Florida
Posts: 882
VulcanP2P is on a distinguished road
...it's too big to attach as a txt file?
__________________

For Zone or Guild Support use the Support Center
Reply With Quote
  #29  
Old 05-18-2006, 03:28 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Quote:
Originally Posted by VulcanP2P
...it's too big to attach as a txt file?
omg, I feel like an idiot right now, I'll upload it when I get home to my comp.
Reply With Quote
  #30  
Old 05-19-2006, 05:10 PM
Malinko Malinko is offline
Unholy Nation
Join Date: Mar 2004
Location: Massachusetts, U.S.A.
Posts: 1,782
Malinko is on a distinguished road
Send a message via AIM to Malinko
Quote:
Originally Posted by excaliber7388
omg, I feel like an idiot right now, I'll upload it when I get home to my comp.
*Blinks*

What did you think I meant?
Reply With Quote
Reply


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 12:06 PM.


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