script compiling

Linsky

First time out of the vault
what line do i add to the p.batch to point to my bin folder of bloodshed dev c++ 4.0? i tried to figure it out myself but kept getting errors
 
These lines point to the c compiler:

@rem Watcom 11 users uncomment the following line:
@rem wcc386 temp.c /pc /fo=temp.i /w4

@rem Microsoft Visual Studio 6 users uncomment the following line:
@rem cl /P temp.c

Note how there is one for watcom c and one for vc++, both are commented out. So you need something like:

c:\PathToBloodshed\Bin\CompilerName temp.c

If you use watcom I showed exactly how to set it up (and so does Coljack in his tutorial). If you want to use a different compiler, you'll have to figure out this part of the configuration yourself ....
 
thanks for the info. when i download watcom 11(the 50mbs take 15 minuts to download on my computer) it is in a zip file and when i try to unzip it it says "invalid or unfinished zip file. if downloaded from the internet, try to install it again"


im curious, what exactly is the temp.c file used for?
 
Linsky said:
thanks for the info. when i download watcom 11(the 50mbs take 15 minuts to download on my computer) it is in a zip file and when i try to unzip it it says "invalid or unfinished zip file. if downloaded from the internet, try to install it again"

Try this which is just the watcom compiler executable and DLL (1MB download).

Linsky said:
im curious, what exactly is the temp.c file used for?

Note how p.bat does @copy %1.ssl temp.c
It copies your script source to temp.c. Then the preprocessor (watcom) adds in all of the code that is in the includes (define.h, command.h, etc). Then the script compiler (mapper's compile.exe) compiles the whole thing. So your script ends up being much larger than your source, since it also has all of the included source.
 
Here is the p.bat that I use.

Notice how it copies the resulting .int to my patch directory.
It also opens the temp.ssl file in GVIM editor if there is an error.
The compiler error will tell me a line number.
In GVIM I can do shift-colon (type a line number) enter
And I'm positioned at the error ....
 
thanks. that should work well. to compile a .ssl file i would run command.com and type wcc.exe script.ssl>script.pee then move the result to another folder with the compiler in it and type "dos4gw compile script.pee>script.ini"


EDIT: the line in red above doesnt work. what do i type? also, where do the .dll files get extracted to?
 
Linsky said:
thanks. that should work well. to compile a .ssl file i would run command.com and type wcc.exe script.ssl>script.pee then move the result to another folder with the compiler in it and type "dos4gw compile script.pee>script.ini"


EDIT: the line in red above doesnt work. what do i type? also, where do the .dll files get extracted to?

Huh? Why not use the batch file? I have my batch file as a shortcut on the windows tool bar at the bottom of the screen. All I do is click it. I never have to open a command shell, because the batch file does that automatically.

Take a look at my p.bat. The actual compile line is this:

@F:\FOMapper\scripts\dos4gw F:\FOMapper\scripts\compile temp.ssl

Notice how I have full path names to dos4gw and compile. That allows me to put my script source anywhere and do a call p.bat (ie my source doesn't have to be in the mapper directory).

"It doesn't work" isn't enough information.

Don't "type type wcc.exe script.ssl>script.pee then move the result to another folder"

EDIT: Look closely at what the batch file does:

The p.bat file puts your source into temp.c
Watcom preprocesses that but its output file is temp.i
The p.bat file copies temp.i to temp.ssl
Mapper's compiler compiles temp.ssl and creates temp.int
Then p.bat copies temp.int to your scripname.int

Try my p.bat but change the paths to those of your system. If you have watcom working now this batch file should work as long as you change the path names appropriately. You can change the editor to your favorite one (ideally one that can easily move you to specific line number: the number where an error will occur).
 
Linsky said:
where do the .dll files get extracted to?

Wherever you want to put watcom.
How about c:\watcom\binnt

Then change this line to point to C instead of F
@F:\watcom\binnt\wcc386 temp.c /pc /fo=temp.i /w4
 
I changed my p.bat to use a different editor if there is an error in the compile. The editor is the free TextPad.

So I changed the error section of p.bat to do this:
:ERROR
@echo ERROR: %_CWDS%%1.ssl >> err.log
C:\TextPad\TextPad.exe F:\Fallout2\FOEXP.DAT\Scripts\source\temp.ssl

This way, if there is an error in the compile, the command shell (DOS window) will say something like this:

TEMP.SSL(10413): Error! Undefined symbol ddisplay_msg

And the batch file will automatically open the TEMP.SSL in TextPad.
The 10413 is the line number of the error.
In TextPad I select Search -> Goto -> Line 10413 and I'm positioned where the error in the script is.

But this is not my source (it's temp.SSL) ... this is just an easy way to find the error.

Jargo's FSE is probably much better but this works okay.
 
all i need to know now is where the headers are supposed to be. i have the compiler, wcc386, dos4gw, and p.bat in c:\windows\desktop\compiler and when i use p.bat the only errors i get are "unable to find '..\headers\define.h" and "unable to find '..\headers\command.h"

when i use the compiler with jargo's FSE it shows this:
Compiling file: "Acjordan.ssl"
Starting preprocessor
Precompilation successful!
Compiling preprocessor output:"temp.i"
Script compiled successfully!


then a text box comes up that says:
FSE was unable to copy file to fallout folder due to unknown error.
the compiled script is in the compiler folder


but when i look into the compiler folder theres not a .int file to be found. i tried to change it to a different folder named fallout 2 but it gave the same error




another random question. Do the headers that come with the FO2 mapper work with fallout 1? because i have an idea for a mod but dont want to recreate the whole game to change the hub.
 
Linsky said:
"unable to find '..\headers\define.h"

If you look at the script source code you'll see this:

#include "..\headers\define.h"

Notice how that statement includes a path ..\ means up one level from the directory where the source is, and then to \headers. So the headers need to be in a directory at the same level of where the source is, example:

\scripts\arroyo <- source code
\scripts\headers <- headers

The headers can actually be anywhere as long as the precompiler (watcom) can find them. If you use just the header name like this:

#include "define.h"

You can put them in the same directory as your source code.
 
Linsky said:
then a text box comes up that says:
FSE was unable to copy file to fallout folder due to unknown error.


Yeah, I had the same problem with FSE, for some reason it doesn't seem to understand some errors. Because when you just use a command prompt it tells you exactly what the problem is (I think in my case it was an "unknown command" sorta thing).
 
thanks dude_obj. you saved my sanity.

one last question, is an ipp file the same as an ssl file?
 
is an ipp file the same as an ssl file?

No. There are three different compilers, and each uses a different set of opcode names. To clarify:

IPP compiler (written by Heinz/Bruz/Abel) was the first FO script compiler/decompiler, written a long time ago, before interplay released the official mapper (which included the compiler they used for game scripts). I don't think anyone uses this compiler anymore, so don't worry about IPP at all. All you need is the official mapper for compiling new scripts.

Noid's compiler is another that predates the release of the official compiler. This one is still used regularly whenever there is a need to decompile scripts (when no source is available). The source code generated by Noid's decompiler will not compile with the official mapper, because it has different names for commands.

The Official mapper includes the script compiler used for the game and all of the FO2 script source code. Everyone is using this compiler now. Most are using Watcom C compiler as the precompiler to merge header files.

So the general idea is:

1) Use the official mapper's script compiler for compiling all new scripts.

2) If you need to decompile, use Noid's decompiler. If you only need to make a small change to a decompiled script, you can use Noid's compiler to generate the INT file.

3) Jargo's FSE has a converter that will change the decompiled source (Noid's format) to Interplay format, so it can be compiled with the official compiler.

The trickiest part of getting everything working is configuration of the compilers. It would be nice if FSE had the compiler and precompiler budled into its install and already configured.

I do most of my work with just the mapper and watcom, batch scripts, and a text editor.
 
wow, its working perfectly now. and now that i understand the magic of batch files i can compile it, put it in the right directory and test it in under a minute. thanks for all your help.
 
Back
Top