I've read this several times, but still not quite certain, if you want to access struct's member inside a function, or pass struct's value into a function as parameter?
Because if latter, it's done as:
Code: ags
and then called like:
Code: ags
EDIT: What puzzles me in this question is the purpose of this function. As the function is called "melee_combat", it seems like there's no need to know the damage type, as it is defined by the function itself.
Because if latter, it's done as:
function melee_combat(int dmg_value) { // here the function receives a damage value from any source
....
citizens[2].hp -= dmg_value;
cEnemy.SayBackground(String.Format("-%d", dmg_value));
....
}
and then called like:
melee_combat( citizens[0].melee_dmg ); // here you pass a value of citizens[0].melee_dmg into the function
EDIT: What puzzles me in this question is the purpose of this function. As the function is called "melee_combat", it seems like there's no need to know the damage type, as it is defined by the function itself.