Forum

fteqcc and progs.src conditional compilation

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

fteqcc and progs.src conditional compilation

Postby Baker » Thu Feb 17, 2011 3:36 am

I want to conditionally compile frikbots into a mod.

How can I effectively deal with progs.src ??

I've read everything here:

http://www.fteqw.com/wiki/index.php?tit ... efinitions

And am not quite sure how to do this.

Here is what I want to do that doesn't work, but anyone can see what I am attempting.

progs.src
../progs.dat

#define WITH_FRIKBOTS

defs.qc

#ifdef WITH_FRIKBOTS
frikbot/bot.qc
frikbot/bot_way.qc
frikbot/bot_fight.qc
frikbot/bot_ai.qc
frikbot/bot_misc.qc
frikbot/bot_phys.qc
frikbot/bot_move.qc
frikbot/bot_ed.qc
#endif


func.qc
initiate.qc
vote.qc
subs.qc
fight.qc
ai.qc
combat.qc
items.qc
weapons.qc
world.qc
client.qc
utilities.qc
match.qc
player.qc
monsters.qc
doors.qc
buttons.qc
triggers.qc
plats.qc
misc.qc
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby andrewj » Thu Feb 17, 2011 11:40 am

I'd just have progs1.src without the frikbot stuff and progs2.src with them, and copy one to progs.src before compiling.

Otherwise I think you'd need to put the #ifdef and #endif into each frikbot qc file (at the very top and bottom, respectively)
andrewj
 
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Postby Spike » Thu Feb 17, 2011 1:24 pm

progs.src is still just a list, sadly.
unless you want to use 'newstyle' progs.src...

#pragma PROGS_DAT "../progs.dat"
#include "foo.qc"
#ifdef MYDEFINE
#include "mycode.qc"
#endif
#include "bar.qc"

compile with 'fteqcc -DMYDEFINE'

this is basically preqcc syntax as found in CuTF mods is supported, and should be sufficient (the PROGS_SRC pragma is bypassed and thus silently ignored).

fteqcc will interpret progs.src as a qc file if and only if the first actual char of the file is a #. An include, a (progs_dat) pragma, a define, any of those of course have a leading # and will work.

there's a #includelist somewhere too, but I don't remember how to end the list...
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby Baker » Thu Feb 17, 2011 4:59 pm

Alrighty! I knew FTEQCC had some fancy Kung-Fu but wasn't sure how exactly it worked.

Thanks!

I may just end up kicking it up old school. Haven't decided, but I like conditional builds, obviously.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest