Game Development Community

Is it possible to mount more than 4 slots/images on a player?

by Richard Marrevee · in Torque 3D Professional · 07/15/2010 (1:01 pm) · 1 replies

Right now, there is a limitation on the number of slots where you can mount images to a player in T3DB1.1 (max 4). Browsing through the source in shapebase.h you find
MaxMountedImages = 4,            ///< Should be a power of 2
Therefore it would be logical to change this into 8, 16 or so on, but right above this line there is a remark:
// The thread and image limits should not be changed without
      // also changing the ShapeBaseMasks enum values declared
      // further down.
and below it a line:
NumImageBits = 3,

Looking at the ShapeBaseMasks I find the following:
enum ShapeBaseMasks {
      NameMask        = Parent::NextFreeMask,
      DamageMask      = Parent::NextFreeMask << 1,
      NoWarpMask      = Parent::NextFreeMask << 2,
      MountedMask     = Parent::NextFreeMask << 3,
      CloakMask       = Parent::NextFreeMask << 4,
      ShieldMask      = Parent::NextFreeMask << 5,
      InvincibleMask  = Parent::NextFreeMask << 6,
      SkinMask        = Parent::NextFreeMask << 7,
      MeshHiddenMask  = Parent::NextFreeMask << 8,
	  SoundMaskN      = Parent::NextFreeMask << 9,       ///< Extends + MaxSoundThreads bits
// SphyxGames -> Melee
	  ServerIdMask    = Parent::NextFreeMask << 10,
// SphyxGames <- Melee
      ThreadMaskN     = ServerIdMask  << MaxSoundThreads,  ///< Extends + MaxScriptThreads bits
      ImageMaskN      = ThreadMaskN << MaxScriptThreads, ///< Extends + MaxMountedImage bits
      NextFreeMask    = ImageMaskN  << MaxMountedImages
   };

   enum BaseMaskConstants {
      SoundMask      = (SoundMaskN << MaxSoundThreads) - SoundMaskN,
      ThreadMask     = (ThreadMaskN << MaxScriptThreads) - ThreadMaskN,
      ImageMask      = (ImageMaskN << MaxMountedImages) - ImageMaskN
   };

So looking at the ShapeBaseMasks I should be able to change the MaxMountedImages to 8, at least this was wat I thought.

I rebuild the engine and ran it (debug-version) but I get an assert-failure "Invalid net mask bits set." in NetObject::SetMaskBits(..).

I've tried again by changing the NumImageBits to 4, but then I get the same result.

Now I'm pulling my hair out, because I definitly need more than 4 slots to mount.

I know I am missing something, so help is appreciated.
Thanks.

About the author

Started programming in 1984 on an Oric, when time progressed switched to MSX, Amiga and finally the Windows PC with T3D. Now developing an epic fantasy game: The Master's Eye. Creator of the DoorClass pack and VolumetricFog pack @ richardsgamestudio.com


#1
07/15/2010 (3:21 pm)
I guess you have run out of bits.
Try removing some of those you are not using.

Cloak, invincible and shield are usually ok to remove.