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

This Month's Specials

BCT Commander- Save $6.00
World Supremacy- Save $10.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: Starfury

Reply
 
Thread Tools Display Modes
  #1  
Old June 17th, 2004, 02:15 PM

Exan Exan is offline
Corporal
 
Join Date: May 2003
Location: South Karelia, Finland
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Exan is on a distinguished road
Default Re: Modding Tools

That could be useful since I finally got Visual Studio 6. I planned on doing a map editor of some sort. I have previously done a simple rally manager game with my friend with VB but now I have forgotten almost everything I knew.

Still if you could give the code of the field structure thing that would help a lot. I mean why invent the wheel for a second time?
__________________
Starfury Haven
thepeoplesmod.com (Offical site for The People's Mod)
Alexandria Archives -info site on The People's Mod
Reply With Quote
  #2  
Old June 17th, 2004, 04:28 PM

DeadZone DeadZone is offline
Second Lieutenant
 
Join Date: Apr 2003
Location: England
Posts: 488
Thanks: 0
Thanked 0 Times in 0 Posts
DeadZone is on a distinguished road
Default Re: Modding Tools

If you invent the wheel for a 2nd time, you might make it more round than the first

Seriously though, yeah, if you could also send it too me I would be happy
I know SJ has the VB5 classes hosted on his webspace

[ June 17, 2004, 15:29: Message edited by: DeadZone ]
__________________
Reply With Quote
  #3  
Old June 17th, 2004, 06:24 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: Modding Tools

Well, my code's in C#, and while I could convert it to VB.NET, that wouldn't do much good as you're using VB6 which is radically different...

But basically, I have a structure called Field, which contains 2 strings, Name and Data.

Then to read the next field from a data file, I use this function:

code:
/// <summary>
/// Reads a data field from an SE4 text file and verifies its name if the
/// name parameter is not null.
/// </summary>
protected Field ReadFieldText(string name)
{
string line;
Field field;

// Read lines until a non-blank line is found
// Note that this is "nicer" than SE4's parser, in that
// extra newlines between lines are simply ignored, and the
// later entries are still read
// Find the first delimiter
int delimiterPosition;
do
{
// Read the next line from the data file
line = textReader.ReadLine();
delimiterPosition = line.IndexOf(delimiter);
} while (delimiterPosition < 0); // read until good line found

// Create the field
field = new Field(line.Substring(0, delimiterPosition).Trim(),
line.Substring(delimiterPosition + delimiter.Length).Trim());

// Verify if necessary
if (name != null && field.Name != name)
throw new ParserException("The field name \"" + field.Name + "\" was found where \"" + name + "\" was expected.", line);

return field;
}

The ParserException is just an exception class I created so I can tell a parser exception from any other type of exception.

This particular implementation will verify that the name of the field is some specific value, so you can make sure the fields are in the right order. Or, if you pass a null reference (does VB6 have those?), it won't verify and just return the next field no matter what.

Would you find everything I've worked on handy, even though it's in C#? I can post it on my website if you want...
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #4  
Old June 17th, 2004, 06:53 PM

Exan Exan is offline
Corporal
 
Join Date: May 2003
Location: South Karelia, Finland
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Exan is on a distinguished road
Default Re: Modding Tools

Well I've done dozens of programs that reads a list of some sort. I'm more interested in how do you make the program realize the empty spaces between the text and the := mark.
For example:
Obj name := qwerty

Like that. Can you just make the program read it line by line and checking if the line matches the required text. Like in Obj name. Then jump over the spaces and take the obj name and save it to objname table for example.
__________________
Starfury Haven
thepeoplesmod.com (Offical site for The People's Mod)
Alexandria Archives -info site on The People's Mod
Reply With Quote
  #5  
Old June 17th, 2004, 08:42 PM
MooseUpNorth's Avatar

MooseUpNorth MooseUpNorth is offline
Private
 
Join Date: Apr 2004
Location: The Maritimes
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
MooseUpNorth is on a distinguished road
Default Re: Modding Tools

To answer the inherent questions:

1) It'll be gradually rolled into one program. Since everything is essentially interconnected anyway, it makes more sense to have everything in one place. That way a change in one area can be "seen" to affect others.

2) Because this is going to involve a great deal of string handling and dynamic allocation, but not require much in the way of efficiency, I'm going to be using the Last fully stable Version of an older (somewhat obsolete) language I can get the most out of using the least progging time.

It's gone through a number of naming incarnations, but you can find the product here: www.emediat.com if you're curious. With all of it's excentricities, it's the best language I've ever encountered for string handling.

It's going to work, and work bloody well, but it's going to look dated and nowhere near as slick as something you might get out of .net SDKs.

3) Exan, you might look to see if your Version of C# or C++ supports the strtok function in the string.h header package. It dates to ANSI C, so it should be there. That's probably the most effective way to parse a line for text, but the extrenious spaces in the text might make it more difficult to use.

As for dealing with spaces, you can first locate the :=. Every non-leading/terminating space character before it is your variable. Every non-leading/terminating space character after it is your data.

Substring type functions can make this convenient to code, but it's not necessarily going to be particularly optimal code.

Still, that isn't going to matter in this type of application. You only need to worry about it if you were writing something real-time in tighter processing conditions.

I may have some time to code this weekend, if there are no additional surprises.
__________________
What is this talk of release? Klingons do not [i]release</i] software. Our software [i]escapes</i],
leaving a bloody trail of designers and quality assurance personnel in its wake.
- Qu'Koth son of Klagg, Senior Software Engineer
Reply With Quote
  #6  
Old June 17th, 2004, 11:59 PM
Suicide Junkie's Avatar
Suicide Junkie Suicide Junkie is offline
Shrapnel Fanatic
 
Join Date: Feb 2001
Location: Waterloo, Ontario, Canada
Posts: 11,451
Thanks: 1
Thanked 4 Times in 4 Posts
Suicide Junkie is on a distinguished road
Default Re: Modding Tools

Yuck!
Please don't post long-line code in code tags

Anyways:
http://imagemodserver.mine.nu/other/MM

You can browse down the tree to SF/Tools and grab my stuff.


-----

Handy things like Get/Set Value, Get/Set stringValue, increment/add/multiply/exponent value
and get/set Nth Value which is very handy for damage at range in SE4.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 08:01 AM.


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