How do I Create automatic doors?

Get help using Construct 2

Post » Sun Sep 28, 2014 10:10 pm

"distance(player.X, player.Y, door.X, door.Y)" expression works no matter on which side you are.

It would be easier if you post your capx file.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 36,003

Post » Sun Sep 28, 2014 10:16 pm

should be as easy as checking

abs(player.x-door.x) <80

You could use a for each door if you have difficulties with multiple instances

I'm not sure what kind of events you are using to make the doors move, but making it a triggered event or trigger once while true would be best..
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 » Sun Sep 28, 2014 10:35 pm

i copied the expressions from @shinkan into my game and it does not work. i can't post the capx due to NDA but as said, i did EXACTLY what i was supposed to do and it did not work.

i'll try the abs thingy now and see where that takes me though :)

edit: well abs opened the door when i came in from the right, but not from the left so its pretty much exactly the same as simply comparing x :(
B
7
S
2
Posts: 66
Reputation: 720

Post » Sun Sep 28, 2014 10:42 pm

it shouldn't be the same..
So if you could make a screenshot of your events it might become clearer where the flaw is..
This should be pretty simple, you might want to recreate your issue in a simple capx, so we could fix that..
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 » Sun Sep 28, 2014 10:49 pm

but all i do is copy YOUR code into my game. the entire door file has NO OTHER CODE WHATSOEVER!
B
7
S
2
Posts: 66
Reputation: 720

Post » Sun Sep 28, 2014 10:53 pm

OK.. Just TRYING to help.. SORRY..
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 » Sun Sep 28, 2014 10:59 pm

hehe nice.
Come down man, If this simple code do not work for you then it must be a fault on your side. Even if your doors have no events there must be something that prevent this to work properly. If we don't see your event's there's not much we can do to help.
ImageImageImageImage
B
158
S
67
G
43
Posts: 2,603
Reputation: 36,003

Post » Sun Sep 28, 2014 11:01 pm

sorry, didn't mean to be rude, i just said it twice already and it is really frustrating that i can't get this to work.

really, all i do is copy your suggestions into the files. technically you see the events since those are your events but it does not work even remotely close to what it is supposed to do. and i am running out of options...
B
7
S
2
Posts: 66
Reputation: 720

Post » Sun Sep 28, 2014 11:06 pm

You probably have some conflicting events, or the doors have behaviours that arent right, or there is something wrong with the origins or the event sheet isn't connected to the layout, or.... etcetera..

Without seeing your events and/or a capx we'll never know..
The events posted were simple and should work..
Maybe you could create a new capx and try it to see If that works..
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 » Sun Sep 28, 2014 11:08 pm

Message: EzekielRage can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
look, this is the code stripped down to the very basics, insertd into the template platformer:
htt ps://www.drop box.com/s/k81up6yroa zknou/door%20prob lem.capx?dl=0 (modified for plaintext)

i literally copied that from this forum, i don't know why it is so hard to believe that...
B
7
S
2
Posts: 66
Reputation: 720

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests