Tripwire Interactive Forums

Go Back   Tripwire Interactive Forums > Killing Floor Forums > Killing Floor Modifications > Coding

Reply
 
Thread Tools Display Modes
  #1  
Old 06-09-2012, 05:02 AM
poosh's Avatar
poosh poosh is online now
Senior Member
 
Join Date: Jan 2011
Posts: 1,493
Default [Question] Preprocessor directives

Is there any possibility to implement functionality of C++ preprocessor directives in UnrealScript?

I want to do something like this:

Code:
//uncomment the line below to make the mutator ServerPerks-compatible
#define SERVERPERKS

#ifdef SERVERPERKS
class MyHumanPawn extends SRHumanPawn;
#else
class MyHumanPawn extends KFHumanPawn;
#endif
Reply With Quote
  #2  
Old 06-09-2012, 09:32 AM
Gartley's Avatar
Gartley Gartley is online now
Senior Member
 
Join Date: Dec 2010
Location: UK
Posts: 2,154
Default

Hmm, that could be handy.
__________________
Whisky's Workshop

"As you can see here, I'm -ALL ON MY F***ING OWN! Guys where the hell are you?!"
Reply With Quote
  #3  
Old 06-10-2012, 07:06 AM
FZFalzar FZFalzar is offline
Member
 
Join Date: May 2011
Location: UCC.exe
Posts: 68
Default

You mean this?
http://wiki.beyondunreal.com/Legacy:UCPP
Reply With Quote
  #4  
Old 06-10-2012, 10:44 AM
ro_sauce ro_sauce is offline
Senior Member
 
Join Date: Sep 2007
Posts: 3,110
Default

what would you do with those?
__________________


For RO2 Crash Support Help, PM me your problem and teamview connection, and I will see if I can fix it for you.
Reply With Quote
  #5  
Old 06-10-2012, 02:04 PM
poosh's Avatar
poosh poosh is online now
Senior Member
 
Join Date: Jan 2011
Posts: 1,493
Default

Quote:
Originally Posted by FZFalzar View Post
Thanx, I'll give it a try. But as I found out, preprocessing was only introduced in unreal engine 3: http://udn.epicgames.com/Three/Maste...Processor.html.
Reply With Quote
  #6  
Old 06-11-2012, 07:46 PM
King Sumo's Avatar
King Sumo King Sumo is offline
Senior Member
 
Join Date: Jan 2011
Location: Brazil
Posts: 301
Default

Probably you can use UCPP from UE3...
Or, you can use a C preprocessor. For instance, using GCC as preprocessor:

- somefile.puc:
Code:
#include "conf.h"
class SomeClass extends Actor;
function PostBeginPlay()
{
#ifdef DEBUG
    log("PostBeginPlay!");
#endif
}
- conf.h:
Code:
#define DEBUG
Then run:
gcc -E -x c -P -C somefile.puc

Output:
Code:
class SomeClass extends Actor;
function PostBeginPlay()
{
    log("PostBeginPlay!");
}
__________________
Bonus Stage/Boss Time Mutator
Pickup class for the Holy Hand Grenade
Door messages Mutator
My KF Public Server: Sexta Bruta Hardcore Server
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:34 PM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright ©2005 - 2013, Tripwire Interactive, LLC