A skill is a variable that is similar to a local variable. However, instead of being specific to a function, it is specific to an entity. So if you want an entity to have a certain parameter, unique to that entity, you use a skill.

For example, .skill11 could be health. You could have player.skill11 = 100; and this won't effect enemy.skill11.

Skills can also be defined, as has already been stated to improve readability. #define health skill1

Skills can also be vectors. If skill3 is used as a vector, than skill4 and skill5 take the y and z components automatically (so take care when you use a skill as a vector, to not do anything with the two consecutive skills).

Skills are accessed by the entity[dot]property method such as player.health = 100; or you.speed = 75;

Last, a skill can also hold two numbers like this:

my.ammo = 100.25;

integer(my.ammo) = numOfBullets; //take the integer of my.ammo, assign that to numOfBullets
frx(my.ammo) = numOfClips; //take the fraction of my.ammo, assign that to numOfClips

what this does, is it holds two values in one spot (this is useful if you exceed the number of skills.) In this example, we have 100 bullets and 25 clips.

You can do this trick with any variable by the way, but since you can run out of skills, this trick is usually seen with skills.


Last edited by heinekenbottle; 02/04/09 18:48.

I was once Anonymous_Alcoholic.

Code Breakpoint;