Could be asleep, typing random messages instead.

UT preprocessor commandlet

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar Raven
Skaarj Warlord Skaarj Warlord
Posts: 807
Joined: 12 Nov 2007, 09:39
Location: Nørresundby
Contact:

Subject: UT preprocessor commandlet

Post Posted: 21 Sep 2008, 20:11

Name: UEngine Preprocessor Commandlet
Version: 0.5.262
Type: UCC Commandlet
Game: Unreal Tournament
Install: Extract everything to your UT folder.
Description: It's ucc commandlet which parses .uc files in search of preprocessor directives and macros.
Usage: Complete readme at WIKI.
Download Links: http://turniej.unreal.pl/files/UEnginePPC.zip ~93kb
Screen shot:
Image
ChangeLog:
  • v 0.5.262
    • Added new advanced macros to define in new section of project file
  • v 0.4.194
    • Added new `remove.start and `remove.end directives to remove larger parts of code
    • Namespaces are now usable in `include and `require directives
  • v 0.4.194
    • Added new global namespace
  • v 0.3.185
    • Added new __NUMERATE_CPP__ macro
    • Added new commadline option -force
    • Added new project option bForce
    • Various updates and fixes
  • v 0.3.168
    • Fixed bug in GetVariable function. Variable search is aborted if name is NULL.
  • v 0.3.150
    • added option to delete log calls out of UScript source
  • v 0.3.144
    • added bIniVersion to commandline and project file (changes the way macro __UENGINEVERSION__ works)
  • v 0.2.123
    • new directive `else if
  • v 0.2.106
    • new directive `namespace
    • new macro __UENGINEVERSION__
    • new macro __SELF__
    • macros can be used in conditional statements
  • v 0.2.56
    • new directive `import used to create #exec directive for large number of textures/sounds
  • v 0.1.5
    • added new option bIsPackage
  • v 0.1.4
    • fixed bug with inline `write directive
  • v 0.1.1
    • initial release


This is side effect of my studies on native ucc commandlet :P. As usual complete source code is included in the archive. All comments and suggestions are most welcome.

I plan to add more operators to conditional statements (||, &&, !), ability to turn on/off debugging/code cleaning only for certain file and that's pretty much it.

If anyone will find bugs, please report it here.
Last edited by Raven on 25 Aug 2009, 16:01, edited 7 times in total.
Madness, as you know, is like gravity…all it takes is a little push!
Image
http://turniej.unreal.pl/portfolio

User avatar Raven
Skaarj Warlord Skaarj Warlord
Posts: 807
Joined: 12 Nov 2007, 09:39
Location: Nørresundby
Contact:

Subject:

Post Posted: 26 Sep 2008, 11:18

Update. I've added new directive `import which can be used to create #exec for large number of textures/sounds.

Code: Select all

`import(directory,extension,type,group,lodset,flags,package)


Code like this:

Code: Select all

`import(tex,pcx,TEXTURE,HUD)


will iterate through all files in folder <project>/tex in search for *.pcx. When pcx will be found, directive will create #exec to import texture into group HUD. LodStet, flags and package are optional. Result will look like:

Code: Select all

#exec TEXTURE IMPORT NAME=Tex001 FILE="tex/Tex001.pcx"
#exec TEXTURE IMPORT NAME=Tex002 FILE="tex/Tex002.pcx"
#exec TEXTURE IMPORT NAME=Tex003 FILE="tex/Tex003.pcx"


As type you can use only TEXTURE and SOUND. If extension will be uax or utx preprocessor will create #exec obj load instead of #exec type import
Madness, as you know, is like gravity…all it takes is a little push!
Image
http://turniej.unreal.pl/portfolio

User avatar Raven
Skaarj Warlord Skaarj Warlord
Posts: 807
Joined: 12 Nov 2007, 09:39
Location: Nørresundby
Contact:

Subject:

Post Posted: 05 Oct 2008, 12:05

Another update. I've added possibility to define namespace (equivalent of c++ using namespace) and ability to check unreal engine version. So now, you're able to ignore/add some parts of code depending of unreal engine version.

One more thing. Please test it, so if it's bugless version and there's nothing else which can be added, I'll compile it for U1 :) also.
Madness, as you know, is like gravity…all it takes is a little push!
Image
http://turniej.unreal.pl/portfolio

User avatar Buff Skeleton
>:E >:E
Posts: 4173
Joined: 15 Dec 2007, 00:46

Subject:

Post Posted: 15 Dec 2008, 19:28

Wow, I know you released this a way long time ago, but I was just looking over it again and now I think I understand what it's for. It seems really pretty useful for certain things! I like the ability to strip out all log commands and the ability to insert headers. I think I might somehow integrate a date-header-updater into my standard "run ucc -make" batch file.

User avatar Raven
Skaarj Warlord Skaarj Warlord
Posts: 807
Joined: 12 Nov 2007, 09:39
Location: Nørresundby
Contact:

Subject:

Post Posted: 19 Mar 2009, 15:12

In case someone is interested - here's UEPC for Rune: http://turniej.unreal.pl/files/UEnginePPC_Rune.zip
Madness, as you know, is like gravity…all it takes is a little push!
Image
http://turniej.unreal.pl/portfolio

User avatar Raven
Skaarj Warlord Skaarj Warlord
Posts: 807
Joined: 12 Nov 2007, 09:39
Location: Nørresundby
Contact:

Subject:

Post Posted: 25 Aug 2009, 16:03

Update. Added lame macros implementation.

wiki wrote:You can also define advanced macros in new section of project file, eg.:

Code: Select all

[macros]
`log($value)=log($value,'ResidualDecay')


Now when you call in code:

Code: Select all

`log("Log message");


parser will change it to:

Code: Select all

log("Log message",'ResidualDecay');


Tips:

* Avoid using macros with similar name - eg.: `log and `logx will screw up result code.
* Avoid using parameters with similar name in one macro - eg.: `log($value1, $value2); will not work too good :).
* Macros can only be defined in project file.

Eventually all bugs listed above will be eliminated (current implementation was written in ~5-10 minutes).


For details go to wiki.
Madness, as you know, is like gravity…all it takes is a little push!
Image
http://turniej.unreal.pl/portfolio


Who is online

Users browsing this forum: No registered users and 16 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited