Page 1 of 1

UnrealEngine 1 PreProcessor

Posted: Sun Aug 24, 2008 3:25 pm
by Raven
This preprocessor is inspired by the one existing in Unreal Engine 3.

Install:
Copy files in the archive to your /system folder.

Download

http://turniej.unreal.pl/files/uenginepp.zip (~570 kb)

ReadMe

ReadMe at [url=http://wiki.beyondunreal.com/UE1:UE1PreProcessor]WIKI[/url]

It's copy of UT3 preprocessor. Currently supported directives are:

`process - should be in the first line of .uc file. Tells preprocessor to parse file
`include file - embade file in the currently opened .uc
`inc_process file - embade file in the currently opened .uc and parses it
`define variable - defines empty variable (used in `ifdef and `ifndef directives)
`define variable=value - defines variable with specified value
`write variable - writes defined variable
`ifdef variable - evaluates to true if variable is defined
`ifndef variable - evaluates to true if variable is not defined
`else  - part of conditional statement
`endif - ends conditional statement
`check definition==value - evaluates to true if defined variable (definition) equals value. Used in strings, floats, integers.
`check definitionvalue - evaluates to true if defined variable (definition) does not match value. Used in strings, floats, integers.
`check definition>value - evaluates to true if defined variable (definition) is greater then value. Used in floats, integers.
`check definitionint2
//var() int test1;
//`else
var() int test2;
var() class NewActor; //`write nc
//`endif[/code]

Of course input file can look different, but most important thing is to write `process in first line.

Re: UnrealEngine 1 PreProcessor

Posted: Sun Aug 24, 2008 3:50 pm
by DieHard SCWS
For posts like this, you should also include information to what it is and what it does. Theres alot of data in the post but i have absolute no clue whats it about. So please post also information to what this is :)


Otherwise it looks great lol :)
.
.
.

Re: UnrealEngine 1 PreProcessor

Posted: Sun Aug 24, 2008 4:10 pm
by Raven
Well... it's preprocessor.
In computer science, a preprocessor is a program that processes its input data to produce output that is used as input to another program. The output is said to be a preprocessed form of the input data, which is often used by some subsequent programs like compilers. The amount and kind of processing done depends on the nature of the preprocessor; some preprocessors are only capable of performing relatively simple textual substitutions and macro expansions, while others have the power of fully-fledged programming languages.
Unreal Engine 3 has preprocessor which is kinda useful in scripting. I wrote it for debugging of TCO.

Re: UnrealEngine 1 PreProcessor

Posted: Sun Aug 24, 2008 6:50 pm
by Jâçkrâßßit
so basically you can insert "test data" to debug a script before you actually compile the .u?

I guess it would save some time so you wouldn't have to recompile a bunch to get things working correctly.. cool raven

Re: UnrealEngine 1 PreProcessor

Posted: Sun Aug 24, 2008 7:10 pm
by Chaos13
I guess not, it converts .ucp files to .uc files with usage of `... lines like #... lines (compiler directives like #ifdef #endif etc...) with replacement of ` lines with designated script code. Pretty cool and useful ::)

... Edit: Gonna go debug stuff for UT3 ;D

Re: UnrealEngine 1 PreProcessor

Posted: Sun Aug 24, 2008 10:18 pm
by Raven
You have to recompile the code. It generates .uc files. But it saves time if you don't want to edit code to delete some things (like logging functions).

Re: UnrealEngine 1 PreProcessor

Posted: Mon Aug 25, 2008 12:45 am
by Jâçkrâßßit
You have to recompile the code. It generates .uc files. But it saves time if you don't want to edit code to delete some things (like logging functions).
ahhh I gotcha

Re: UnrealEngine 1 PreProcessor

Posted: Mon Aug 25, 2008 10:52 am
by Raven
Update:

new features:
- globals can be defined in project file in special [globals] group or in commandline with special -global switch:

Code: Select all

[globals]
global_value1=test1
global_value2=test2
or

Code: Select all

uenginepp.exe ..\SomeScript -clean -debug -global testglobal1=test1 -global testglobal2=test2
fixes
- if defined variable does not exists (in `write or `check), it's name will be used instead

Re: UnrealEngine 1 PreProcessor

Posted: Mon Aug 25, 2008 11:40 am
by Chaos13
uenginepp.exe ..\SomeScript -clean -debug -global testglobal1=test1 -global testglobal2=test2
Ownage ;D GMode=Debug :P