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

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 2: The Ascension Wars

Reply
 
Thread Tools Display Modes
  #1  
Old December 30th, 2004, 03:13 AM

CJN CJN is offline
Private
 
Join Date: Dec 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
CJN is on a distinguished road
Default Re: Dominions II mapfile parser

Quote:
Gandalf Parker said:

Oohhh name of the province? Much variable there. That is difficult to parse. How about if as much as possible, which can easily be parsed, be on one line. Then the difficult to parse can be seperated by "newline" as long as they always can be found on that line each time. Such as...
Line 1: Name
Line 2: id, Terrain, NOSTART, VP, etc
Line 3: Neighbors

That way even if there are no Neighbors it should still have a line which says Neighbors with no other output.


Quote:
Line 5->: commanders, features, population, buildings
OUCH that puts a wrench into the whole thing. It means that I cant just count lines and say "if line 2 has NOSTART skip next 2 lines and check again".

OK now Im thinking there are two ways to go. One is to have a unique character or Groups of characters flagging the begining of each province output. Such as -=- which can be used to count from or jump to the next province. The problem is finding something which in a script environment such as linux doesnt mean something special already. OR add a switch such as -v for more verbose output and have two outputs. One for all info, and the other for easy-parse info. Hmmm wait, the more casual user should always be considered for defaults. So maybe have the fully englished curious-user output be default with a -s short-Version for script programmers.
Version 0.6.0 is now available. Take a look at it.
I decided to move the province id first in the first line of province info to make parsing easier. Just look for lines starting with "(". some basic neighbour info is also added.
For details & download see first post.
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 01:09 PM.


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