I always use like skill1 for EntityNum, a specific unique ID when that entity is created, after that, you can use that EntityNum to do what ever you want.

I create a structure, I usually call it like Skills and just make it array size of Max entities I will ever have in game, and can free up EntityNum's when units are killed, etc. But using a unique EntityNum you can basically created as many skills and types as you like in a structure format. I realize its not pretty, but very effective.

Example:

#define MAX_ENTITIES 50000

typedef struct _SKILLS
{
ENTITY* pEnemy[100];

// just some examples stuff of variable types you can add to Skills structure
ENTITY* pWeapon; // pointer to unit's weapon
var FlyByHeight;
var CruiseHeight;
var LastWingAngTiltAdj;
var bCanStrafe;
var aircraftStallRoll;
var HoverAngle;
ANGLE vHoverAngle; // hovering anjust angle to make sway while hovering
var bTakingOff; // aircraft taking off?
var bLanding; // aircraft landing?
var DistanceToGround; // current distance to ground
var bTracedTerrain; // was terrain traced when checking distance to ground?
VECTOR vTerrainNormal; // what was the normal of the terrain on the trace to ground


} SKILLS;

static SKILLS Skills[MAX_ENTITIES]; // Skills structure


So after this you can basically have infinite skills of any variable type you like (including arrays).

Now to set pointer to first enemy in list you just:

Skills[my.EntityNum].pEnemy[0] = you;

To retrieve a entitiy # x from enemy list you:

ENTITY* pEnt;
x = 50; // let's get my enemy # 50
pEnt = Skills[my.EntityNum].pEnemy[x];

Simple and effective way to basically create more skills of whatever variable type you want (and can make arrays inside the structure), as long as you give each Entity it's own unique EntityNum.

In a games like the one I am working on where we exhausted the 100 skills long ago per entity, creating a unique ID for each entity and then using a structure, especailly with arrays is a godsend. With our multiplayer game we general save the actual 3DGS Skills for variables being sent over multiplayer, and put local skills into the structure skills.

Later,
Loco


Professional A8.30
Spoils of War - East Coast Games