If you design one struct to contain
all the information an
"intelligent' entity needs you only need to use One of its
100 available skills to store a pointer to that struct.
The struct can contain all the Strings and descriptions you
could need.
Dumb entities (boxes, pickups can have a different struct in that
same skill slot that can store all the info IT need to decide if the
entity interacting with it is allowed to - and how.
For Example
Let SMARTY contains a single 'CHAR PlayerType;' which is unique
for each of your 'charactrs'. Lets call "Jason" is a type '1'.
typedef struct {
STRING* DisplayName;
CHAR PlayerType;
...
} SMARTY;
ENTITY* Jason;
void CreateJason()
{
Jason = ent_create("Jason.mdl", vector(0,0,0), NULL);
SMARTY JasonData;
// Load Data from data files here maybe?
JasonData.DisplayName = str_create("Jason VorHees");
JasonData.PlayerType = "1";
//
// Store Struct in entity
Jason.skill99 = JasonData;
}
Now we let DumbStruct contain a string of PlayerTypes that are allowed
to interact with this entity.
typedef struct {
STRING* ObjectDisplayName;
STRING* AllowedPlayerTypes;
...
} BOXES;
ENTITY* TreasureBox[100};
void CreateTreasureBox( var Index )
{
TreasureBox[Index] = ent_create("Chest.mdl", vector(0,0,0), NULL);
BOXES BoxData;
// Load Data from data files here too maybe?
BoxData.ObjectDisplayName = str_create("Rusty Iron Chest");
BoxData.AllowedPlayerTypes = str_create("185Q");
// THIS box allows types 1,8,5, and Q types in.
//
// Store Struct in entity
TreasureBox[Index].skill99 = BoxData;
}
Do you see what I mean?