System will not change instance variable

Get help using Construct 2

Post » Thu Mar 05, 2015 4:46 pm

Hello. The system will check for four conditions and make changes when those are met. It is correctly making changes for two of the conditions, but not for the other two. By using a text box, I have made sure the conditions are met, but still no changes. If i change the condition in the start of layout, the appropriate changes are made, but not afterwards.

Any clues to what is going wrong?


Thanks in advance.
You do not have the required permissions to view the files attached to this post.
Last edited by edescamps on Thu Mar 05, 2015 5:38 pm, edited 1 time in total.
B
6
S
1
Posts: 18
Reputation: 386

Post » Thu Mar 05, 2015 5:35 pm

Posting a capx is better.
B
45
S
16
G
9
Posts: 1,096
Reputation: 11,138

Post » Thu Mar 05, 2015 5:37 pm

Here is the CAPX.
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 18
Reputation: 386

Post » Thu Mar 05, 2015 6:29 pm

I fixed it. Ended up changing conditions for Enemy.Bullet.AngleOfMotion = 0 and Enemy.Bullet.AngleOfMotion = -90 to having a double condition checking if it is grater that -20 and less than 20 for the 0 case and grater than -110 and less than -70 for the -90 case. If anyone figures out why it does not work with the "=" case, please let me know as it is a simpler solution.
B
6
S
1
Posts: 18
Reputation: 386

Post » Thu Mar 05, 2015 10:23 pm

@edescamps

I was going to reply earlier but work got busy so you found a fix before I could get back to it. However, I am attaching a modified version of you project anyway. I think you might find it useful. This version cuts down your event system substantially. I modified the player direction to be a number like the enemy direction variable and added a state variable to each. With that, setting animations and the direction of the boomerang takes far fewer events. Take a look and see what you think.

I hope this is of use to you and good luck with your project.
You do not have the required permissions to view the files attached to this post.
B
38
S
12
G
11
Posts: 329
Reputation: 7,708

Post » Thu Mar 05, 2015 11:13 pm

Awesome! Thanks Frag.
B
6
S
1
Posts: 18
Reputation: 386


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Yahoo [Bot] and 1 guest