hello datura. You are absolutly correct.
I have isolated, and found a way to recreate my bug, although it is different than the minus 5 health in my first post, but same in dealing with skills. Here is the scenario:
In my game, whenever an AI gets scanned by another entity, the scanned AI is able to "read" that entity's information. So for example, an AI is standing still guarding an area, and an incoming rocket explodes next to him. The Rocket entity is using a skill called "Shell_ID", which was defined as:
define Shell_ID,skill99; // A skill defined only for the Rocket class
define Shell_Power,skill100; // a skill to determine how strong the shell is
The AI's themselves use their own ID storage in their own skill:
define Unit_ID,skill100; //
IF the AI begins asking what the Unit_ID of the rocket is, the AI will get the rocket's shell power, instead of a unit ID. Because Unit_ID and Shell_Power are both defined as skill 100, the 100th skill will be queried if either shell_power or unit_id is asked for.
Although that is not the best example, what this means is that you can have as many different 1-100 skill defines as you want. For entities that do not transmit their skills, nor ask for other entities skills, you can make as many skills as you want. For example, for a cloud entity, that floats by itself without any direct influence of other entity's skills, you can have this:
define Cloud_type,skill1; // give the cloud class their own skills
define Cloud_size,skill2;
define Soldier_Health,skill1; // You can give the soldier class the same skills
define Soldier_Armor,skill2;
Because the soldier entity never has to ask the cloud entity about it skills, you can define the skill names using the same skill numbers.
HOWEVER, for entities that will need to query another entity's skill, the skills will need to have their own skill number.