Pushing an object to trigger a trap

● ARCHIVED · READ-ONLY
Started by Sodium89 2 posts View original ↗
  1. I didn't actually want to make this thread. I was looking for a way to make the playable character push an object so that it triggers a trap and clears the path. I evented that before but I couldn't find that project among the sea of many many files in my computer. So I wanted to ask for help. I didn't even tap on create thread but it just happened idk how. I found the project later and i have been told to post the solution. so here it is-

    1. The object can get stuck i.e it won't be possible to push it further. So I just added region ids to the edge of the map in front of the walls or any obstacles and checked with a condition whether the object was in that region id.
    ◆Control Variables:#0007 event x = Map X of EV013
    ◆Control Variables:#0008 event y = Map Y of EV013
    ◆Get Location Info:event location, Region ID, ({event x},{event y})
    Then to check whether it's stuck i did this:
    ◆If:event location = 4
    (set move route player moves 1 step backward, event moves toward player)

    2. Give the area in front of the trap (both object and trap are events. object can't truly move across event) a different region id.
    Then check:
    ◆If:event location = 3
    (set a switch on that opens another page on the trap event. So that the trap is set to off and the player doesn't get hurt when they trigger it. )
    Well, that's all I can make out of the events. Honesty it's been so long I can't even remember which switch does what.
    Of course there are more stuff that happens if the conditions aren't met but I guess that depends on your game :/ Mine was too complex to set up. there were multiple condition branches and branches inside those branches and whatever. It was a complete mess lol. Anyways, I'm not sure anyone will need this but posting it anyways.
  2. I strongly suggest to write the question back and post as a reply the solution, so others might benefit from it. That is the meaning of the forum, not deleting a thread just like that. :) After posting the solution, please report it (telling us to close the thread as solved).