Howdy folks. I'm working on a game using Game Maker 7. Part of the gameplay involves units moving across the screen from opposite sides and fighting when they meet in the middle.
Each set of units (sides) has a parent (obj_human_parent and obj_undead_parent). All other units are children of these two. All units have the following variables, defined in the Create Event:
uHealth = 1;
uMoveSpeed = 1;
uAttackPower = 1;
uAttackDelay = 0;
uAttackDelayMax = 30;
uDefense = 1;
The above variables are for the undead units. Human units have humVariable to differentiate them. The values given are arbitrary.
The way I have it set up, in the Step event of the each parent, I have a collision check with the parent of the other side. If there is a collision, uAttackDelay is set to -=1 unless uAttackDelay < 1, at which point it is set to uAttackDelayMax, and I use a set variable action to reduce the other unit's health by uAttackPower.
When I run the game, however, when two units come into contact with each other, I get an error saying that 'uAttackPower' is an unknown variable. I've checked the spelling, I've tried specifying self.uAttackPower in the action, all to no avail.
Anyone have any idea what the problem might be?