Game Development Community

Error When Compiling RTS Merged with 1.3

by Robert Seeman · in RTS Starter Kit · 12/03/2005 (3:23 pm) · 4 replies

I realize that simply copying the game/RTS folder into the 1.3 TGE code then recompiling is not necessarily going to give all goodies in the RTS kit, however most of the code does compile except for RTSUnit.cc and RTSProjectile.cc. It's proving difficult to find why these errors are occuring but any insight or suggestions would be much appreciated.

RTSUnit.cc

D:\Torque\SDK\engine\game\RTS\RTSUnit.cc(970): error C2248: 'ShapeBase::mSoundThread' : cannot access private member declared in class 'ShapeBase'
D:\Torque\SDK\engine\game\RTS\RTSUnit.cc(975): error C2248: 'ShapeBase::mScriptThread' : cannot access private member declared in class 'ShapeBase'
D:\Torque\SDK\engine\game\RTS\RTSUnit.cc(994): error C2248: 'ShapeBase::Thread' : cannot access private struct declared in class 'ShapeBase'
D:\Torque\SDK\engine\game\RTS\RTSUnit.cc(994): error C2248: 'ShapeBase::mScriptThread' : cannot access private member declared in class 'ShapeBase'
D:\Torque\SDK\engine\game\RTS\RTSUnit.cc(1182): error C2248: 'ShapeBase::Thread' : cannot access private struct declared in class 'ShapeBase'
D:\Torque\SDK\engine\game\RTS\RTSUnit.cc(1182): error C2248: 'ShapeBase::mScriptThread' : cannot access private member declared in class 'ShapeBase'


RTSProjectile.cc

D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(60): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(122): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(124): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(126): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(130): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(133): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(136): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(139): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(146): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(153): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(154): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(192): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(201): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(204): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(217): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'
D:\Torque\SDK\engine\game\RTS\RTSProjectile.cc(247): error C2248: 'Projectile::mDataBlock' : cannot access private member declared in class 'Projectile'

Cheers!

-Robert

#1
12/03/2005 (3:28 pm)
One may suggest "the RTS comes with 1.3".

That's true, but we have a lot of our code built in to 1.3 that is adversely affected by the deprecated / crippled code in the RTS. We'd simply like to add some of the RTS functions into our 1.3 (soon to be 1.4) code.

Thanks again.

-Robert
#2
12/03/2005 (4:43 pm)
In \engine\game\projectile.h
find this:

//--------------------------------------------------------------------------
/// Base class for all projectiles.
class Projectile : public GameBase
{
   typedef GameBase Parent;
  ProjectileData* mDataBlock;       //MOVE THIS PART HERE

public:
   // Initial conditions
   enum ProjectileConstants {
      SourceIdTimeoutTicks = 7,   // = 231 ms
      DeleteWaitTime       = 500, ///< 500 ms delete timeout (for network transmission delays)
      ExcessVelDirBits     = 7,
      MaxLivingTicks       = 4095,
   };
   enum UpdateMasks {
      BounceMask    = Parent::NextFreeMask,
      ExplosionMask = Parent::NextFreeMask << 1,
      NextFreeMask  = Parent::NextFreeMask << 2
   };
protected:

and move [bold] ProjectileData* mDataBlock;[/bold] to just underneath the last line.

enum UpdateMasks {
      BounceMask    = Parent::NextFreeMask,
      ExplosionMask = Parent::NextFreeMask << 1,
      NextFreeMask  = Parent::NextFreeMask << 2
   };
protected:
ProjectileData* mDataBlock;         //MOVE TO HERE


This may help.
#3
12/03/2005 (5:23 pm)
Bingo. Thanks!

-Robert
#4
01/02/2006 (10:38 pm)
This helped me fix the same error in shapeBase.h
I had to move mSoundThread, the whole Thread struct, and mScriptThread
to the protected section of code.
Then I realized that mScriptThread, had to be declared after the whole thread struct.