Greetings all! I've started working with gamestudio again a few days ago after a many year hiatus.
I'm working on a project and progress has been steady, but i've run into a problem which my limited knowledge can't find a solution for.
I want to store a pointer to a struct in an entity's skill31, so that i can store a unique copy of that struct for each entity.
This is my first time i've used structs or things like malloc, so i'm probably doing it horribly wrong.
I tried something like this:
#define TESTSKILL skill31
typedef struct
{
var x;
var y;
var z;
}NODE;
ENTITY* tester;
function test(ENTITY* ent)
{
if(ent.TESTSKILL==-1)
{
ent.TESTSKILL = (NODE*) malloc (sizeof(NODE));
ent.TESTSKILL->x =3;
beep();
}
}
action test_ent()
{
my.TESTSKILL=-1;
tester =my;
test(my);
}
but that didn't work, so can anyone tell me the correct way to achieve this? Any help would be much appreciated
