Code:
typedef struct MONSTER
{
	var INIT_M;

}MONSTER;

typedef struct HERO
{
	var INIT;

}HERO;

MONSTER* create_enemies()
{
	MONSTER* enemy = malloc(sizeof(MONSTER));
	if(enemy)
	{
		enemy.INIT_M = 14;
		return enemy;//or return &enemy but dont thinks so since its a pointr
	}
	return NULL;
}

int hero_order[3] = {0,1,2};
//if using example a then
int cur_hr = -1;
//if using axample b then uncomment this and comment above
//int cur_hr = 0;

HERO* create_hero()
{
//example A:
//from here->
		HERO* hero = malloc(sizeof(HERO));
        if(hero)
		{
			cur_hr+=1;
			if(cur_hr==0) hero.INIT = 16;
			if(cur_hr==1) hero.INIT = 12;
			if(cur_hr==2) hero.INIT = 15;

			return hero;//or return &hero but dont thinks so since its a pointr
		}
		return NULL;
//to here<-
//---------------------------------------------------
//example B:
//from here->

		/*
		HERO* hero = malloc(sizeof(HERO));
		if(hero)
		{
			int cur_hero_order=hero_order[cur_hr];
			
			switch (cur_hero_order)
			{
				case 0:
					hero.INIT=16;
				break;

				case 1:
					hero.INIT=12;
				break;

				case 2:
					hero.INIT=15;
				break;
			}

			cur_hr+=1;
			return hero;
		}
		return NULL;
		*/
//to here<-
}

//direkte übergabe des pointer an andere HERO pointer

void create_battle_startup()
{
	
	HERO* hero0 = create_hero();
	HERO* hero1 = create_hero();
	HERO* hero2 = create_hero();
	MONSTER* monster0 = create_enemies();
	MONSTER* monster1 = create_enemies();
	MONSTER* monster2 = create_enemies();
	int i=hero1.INIT;
}



its untested i dont have gamestudio installed rite now but hope it helpes you good luck.

Last edited by Wjbender; 04/17/12 17:30.

Compulsive compiler