PDA

View Full Version : How to run DOS commands?



Lionheart
January 18th, 2010, 19:04
Hey guys,

Mike, I am figuring you might know how to do this.

I need to figure out how to run this 'X2BC' program that converts files from BOD to BOB formats which goes into X3TC as ships.

The problem is, its a DOS console program. I have no idea how to get it to function.

When I turn on the DOS prompt window, I have my Desktop location in there.

I think I need to change director or find a way to go to X2BC.

I have tried 3 dozen ways to try to go to X2BC and 'envoke' the program to work, but I keep getting nothing...

Here are some of the instructions....


//////////////////BEGIN PASTE HERE////////////////////////////////



Introduction:
=============

x2bc is program for conversion between two data formats used in X2 - The Threat
and X3 Reunion.

Those two data formats are "plain text" and "binary".
Plain text files have extension "BOD" and binaries use extension "BOB".

Furthermore X2 stores two types of data in these files: bodies and scenes.

A body file contains one or more "bodies" - meshes consisting of vertices and
faces.

A scene file contains one scene. A scene defines body placement in space: its
coordinates and rotation. Sometimes body data are stored directly in scene files
instead of being in separate file.

The compiler:
=============

x2bc can convert (decompile) binary encoded scene and body files to text format
and convert (compile) text encoded scene and body files to binary format.

Usage:
------

x2bc is a console program (it's invoked from command line)
run:

x2bc /?

to get list of supported options

Flags and Switches:
-------------------
There are 2 types of flags: short (1 letter) and long (multiple characters)
Short flags are preceded by hyphen '-' and long flags are preceded by two
hyphens '--'

Short flags can be combined in such way:
-cs
is the same as
-c -s

Switches are special case of long flags. They can be followed by plus '+' or
minus sign '-'. If sign is ommited, plus sign is assumed.

Example:

--xpinfo
is same as
--xpinfo+

and it will turn on Extra point informations.

--xpinfo-

will turn them off.

Switches always override settings from INI file.

Decompiling (BOB to BOD):
-------------------------

x2bc -d "some file.bob"
OR
x2bc --decompile "some file.bob"

This is the shortest way to decompile a file. It will output the result to file
"some file.bod" in the same directory where the input file is. The default
extension can be changed in the INI file - see section INI file.

x2bc -d "some file.bob" "output file.test.bod"

this will output the results to file "output file.test.bod"

Switches:
---------
--xpinfo Extra point informations - see file extra_bob_data.txt
--frame_warnings frame format warnings - see INI file
--x3info X3 specific informations - see file extra_bob_data.txt

Compiling (BOD to BOB):
-----------------------

x2bc -c --cut "source.bod"
OR
x2bc --compile --cut "source.bod"

This is the shortest way to compile BOD file. You must tell the compiler what
data the input file contains via the --cut or --bob flag.

x2bc -c --bob "source.bod" "c:\target.bob"

Will compile the file (here we are telling that it contains BOB1 data) to
"c:\target.bob"

X3 CUT (scene) files:
---------------------

X3 is using strings instead of numbers to indentify a body. To be able to
compile such scene files, the cut version must be set to 6 or greater, otherwise
the compiler will detect invalid data type.

Error detection in BOD files:
-----------------------------

I did my best to match the parsing of BOD files with X2, so x2bc will recognize
(all?) errors which will cause X2 to crash/not show body or scene. If BOD file
can be compiled with x2bc w/o errors it will work in X2 as well. If x2bc detects
errors in BOD file, it will show error message containing line and column where
the error is.
Note that the "coordinates" of error are sometimes shifted by 1 token so you
must not blindly rely on the column number and you may have to look on the
preceding text to find the error. Like in C, sometimes if the source code is
"well" malformed it will confuse x2bc to such level that the error coordinates
will be incorrect at all.

Limitations:
------------

- The BOB file created by compiling BOB1 source will almost never be identical
to the original BOB file. That's because x2bc writes the points in different
order than Egosoft. Also the size of files may differ.
If you compile plain CUT1 source (without embedded BOB1) the resulting BOB file
will be binary identical with original BOB file.

- Because floating points are stored as integers in BOB format, there is loss of
precision when compiling BOD file to BOD and back. However the numbers will not
degrade any further if you comiple / decompile.

- When compiling BOD file, whole file is loaded into memory at once.

- Even if compilation fails, the output BOB file is still created and can
possibly contain data.

- When you compile body files with material 3 into BOB format, you may notice
loose of details. That's because when X2 loads material 3 definition it adds
some hardcoded effects (such as bump maps). But materials stored in binary
BOB files are stored as material 5, and these materials are treated exactly as
they are defined, and X2 will not add any additional detail to them.

Performance:
------------

x2bc decompiles 06070.bob (46.7 MB) in 38 seconds. The output file has size of
90 MB. The memory allocation vary - peak is around 19 MB.

x2bc compiles 06070.bod (90 MB) in 1 minute 35 seconds. The memory allocation is
roughly
size of file + ~10MB. That is 90 MB + 10 MB.

x2bc decompiles 10205.bob (3.47 MB, 47 000 points) in 3 seconds

x2bc compiles 10205.bod (7.42 MB) in 6 seconds

Tested on Intel P4 1.5 GHz, 512 MB RAM

Decompiling performance of x2bc is better than performance of DeBOB from
CheckerTwo, but only because x2bc is using better algorithm for "packing of
points". When x2bc is using them same linear search for "point packing" as DeBOB
does, then DeBOB is slightly better.

INI file:
=========

INI file consists of two main sections: "program" and "library".
Section "program" is used by x2bc while section "library" is used by library
libx2bc.

See the ini file itself for more info.





The key area I need to get to function is converting BOD's to BOB's...


Anyone know how to walk me through how this is punched into the little DOS window?

Marlin
January 18th, 2010, 19:22
LOL WOW The only thing that makes any sense to me is punching the little window in. LOL

I hope you get it figured out Bill, good luck!!!!

Lionheart
January 18th, 2010, 20:13
Thanks Marlin.

Its over my head when it comes to DOS

I tried making a BAT file that would work the conversion, but that didnt work.


Maybe I'll ask in the Newshawks room. Some programmers must go in there.



Bill

GT182
January 19th, 2010, 06:52
Man, my head is just spinning from reading all that Bill. WAY over my head. :isadizzy:

Good luck... I hope you get it all fingered out. :d

IanP
January 19th, 2010, 08:00
I hope I'm not oversimplifying your problem here, but you said that when you go to cmd prompt, it is at your desktop location? If so, type

cd\

That will take you to the root (e.g. C:\)

say the compiler is in C:\program files\egosoft\x3tc (I have no idea where the non-Steam version really lives...) then type:

cd program files\egosoft\x3tc


to get there. Then simply type the commands as it requests to run them.

By far the easiest way to use DOS compilers is simply to put all the files you want in one place (e.g. the compiler, your BOD file, any other files you want and put them in C:\x3tctemp) then you only need to go to that path.

if you need to change drives, then simply the drive letter followed by a colon will take you there:

D:

Will take you to D:\.

If that's not what you need then I apologise, but if it is and you still have problems, give me a shout. Most of our Train Describer stuff is still done in DOS (MS DOS 6.20 in case anyone remembers that) so I still use it regularly, if not daily.

Lionheart
January 19th, 2010, 11:02
Thanks Ian,

That helps tremendously.


I have to say that I did find a version of it offered by another fellow, that uses an IDE interface screen or control panel. That made it pretty easy for me.

I was able to convert the BOD's to BOB's. :d But then ran into another snag... :banghead:

GT182
January 19th, 2010, 15:13
But then ran into another snag... :banghead:

Do tell Bill. Inquiring minds would like to know too....if you'd like to tell us. Notice I didn't say need to know. LOL

Just in case the pressure is relived from my brain, and I could then figure out what it's all about. ;)

gigabyte
January 19th, 2010, 16:56
Sorry to be so late in this one I am on the road, stuck in a motel room in Moncton, NB right now...

Bill, Ian has the right idea, when I have to use the DOS Console for that kind of thng I do exactaly as Ian suggests, I create a temp or Install folder in the root and use it for my work, it is much easier than a fully qualified name like c:\Program Files\Ergosoft\X3 Terran Conflict...etc...etc...

Create a folder somethig like c:\Xtemp, or I like C:\WIP (easy to type...lol) BTW the dos command to create a folder is MD \Folder Name.

If you have problems in the DoS console type any command /? for a small help screen, or just Help for a general list.

IanP
January 19th, 2010, 22:36
Before I found GUIs for all the scenery design stuff, you ought to have seen the contents of my C:\FSTEMP folder... Most of it is still there, just ignored in favour of living in the post-1994 computing world. ;)

luckydog
January 19th, 2010, 22:37
Sorry to be so late in this one I am on the road, stuck in a motel room in Moncton, NB right now...

Bill, Ian has the right idea, when I have to use the DOS Console for that kind of thng I do exactaly as Ian suggests, I create a temp or Install folder in the root and use it for my work, it is much easier than a fully qualified name like c:\Program Files\Ergosoft\X3 Terran Conflict...etc...etc...

Create a folder somethig like c:\Xtemp, or I like C:\WIP (easy to type...lol) BTW the dos command to create a folder is MD \Folder Name.

If you have problems in the DoS console type any command /? for a small help screen, or just Help for a general list.


Moncton, NB ???? !!!!! :isadizzy:

I spent a week there one day !!!

GT182
January 20th, 2010, 06:13
Sorry to go OT..... I was thru Moncton back in 1976 in my way to Nova Scotia and on to PEI by the Ferry. And I've never seen such huge red jelly fish as I did up on the North shore in PEI National Park. Beautiful Provinces and great people. We even saw the Queen getting off a helicopter at a big doings... I believe it was at Moncton's airport.

aeronca1
January 20th, 2010, 10:57
Bill, is this on your Mac? OR is it within Windows? Mac OS X is built on top of (BSD?????). Not really sure, my last Mac had 9.something.something, but if so, then the commands required may be in a unix "flavour" within the terminal window.

gigabyte
January 20th, 2010, 13:34
LD & GT, yes Moncton, NB I live in Saint John, NB and cover the Atlantic Region so I am all over this lovely area regularly. Moncton is a regular stop between my home base and Halifax location, one of the reasons I love my job so much is because I get to travel the region regularly. You guys should get back during lobster season, now that is the time to visit...

GT182
January 20th, 2010, 15:56
You guys should get back during lobster season, now that is the time to visit...

Yep, I love lobster for breakfast too. Beer-battered and deepfried, dipped in melted butter is great.

Ahhhhh, Saint John with it's reversing falls..... it's a sight I'll never forget. Especially when the river completely stops flowing.

http://www.tourismsaintjohn.com/index.cfm?event=page.view&filename=reversingfalls.cfm

gigabyte
January 20th, 2010, 16:43
Yep, I love lobster for breakfast too. Beer-battered and deepfried, dipped in melted butter is great.

Ahhhhh, Saint John with it's reversing falls..... it's a sight I'll never forget. Especially when the river completely stops flowing.

http://www.tourismsaintjohn.com/index.cfm?event=page.view&filename=reversingfalls.cfm

You got it, now can you tell which one is Gig in the picture below...

GT182
January 20th, 2010, 18:18
Yee gads no.... I ain't gonna go there. http://img.photobucket.com/albums/v64/GT182/faint.gif And it's surely not 5, 9 or 10... going l to r.

Chacha
January 20th, 2010, 18:23
You got it, now can you tell which one is Gig in the picture below...



Eeeks!


Covers Hannah's eyes! :isadizzy:

Lionheart
January 20th, 2010, 20:31
Bill, is this on your Mac? OR is it within Windows? Mac OS X is built on top of (BSD?????). Not really sure, my last Mac had 9.something.something, but if so, then the commands required may be in a unix "flavour" within the terminal window.

Hey Aeronca,

Its on a Mac, but this has a split drive with pure WinXP on one side, so DOS works fine on it.

I got it all working. I found a new version of the compier with a control panel.

Many thanks for the input and help.

:guiness: