How do I make a input-output in game mecanism

Get help using Construct 2

Post » Tue Dec 15, 2015 1:43 pm

I've made some code that should open a door if a button is activated, depending on both's IDs.
Here is the code:

Image

However, the code doesn't work as expected...

In fact, it waits till all the lower IDs are activated to activate higher ones. Also, for the rotating doors, the door work randomly. Sometimes it does, sometimes, it doesn't.
Image
B
34
S
6
G
2
Posts: 224
Reputation: 3,355

Post » Tue Dec 15, 2015 4:26 pm

Can you post a .capx file so that we will know what is the door made of to open or rotate. It will be a lot easier.

And I think the event can be shorten once we know what it is.
The Things you can create is only limited by your imagination. If you don't have the skills then use your motivation as a natural force to exceed all expectations. Chadori RebornXD
B
64
S
18
G
90
Posts: 1,118
Reputation: 59,565

Post » Tue Dec 15, 2015 9:33 pm

If those are global events they will be on permanent repeat constantly checking, so each event will trigger when you change the value.
https://www.ravenheart.ca/home
Company name changed to avoid Facebook-type shenanigans

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
22
S
6
G
1
Posts: 1,415
Reputation: 4,824

Post » Tue Dec 15, 2015 9:54 pm

@skymen
Yes. In Construct all the subevents work at the same time. Not in order you put them.

You should use "else" statement or "trigger only once" to get rid of the loop.
B
7
S
2
Posts: 68
Reputation: 645

Post » Wed Dec 16, 2015 3:40 pm

Didn't want to put a .capx file as there is a lot more code than just this, and it could have been disorentating. However here it is.

(add in https)://mega.nz/#!l901XITC!-X0nNVQqgELUXHseqkmHBNAZ1nfeL9RlTqZwBfTueMU

tavi wrote:@skymen
Yes. In Construct all the subevents work at the same time. Not in order you put them.

You should use "else" statement or "trigger only once" to get rid of the loop.


What do you mean by this?
This should not change a thing as each door has an ID set in a variable, and each button also has an ID. So when the button's ID is equal to the door's ID, and if the button is activated, it should open the door.
Anyway, I'll try adding a "Trigger once while true" condition to see if it works.
Image
B
34
S
6
G
2
Posts: 224
Reputation: 3,355


Return to How do I....?

Who is online

Users browsing this forum: blackhornet, unxcellent and 9 guests