Action after arrived

0 favourites
  • 6 posts
From the Asset Store
Alot of High Quality Items sound effects for your game!
  • Hey guys, let me just apologize in advance in the case that a similar forum thread exists - unfortunately I have not been able to find it.

    My friend and me are making a horror adventure demo in Construct and got stuck on "action after arrived" programming. Let me explain what I mean by that.

    We have successfully implemented 8-way character movement and animations while moving in our rooms (e.g. layouts). Now we have a small problem with getting the right event order for our character to change rooms.

    We would like to be able to perform this:

    1. if mouse (left click) on door (sprite)

    2. character walks to door

    3. character changes room (e.g. layout)

    The movement and the layout change work fine on their own but I can�t seem to get the system to wait for the player to arrive at the door before the system goes to the other layout.

    I have tried setting another condition that would wait for the player to arrive (path-finding - on arrived) but Construct wont let me combine it with the mouse� left-click on door because of triggering issues.

    Any help on this would be much appreciated. Let me know if you need any screenshots or more info.

    <img src="http://oi61.tinypic.com/2drwbyq.jpg" border="0" />

  • ...any ideas guys?

  • Seems like you are using pathfinding to move to the door.

    Isn't there an on arrived trigger for pathfinding?

    You could also use an on collision with door trigger, or is overlapping.

    Or you could use a distance check to see if the player is close enough to the door.

    so on left click - find path,

    on path found - move

    on colision with door - switch layout

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey LittleStain,

    that was my initial try. The problem is that I need to combine both conditions to change the layout. Overlapping by itself could happen even without giving the command to change rooms (click on Door sprite).

    Do you think that maybe global variables could help? E.g. if click on door (variable changes value to true) and then combine the overlapping with the variable check?

    Ill try that right away :)

  • You could give the player a boolean, dooropen, and set it to true on door clicked, and check for that in a condition.

  • Thank you for the idea LittleStain,

    the combination of global variable + overlapping works like a charm :)

    <img src="http://oi61.tinypic.com/v7d01u.jpg" border="0" />

    I am pretty happy with it, maybe it?s not the most elegant solution, but it works :)

    Thanks again

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)