RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[VXA] Help? Using an event to trigger another event [Resolved]

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 58
in training
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

Code: [Select]
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

http://www.youtube.com/watch?v=0hOmOvnZbF0&feature=youtube_gdata



Can anyone help me out with what I'm doing wrong or a better way to achieve my goal?
« Last Edit: February 06, 2013, 06:46:05 AM by Chickan117 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Well, event touch events only activate when the event touches the player, not when it touches another event (the difference between it and player touch is that player touch events don't activate when the event moves into the player, only when the player moves into the event).

One way you could achieve the desired effect is put a conditional branch after the move event and check whether the boulder is on the switch square.

Ie, assuming the switch is at 12, 8, then like this:

Code: [Select]
@>Control Variables[0000: Boulder X] = This event's Map X
@>Control Variables[0000: Boulder Y] = This event's Map Y
@>Conditional Branch: Variable [0000: Boulder X] == 12
  @>Conditional Branch: Variable [0000: Boulder Y] == 8
    # Activate the switch
    : Branch End
 : Branch End

Naturally, replace the 12 and 8 with the actual x and y coordinates of the switch event.

**
Rep:
Level 58
in training
Thanks so much for the help. I hadn't realised the difference between event touch and player touch so that's great to know.

Also thanks for the logic with the other too. I setup my boulder with the following new lines:

Code: [Select]
Control Variables: [0023:BoulderX] = This event's Map X
Control Variables: [0024:BoulderY] = This event's Map Y

Conditional Branch: Variable [0023:BoulderX] == 6
  Conditional Branch : Variable [0023:BoulderY] == 5
    Script: $game_self_switches[[19, 2, 'A']] = true
  Branch End
Branch End[/code]

Then set the switch up as ....

ahh I'm an idiot. I used the Variable 23 twice in the branch instead of individual for X and Y.

Pity you have to assign a variable for it although I guess I could initialise it on entrance to the map and then reuse it later.

In any case that works perfectly. Thank you very much :D

**
Rep:
Level 58
in training
Got it working even better courtesy of some advice from crossroads at the RPGMVXA Community site.

http://www.youtube.com/watch?v=GafgyGr671U&feature=youtube_gdata

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

Code: [Select]
$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

Code: [Select]
$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

Code: [Select]
$game_self_switches[[19, 2, 'A']] = true

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

Code: [Select]
$game_self_switches[[19, 2, 'A']] = false

Then I just duplicated this switch and changed the event number in the game_self_switches calls (so each switch activates something different). You could also set a variable I guess and have an activated switch increment a counter by 1 whilst a deactivated decreases it. That way you could have another event, like a door, open when the cvariable reaches a certain value (i.e.e the number of switches)