Change boolean not working...

Get help using Construct 2

Post » Wed Dec 24, 2014 1:12 am

I'm having problems with an object.

Object is berry bush
Berry bush has a boolean called "Berry" set to false.
False = Frame 0
True = Frame 1

If "Berry" is false, wait 5 seconds and set "Berry" to true.
Left mouse click on Berry bush while player is overlapping sets "Berry" to false.

The initial "Wait 5 seconds set to true" is fine. After i left click the bush, sometimes the frame will flash from Frame 0 back to Frame 1 in less than 1 second. Sometimes it will wait 2 to 3 seconds. Rarely does it wait the 5 seconds like I have set in the events. Any ideas?
B
7
S
1
Posts: 57
Reputation: 728

Post » Wed Dec 24, 2014 1:17 am

Even in debug mode i can see the variable flash from 1 to 0 then back to 1 on the left click.
B
7
S
1
Posts: 57
Reputation: 728

Post » Wed Dec 24, 2014 1:22 am

It could be one of many things, but we can't help without a capx....
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,188

Post » Wed Dec 24, 2014 1:24 am

Here
You do not have the required permissions to view the files attached to this post.
B
7
S
1
Posts: 57
Reputation: 728

Post » Wed Dec 24, 2014 1:44 am

jweickum wrote:
Object is berry bush
Berry bush has a boolean called "Berry" set to false.
False = Frame 0
True = Frame 1


You need a Trigger event for "Wait" to work properly.

and one more tip for you.
Berry boolean can be only either 0 or 1. And if your BerryBush have only 2 animation frames that represent Berry boolean state you can do something like that.

On something: BerryBush: Set animation frame to self.Berry

this will always set your animation to Berry boolean state.
ImageImageImageImage
B
157
S
64
G
41
Posts: 2,590
Reputation: 34,640

Post » Wed Dec 24, 2014 2:51 am

shinkan wrote:
jweickum wrote:
Object is berry bush
Berry bush has a boolean called "Berry" set to false.
False = Frame 0
True = Frame 1


You need a Trigger event for "Wait" to work properly.

and one more tip for you.
Berry boolean can be only either 0 or 1. And if your BerryBush have only 2 animation frames that represent Berry boolean state you can do something like that.

On something: BerryBush: Set animation frame to self.Berry

this will always set your animation to Berry boolean state.


I switched it to its own event.
BerryBush = Frame 0 -----Wait 5 seconds, Set berry to true.

Still nothing happens. Am i misunderstanding what you mean?
B
7
S
1
Posts: 57
Reputation: 728

Post » Wed Dec 24, 2014 2:56 am

Try
+BerryBush = Frame 0
+Trigger once -> Wait 5 seconds, Set berry to true.
ImageImageImageImage
B
157
S
64
G
41
Posts: 2,590
Reputation: 34,640

Post » Wed Dec 24, 2014 9:15 pm

Solved, Thanks guys!
B
7
S
1
Posts: 57
Reputation: 728


Return to How do I....?

Who is online

Users browsing this forum: ketramtu18, Yahoo [Bot] and 8 guests