...solution is at bottom of post...
G'day guys. (my very first question)
I'm sure this is just a noob issue. I've looked in "[How do I]Frequently asked questions" but don't see anything that appears to have my resolution.
I have had some issues understanding the 'tree' in the Events page. I did google for that too but didn't get the explination I was looking for.
I managed to work out plenty of other stuff from google and looking at some example projects. I'm sure this will make perfect sense to me too once it's pointed out.
Trying to: Trigger actions based on two conditions. (keyboard) + an instance variable. (checked in properties and in debug mode the variable is correct)
Screen shot:
[attachment=1:2rasnq1f][/attachment:2rasnq1f]
Now if this were code I'd expect this to work:
// Yes I just made things up but i'm sure you'll get the idea.
if ((keyboard.keypressed == space_key) AND (Player.CanShoot == "YES")){
Player.State = "Shoot";
spawn (ShootBullet);
ShootBullet.angle = 270;
// (and so on)
}
[/code:2rasnq1f]
...or to just put one IF inside the other.
So what am I Noobing up?
last note: I intentionally used a text variable instead of a boolean.
Thanks in advance :*
[b]SOLUTION:[/b]
C2 is a bit inconsistent on this: it's because you put quotes around YES in your default CanShoot instance variable (although you didn't for the State=Normal case).
[attachment=0:2rasnq1f][/attachment:2rasnq1f]
Removing the quotes from the instance variable of the object resolved the issue.
Keep the quotes in the conditions of the events sheet
#2 in the first image posted now functions.