PDA

View Full Version : Anyone know how to run DOS programs?



Lionheart
January 18th, 2010, 20:17
Hey guys,

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. (SciFi game, X3 Terran Conflict).

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 directory 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 is the ReadMe on running it. I have highlighted the section I need to work in Bold Blue.....


//////////////////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?

scottmm73
January 18th, 2010, 20:29
Where is its (x2bc) location?

To change directories it should be cd c:/xxxx/xxxx and so forth. Where the xxxx's are the names of the folders that x2bc should be located.

The thing is the compile command I never seen before in DOS and numerous google searches did not produce that command as a DOS command unless it is something built into the software.

If you can give me a link to the software (if it's free), I can take a wack at it tomorrow and get back with you.

After rereading your post it may be an ingame running software operating off of its console program. Can you access a console in the game?

JamesChams
January 18th, 2010, 20:40
Mr. Bill "LionHeart,"

Are you using a MAC with an installation of Win XP on a seperate partition (dual-boot)?

If, NOT then this should work; from the "Run ..." option in the Start Menu you can just type " CMD " and click OK. That will open up a DOS Prompt. Older DOS (NON- Windows NT OS') used Command.com in place of CMD.com

Then, Type " CD\ " and press the "Enter" Key and you'll be at the root directory.
From there it is a matter of using the correct commands from within the directory structure (Folders) of the application. i.e. where every this application is installed. For that use the " CD " + [NAME of Directory] to switch into that folder(s) and run the program filename(s) with their switches from the command prompt. e.g. C:\NAME of Directory\x2bc -d some_file.bob output_file.test.bod and PRESS the ENTER Key.

and in the case of your request BOD's to BOB's: C:\NAME of Directory\x2bc -c --bob source.bod target.bob and PRESS the ENTER Key.


Hope this doesn't confuse you too much and answers your request.
Good Luck! :wavey:


Hebrews 11:6 "But without faith it is impossible to please Him, for he who comes to God must believe that He is, and that He is a rewarder of those who diligently seek Him." (http://www.lionheartcreations.com/Spiritual_Journey.html)

Thank you very much.
Sincerely,
From,
James F. Chams

Lionheart
January 18th, 2010, 20:41
Hey Scottsman,

It doesnt use the game to run or be controlled by, just a compiler tool that converts BOB to BOD and BOD to BOB (front and backwards compilations).


I'll get that link for you.

I didnt think of the folders, lol.. arrgh.. Thanks for that input.



Bill

fsafranek
January 18th, 2010, 20:58
Just like James said, CMD is essentially DOS in Windows. Should work fine.
:ernae:

Lionheart
January 18th, 2010, 21:11
Thanks James for that. I must have been typing when you were.

I'll give that a go.

In the mean time, while looking up the download link, I found an optional IDE version of the same installer with a basic control panel. (yayyyy).

brb...



Bill

JamesChams
January 18th, 2010, 21:24
Thanks James for that. I must have been typing when you were.
....I found an optional IDE version of the same installer with a basic control panel....

Mr. Bill "LionHeart,"

Your very welcome... just make sure you use the back slash " \ " (which is what DOS uses) and NOT the " / " , which is what is used in OS' like Linux (or HTTP based Languages like JAVA).

Also, if you found an IDE version, it might be easier for you to use (GUI Menu's, etc.) and might include a tutorial.

Good Luck! :wavey:


Hebrews 11:6 "But without faith it is impossible to please Him, for he who comes to God must believe that He is, and that He is a rewarder of those who diligently seek Him." (http://www.lionheartcreations.com/Spiritual_Journey.html)

Thank you very much.
Sincerely,
From,
James F. Chams

flaviossa
January 19th, 2010, 01:42
Mr. Bill,
I donīt know if itīs the case in here but i think you should give a try in this: DosBox.
This little program run almost anything that i had to run in Dos format. It is intended to run DOS games, but i have sucessfully run some DOS applications (As a litle market checkout DOS application created by me many, many years ago). Maybe your new IDE find works great with dosbox.

If youīre interested: http://dosbox.com/

krazycolin
January 19th, 2010, 06:45
If you're using Vista or Windows 7 (32 or 64) it might well be that. I've got a couple of 16 programs that just won't run. You need to use XP....

kc

Snuffy
January 19th, 2010, 07:43
Ain't it amazing how much you knowledge you loose thanks to a GUI! LOL!

Good Luck Bill!

PRB
January 19th, 2010, 07:50
Sometimes, when I don't feel like typing "CD\XXX\XXX\XXX\XXX", I go get the file CMD.EXE, from the c:\windows\system32\ folder, and copy the darn thing into the folder I'm going to work from. Then. just double-click it, you get a DOS command window, and its "current location" is already at the folder in which its running from... Saves all that typing, getting it wrong by one character, typing again, etc...

Lionheart
January 19th, 2010, 10:58
Many thanks guys!

:ernae:




Bill

trisager
January 19th, 2010, 12:12
Sometimes, when I don't feel like typing "CD\XXX\XXX\XXX\XXX", I go get the file CMD.EXE, from the c:\windows\system32\ folder, and copy the darn thing into the folder I'm going to work from.

In Windows 7 (and Vista, I believe): Open Windows Explorer, shift-rightclick the folder you want to work in, and you should see an option: "Open command window here".

Tom

PRB
January 19th, 2010, 14:18
In Windows 7 (and Vista, I believe): Open Windows Explorer, shift-rightclick the folder you want to work in, and you should see an option: "Open command window here".

Tom

Now that's a useful thing I learned today! Thanks, Tom!
:ernae: