.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   [Tool] SE4 text to html/javascript (http://forum.shrapnelgames.com/showthread.php?t=24271)

Lemmy June 21st, 2005 11:06 AM

[Tool] SE4 text to html/javascript
 
For a preview, look here (may take a few seconds to load, ~500kB)
Yes, pictures are missing.

So i had some free time, got bored, and recently learned about XML and XSL. I wanted to put my newly learned skills into practice...soo....and well, to make a long story short, i ended up writing a tool in C# (first time in C# as well) that converts some of the SE4 data files into a javascript file and a html/js webpage that display the contents of that newly generated javascript file...now if you're wondering what happened to the XML, well, XML/XSL was too slow because could only display everything at once unless i used javascript...and creating 400+ tables with components takes way too long. Only way to cut back on the load time was to use complicated not-so compliant javascript to only display some of the XML data at a time. But, if i'm going to use javascript, i might as well do everything in javascript, be compliant, and ditch the XML to make it easier on myself.

Anyway..i guess 80% of you didn't understand a word of this and are just interested in the tool, so...

The good stuff
Step 1: Unzip the contents of this zip file in your mod directory (the same directory that contains the Data directory). It will create a new directory called 'se4html'
Step 2: In this new directory you'll find 'se4html.exe', run that anytime you want to convert your data files to javascript. When it's done it will create a new file 'se4data.js'.
Step 3: You can now open 'se4data.html' in your browser and see the result (with pictures if you have them in your mod dir)

* The program does not alter your mod files in anyway.
* Currently it only reads/converts TechAreas.txt, Components.txt, Facilities.txt and Vehicles.txt
* To have pictues you need the Components and Facilities folder in your Pictures dir as well.
* It has been tested on vanilla SE4 Gold (latest patch), TDM 3.4 and the Adamant mod...it is possible that other mods contain certain unknown elements that causes the program to malfunction, the result will be that 'se4data.js' will contain errors, which in turn causes the html page to not function properly...if you're a web developer/programmer type person, you'll probably know how to track down the error/anomaly in your mod files...if not, then yeah, not much you can do except report it here along with unusual/non-standard things you put in your mod files.


[edit]
Current Version: 0.3
Added: Engines Per Move in Vechicles section
Fixed: Requirement Must Have Bridge wasn't applied correctly
Fixed: Empty ablity descriptions replaced by ability type and values

Ed Kolis June 21st, 2005 01:48 PM

Re: [Tool] SE4 text to html/javascript
 
Spiffy! http://forum.shrapnelgames.com/images/smilies/laugh.gif
I know Fyron did something like this once, but it only worked for the components... looks like you've got everything but the kitchen sink!

Fyron June 21st, 2005 02:21 PM

Re: [Tool] SE4 text to html/javascript
 
Nice work! Any particular reason why you have chosen to hide the source files?

Lemmy June 21st, 2005 02:44 PM

Re: [Tool] SE4 text to html/javascript
 
No particular reason, you can download it seperately here (v0.2) if interested

Lemmy June 21st, 2005 03:28 PM

Re: [Tool] SE4 text to html/javascript
 
Ok, minor problem, i was under the impression that multiple components (and facilities/vehicles) could not have the same name...i was wrong.
As it is now only the last component with a specific name will read, all others will be ignored...but i'm working on fixing that.

Mephisto June 21st, 2005 04:12 PM

Re: [Tool] SE4 text to html/javascript
 
Mm, nice!

narf poit chez BOOM June 21st, 2005 04:54 PM

Re: [Tool] SE4 text to html/javascript
 
I like it. Makes for easy browsing.

Lemmy June 21st, 2005 06:33 PM

Re: [Tool] SE4 text to html/javascript
 
Quote:

Lemmy said:
Ok, minor problem, i was under the impression that multiple components (and facilities/vehicles) could not have the same name...i was wrong.
As it is now only the last component with a specific name will read, all others will be ignored...but i'm working on fixing that.

That's fixed now, and the new version (0.2) is uploaded.

Suicide Junkie June 21st, 2005 08:08 PM

Re: [Tool] SE4 text to html/javascript
 
Oooh! Shiny new toys!
---

Some points I see just playing with it:

- Engines per move would be a valuable statistic in the vehicles section for many mods.

- Why do the entries for vehicles:mines in the demo there say "must have 1 computer core"?

- Tech level zero in the techlist seems pointless, since you can never have tech level "minus one", and thusly, a requirement of level zero is not a requirement at all.

- As you can see in the entry for Stock Ion Engines, abilities with a null description should not have a point for the blank ability.

I'm also wondering if this thing handles infinite range missiles with their 21st damage-at-range value?

---

Oop. Won't run. Got an mscoree.dll to go with it?

Fyron June 22nd, 2005 03:06 AM

Re: [Tool] SE4 text to html/javascript
 
Description-less abilities still need to be indicated somehow though. Perhaps a list of the abilities themselves in addition to the description boxes?


All times are GMT -4. The time now is 10:58 AM.

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