How do I click cupboard

Get help using Construct 2

Post » Tue May 19, 2015 5:39 pm

Hello guys I was just wondering how do I make a cupboard? What I was trying to make is when you right click the cupboard it opens and then the object Coat spawn is it. Then you can right click the coat once the cup board is open and put it on your self (image point). But when I right click on the cupboard it spawns another coat inside it?

I'm also confused on how do I make so that I can close the cupboard and the item wont spawn there again as It already been looted.. Here is what I did:
Image
Image

Thank you for attention!
B
8
S
3
Posts: 120
Reputation: 989

Post » Tue May 19, 2015 6:06 pm

While right-clicking on armycoat, you are also rightclicking on the cupboard, so you should add a condition to the first event to prevent it from running when you only want the second event to run..

adding a is animation cupboardopenempty not playing, should do the trick..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue May 19, 2015 7:55 pm

Ahh thanks! It was pretty easy :D Too much construct 2 I guess ...

EDIT* But If I want it to close on the right click how do i prevent spawning the coat after when I open it again?
B
8
S
3
Posts: 120
Reputation: 989

Post » Tue May 19, 2015 8:17 pm

Something like this should work:

Give the cupboard a boolean-instance variable CoatTaken.

add set boolean to yes when taking coat..

add a subevent to the cupboard rightclick event
cupboard is not Coattaken- spawn coat
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue May 19, 2015 10:15 pm

@LittleStain I did a better cupboad so now it opens and closes but I didnt understood what you mean by the veribles where you place them sorry... :(

But here is what I got so far
Image

capx .upload.ee/files/4733095/cupboard_example.capx.html
maybe it's easier that way? Thank you!
B
8
S
3
Posts: 120
Reputation: 989

Post » Tue May 19, 2015 11:23 pm

Here:

https://dl.dropboxusercontent.com/u/485 ... roved.capx

you can now open and close the cupboard with the coat still in it and open and close it after the coat is taken out..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue May 19, 2015 11:45 pm

Thank you for explaining! I got it now :)
B
8
S
3
Posts: 120
Reputation: 989


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider], jbr190, plinkie, TRMG and 35 guests