Jump to content
Sign in to follow this  
Chickan 117

Help? Using an event to trigger another event

Recommended Posts

I have a fairly simple (I think) requirement. I wish to be able to move an item onto another item and have it trigger.

 

First I have the boulder which is set as the same height as the player and executes the following when the action button is pressed

Set Move Route: This event(Wait): $>Through ON: $>Move away 
from Player: $>Through OFF

The through had to be turned on so it would pass "onto" the switch.

 

Next I set up a button. I used one of the floor button icons from Graphics > Switch1, set it to below characters and marked the trigger as "event touch". On event touch I got it to set it's self switch A on then just created a blank page (so I could see it disappear under the boulder)

 

I wasn't sure if the event trigger would work like that as I'm not 100% sure how it works. Anyway, using this method all I get is this



 

 

Can anyone help me out with what I'm doing wrong or a better way to achieve my goal?

Share this post


Link to post
Share on other sites
$game_map.events[2].x == $game_map.events[@event_id].x and 
$game_map.events[2].y == $game_map.events[@event_id].y

 

replace the 2 with the event ID of your boulder and slap that into the switch as a script conditional branch (can fit on one line) for having the switch pressed. 

 

also, you don't want "through" on.  The boulder will be able to pass through anything.  Not just the switch.  You should, instead, put the switch as "below character" in priority.  Heck, you can put the switch as "through" instead of the boulder since it doesn't move.

Share this post


Link to post
Share on other sites

I was also wondering that, thank you for the answer Crossroads. While you're there, how would I set up the event if I wanted the switch to revert back to it's original position once the boulder is off of it?

Share this post


Link to post
Share on other sites
$game_map.events[2].x == $game_map.events[@event_id].x and 
$game_map.events[2].y == $game_map.events[@event_id].y

 

replace the 2 with the event ID of your boulder and slap that into the switch as a script conditional branch (can fit on one line) for having the switch pressed. 

 

also, you don't want "through" on.  The boulder will be able to pass through anything.  Not just the switch.  You should, instead, put the switch as "below character" in priority.  Heck, you can put the switch as "through" instead of the boulder since it doesn't move.

 

Ahhh thank you very much :) After getting a similar answer from rmrk.net I'd setup the following. I think yours looks a little neater though and doesn't tie up two variables. Makes it easier to setup mul;tiple boulders/buttons without complex nesting for the various combinations too. :D

 

XxRDmYR.png

 

@Folos - Just put something in the "Else" portion of the branch so that, when the conditions aren't met, the switch deactivates.

Share this post


Link to post
Share on other sites

Sorry but one quick question as I'm getting an error. 

 

This is what my event looks like now

 

Note : The conditional branch is set to script and has the following text

 

$game_map.events[6].x == $game_map.events[5].x and $game_map.events[6].y == $game_map.events[5].y

 

The boulder is event 6 and the switch is event 5

 

yTWAEWa.png

 

My problem is that, when the boulder is on the switch... nothing happens. 

 

Actually I just had a thought. Might try seperating the two conditions...



Nope. Stripped the condition back to just 

 

$game_map.events[6].x == $game_map.events[5].x

 

but it still didn't work so I tried

 

 

$game_map.events[6].x == 6

Have I used the correct syntax?

Share this post


Link to post
Share on other sites

First, what are you trying to make happen?

 

Right now you're turning on another events Self-Switch in your conditions. If that's not tied to anything, it won't make anything happen.

 

You can also try:

get_character(6).x

 

I prefer that over the

 

$game_map.events[6].x

 

But if I read you correctly you can also do:

 

get_character(0).x instead since 0 is "This Event"

Edited by Titanhex

Share this post


Link to post
Share on other sites

you don't need to change the @event_id part since the conditional should be inside the switch or boulder.  just add the event id of the one you want to compare to.  The @event_id will fill in the correct ID for you.  I have a whole room full of these with conditionals nested so that any of seven boulders can roll over any of 5 switches and they all have the same effect without using any variables, etc.  Once you make one, you just copy paste and it works for all.

 

*also, it looks like you're setting the switch to false with either condition in your screenshot.

Share this post


Link to post
Share on other sites

Thanks again for the quick response.

 

Turning on another events switch is purely to activate a visual thing on screen so I know the condition has triggered (e.g. makes a fountain appear in this case).

 

Right now all I want is to be able to do this when the boulder event is placed "on top of" the switch event. I'm trying to find the most efficient way of doing this and your method is looking great if I can get it to work.

 

Eventually what I will want to get to is a map where there are three boulders and three switches. Places 3 boulders on the three switches will open the door and allow you to progress to the next room. That's easy enough to set as I can just make each switch run parallel and check

 

Is boulder 1 in the same spot as me?
Is boulder 2 in the same spot as me?

Is boulder 3 in the same spot as me?

 

Then have the door check all three switches.

 

But I'm digressing. What I'm trying to do right now is setup a conditional branch that checks to see whether event 5 is at the same X, Y coordinates of event 6 and, if so, turn on switch A for event 2



@Crossroads. Thanks. I'll give that a shot now. The double false was an error on my part. Lol. Screen dumped the before shot not the tested "after" shot. :)

Share this post


Link to post
Share on other sites

@Crossroads. That worked perfectly. Thank you. 

 

Nested two inside and bammo. I can now activate separate switches :D :D :D 

 

I am so happy right now!

Edited by Chickan 117

Share this post


Link to post
Share on other sites

If anyone else is interested this is how I did it.

 

Create the switch event with the trigger set to parallel

Create a conditional branch with the following script condition

$game_map.events[@event_id].x == $game_map.events[6].x and $game_map.events[@event_id].y == $game_map.events[6].y

 

Where 6 is the event number of the first boulder

Under Else create another conditional branch with the following script condition

$game_map.events[@event_id].x == $game_map.events[1].x and $game_map.events[@event_id].y == $game_map.events[1].y

 

Where 1 is the event number of the second boulder

Then, I called the following script for the true condition

$game_self_switches[[19, 2, 'A']] = true

 

and this for the "Else" in the second conditional branch

$game_self_switches[[19, 2, 'A']] = false

 

 

Then I just duplicated this switch and changed the event number in the game_self_switches calls.

 

Here's the vid of it working with two boulders but it could easily be used for as many as you like

 

 

Thanks so much for the help. I really appreciate it.



Is there a way I can modify the original topic to mark it as "resolved"?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×