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

This Month's Specials

ATF: Armored Task Force- Save $8.00
War Plan Pacific- Save $8.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

Reply
 
Thread Tools Display Modes
  #1  
Old June 21st, 2005, 11:06 AM

Lemmy Lemmy is offline
Second Lieutenant
 
Join Date: Mar 2001
Location: Netherlands
Posts: 479
Thanks: 0
Thanked 0 Times in 0 Posts
Lemmy is on a distinguished road
Default [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
__________________
[Boo!]
Reply With Quote
  #2  
Old June 21st, 2005, 01:48 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: [Tool] SE4 text to html/javascript

Spiffy!
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!
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote
  #3  
Old June 21st, 2005, 02:21 PM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default Re: [Tool] SE4 text to html/javascript

Nice work! Any particular reason why you have chosen to hide the source files?
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
Reply With Quote
  #4  
Old June 21st, 2005, 02:44 PM

Lemmy Lemmy is offline
Second Lieutenant
 
Join Date: Mar 2001
Location: Netherlands
Posts: 479
Thanks: 0
Thanked 0 Times in 0 Posts
Lemmy is on a distinguished road
Default Re: [Tool] SE4 text to html/javascript

No particular reason, you can download it seperately here (v0.2) if interested
__________________
[Boo!]
Reply With Quote
  #5  
Old June 21st, 2005, 03:28 PM

Lemmy Lemmy is offline
Second Lieutenant
 
Join Date: Mar 2001
Location: Netherlands
Posts: 479
Thanks: 0
Thanked 0 Times in 0 Posts
Lemmy is on a distinguished road
Default 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.
__________________
[Boo!]
Reply With Quote
  #6  
Old June 21st, 2005, 04:12 PM
Mephisto's Avatar

Mephisto Mephisto is offline
Brigadier General
 
Join Date: Sep 2000
Location: Frankfurt, Germany
Posts: 1,994
Thanks: 0
Thanked 0 Times in 0 Posts
Mephisto is on a distinguished road
Default Re: [Tool] SE4 text to html/javascript

Mm, nice!
__________________
For, in the final analysis, our most basic common link is that we all inhabit this small planet. We all breathe the same air. We all cherish our children's futures. And we are all mortal. - JFK
Reply With Quote
  #7  
Old June 21st, 2005, 04:54 PM
narf poit chez BOOM's Avatar

narf poit chez BOOM narf poit chez BOOM is offline
Shrapnel Fanatic
 
Join Date: Mar 2003
Location: CHEESE!
Posts: 10,009
Thanks: 0
Thanked 7 Times in 1 Post
narf poit chez BOOM is on a distinguished road
Default Re: [Tool] SE4 text to html/javascript

I like it. Makes for easy browsing.
__________________
If I only could remember half the things I'd forgot, that would be a lot of stuff, I think - I don't know; I forgot!
A* E* Se! Gd! $-- C-^- Ai** M-- S? Ss---- RA Pw? Fq Bb++@ Tcp? L++++
Some of my webcomics. I've got 400+ webcomics at Last count, some dead.
Sig updated to remove non-working links.
Reply With Quote
  #8  
Old June 21st, 2005, 06:33 PM

Lemmy Lemmy is offline
Second Lieutenant
 
Join Date: Mar 2001
Location: Netherlands
Posts: 479
Thanks: 0
Thanked 0 Times in 0 Posts
Lemmy is on a distinguished road
Default 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.
__________________
[Boo!]
Reply With Quote
  #9  
Old June 21st, 2005, 08:08 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: [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?
Reply With Quote
  #10  
Old June 22nd, 2005, 03:06 AM
Fyron's Avatar

Fyron Fyron is offline
Shrapnel Fanatic
 
Join Date: Jul 2001
Location: Southern CA, USA
Posts: 18,394
Thanks: 0
Thanked 12 Times in 10 Posts
Fyron is an unknown quantity at this point
Default 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?
__________________
It's not whether you win or lose that counts: it's how much pain you inflict along the way.
--- SpaceEmpires.net --- RSS --- SEnet ModWorks --- SEIV Modding 101 Tutorial
--- Join us in the #SpaceEmpires IRC channel on the Freenode IRC network.
--- Due to restrictively low sig limits, you must visit this link to view the rest of my signature.
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 05:54 AM.


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