.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
The Star and the Crescent- Save $9.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening > Scenarios, Maps and Mods

Reply
 
Thread Tools Display Modes
  #1  
Old May 22nd, 2008, 08:30 AM
Ballbarian's Avatar

Ballbarian Ballbarian is offline
Colonel
 
Join Date: May 2005
Location: Kansas, USA
Posts: 1,538
Thanks: 289
Thanked 194 Times in 94 Posts
Ballbarian will become famous soon enough
Default Re: Map-making connundrum

Again, in a rush. Have to leave for a conference.

Added minimal comments:

Code:

REM used to fix map file after removing province pixel # 212.

REM OPEN ORIG MAP FILE FOR READING
OPEN 1, "AomOrc3.map", "r"

REM OPEN/CREATE FIXED MAP FILE
OPEN 2, "AomOrc301fixed.map", "w"

REM READ THE ORIG LINE BY LINE TO END OF FILE
while(not eof(1))
x=0
y=0
line input #1 a$
if left$(a$,8)="#terrain" then
x=val(mid$(a$,10,(instr(a$," ",10)-10)))
xx=val(right$(a$,(len(a$)-instr(a$," ",10))))
REM IF THIS LINE IS TERRAIN AND PROV# GREATER THAN REMOVED PROV# THEN REDUCE PROV# BY 1
if x>212 then
x=x-1
a$="#terrain "+str$(x)+" "+str$(xx)
endif

elseif left$(a$,10)="#neighbour" then
i=11
j=instr(a$," ",12)
x=val(mid$(a$,12,j-i-1))
xx=val(mid$(a$,j+1))
REM IF THIS LINE IS NEIGHBOUR AND PROV# GREATER THAN REMOVED PROV# THEN REDUCE PROV# BY 1 (1ST NEIGHBOUR)
if x>212 then
x=x-1
a$="#neighbour "+str$(x)+" "+str$(xx)
endif
REM IF THIS LINE IS NEIGHBOUR AND PROV# GREATER THAN REMOVED PROV# THEN REDUCE PROV# BY 1 (2ND NEIGHBOUR)
if xx>212 then
xx=xx-1
a$="#neighbour "+str$(x)+" "+str$(xx)
endif
elseif left$(a$,6)="#start" then
x=val(mid$(a$,8))
REM IF THIS LINE IS START AND PROV# GREATER THAN REMOVED PROV# THEN REDUCE PROV# BY 1
if x>212 then
x=x-1
a$="#start "+str$(x)
endif

elseif left$(a$,9)="#landname" then
x=val(mid$(a$,11,(instr(a$," ",11)-11)))
tmpstr$=mid$(a$,(instr(a$," ",11)+1))
REM IF THIS LINE IS LANDNAME AND PROV# GREATER THAN REMOVED PROV# THEN REDUCE PROV# BY 1
if x>212 then
x=x-1
a$="#landname "+str$(x)+" "+tmpstr$
endif
endif
REM PRINT THE LINE WITH ANY CHANGES TO THE FIXED MAP FILE
print #2 a$
end while
CLOSE #1
close #2


__________________
RanDom v2 - Map gen & Semirandomizer.
Province Editor - Custom province creation made easier.
God Editor - Custom pretender creation made easier.
Map Forge - Map editor
Reply With Quote
Reply

Bookmarks


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 On

Forum Jump


All times are GMT -4. The time now is 04:52 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.