Advertisement

Author Topic: using ## in macros for config.cpp  (Read 676 times)

0 Members and 1 Guest are viewing this topic.

Offline Mikero

  • Former Staff
  • ****
  • ook?
    • Linux Step by Step
using ## in macros for config.cpp
« on: 18 Nov 2007, 20:39:17 »
unlike ofp, the arma engine doesn't appear to cope with ## macros

#define thing(var) model=var##123;

thing(Mary);

should produce

model=Mary123;


the ## just doesnt seem to work

anyone ???
Just say no to bugz

Offline bdfy85

  • Contributing Member
  • **
Re: using ## in macros for config.cpp
« Reply #1 on: 19 Nov 2007, 15:27:17 »
working good for me ;)
Code: [Select]
#define TankCrewIn(Name) \
class Proxy##Name##Commander: ProxyCommander {}; \
class Proxy##Name##Driver: ProxyDriver {}; \
class Proxy##Name##Gunner: ProxyGunner {};

#define TankCrewOut(Name) \
class Proxy##Name##CommanderOut: ProxyCommander {}; \
class Proxy##Name##DriverOut: ProxyDriver {}; \
class Proxy##Name##GunnerOut: ProxyGunner {};

#define TankCrew(Name) TankCrewIn(Name);TankCrewOut(Name)

// define tank crews
TankCrew(M60);
TankCrew(M1A1);
TankCrew(M113);

TankCrew(BMP);
TankCrew(T72);
TankCrew(T80);
TankCrew(ZSU);

TankCrew(T55);[/codes]
#define TankCrewIn(Name) \
class Proxy##Name##Commander: ProxyCommander {}; \
class Proxy##Name##Driver: ProxyDriver {}; \
class Proxy##Name##Gunner: ProxyGunner {};

#define TankCrewOut(Name) \
class Proxy##Name##CommanderOut: ProxyCommander {}; \
class Proxy##Name##DriverOut: ProxyDriver {}; \
class Proxy##Name##GunnerOut: ProxyGunner {};

#define TankCrew(Name) TankCrewIn(Name);TankCrewOut(Name)

// define tank crews
TankCrew(M60);
TankCrew(M1A1);
TankCrew(M113);

TankCrew(BMP);
TankCrew(T72);
TankCrew(T80);
TankCrew(ZSU);

TankCrew(T55);
example to define ofp crew proxies in arma
Liberation Mod scripts&balance