Getting event to activate a different event?

Discussion in 'RPG Maker VX Ace' started by Tagger101, Nov 7, 2015.

  1. Tagger101

    Tagger101 Veteran Veteran

    Messages:
    30
    Likes Received:
    1
    Location:
    New York
    First Language:
    English
    I've searched for answers on this but none have really worked..

    So, I'm making a minigame where you need to lead a group of sheep into a barn. All I need is for an event to activate when the sheep get close to the barn, Is there any way to do this? 

    I obviously can't use a normal event trigger, as then the player could go to the barn without the sheep and it would still activate. So basically I could even get away with having the game register that the sheep are near you, but i feel that would be harder to work out. 

    Any ideas?
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    28,627
    Likes Received:
    6,574
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    You'll need a parallel process checking the positions of the other events
     
    #2
  3. Tagger101

    Tagger101 Veteran Veteran

    Messages:
    30
    Likes Received:
    1
    Location:
    New York
    First Language:
    English
    Hmm, I honestly never knew you could do that. How would I go about doing that?
     
    #3
  4. Nightshade

    Nightshade Veteran Veteran

    Messages:
    591
    Likes Received:
    120
    First Language:
    English
    Primarily Uses:
    RMMV
    Andars way can work OR you can put a block event and have it so you can not enter the barn only the sheep can by making the sheep transparent to the block that way they can go threw the block into the barn but you can not :)
     
    #4
  5. Tagger101

    Tagger101 Veteran Veteran

    Messages:
    30
    Likes Received:
    1
    Location:
    New York
    First Language:
    English
    I see what you're saying, but that wouldn't matter much, as I still need a way for the game to 'register' where the sheep are so they can trigger an event when they get to a certain spot... 

    Sorry if I'm not explaining it right haha.
     
    #5
  6. 2fruit

    2fruit Lurker Veteran

    Messages:
    39
    Likes Received:
    1
    Location:
    New Zealand
    First Language:
    English
    Parallel process that assigns the coordinates of the events to a variable.

    Then after assigning, a conditional branch that checks these variables and if they meet a certain value etc
     
    #6
  7. Tagger101

    Tagger101 Veteran Veteran

    Messages:
    30
    Likes Received:
    1
    Location:
    New York
    First Language:
    English
    No, I get that, I'm just quite honestly not at all sure how to store event locations in a variable. Never done it before, I see no options for it. 
     
    #7
  8. 2fruit

    2fruit Lurker Veteran

    Messages:
    39
    Likes Received:
    1
    Location:
    New Zealand
    First Language:
    English
    Control Variable

    Make a new variable e.g. SheepX

    Using control variable

    [​IMG]

    but in this case you want to set it to the Event's Map X
     
    #8
    Tagger101 likes this.
  9. Shaz

    Shaz Veteran Veteran

    Messages:
    37,800
    Likes Received:
    11,507
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    If there is a set area where you want all the sheep to be, you could paint it with a region tag (I'll use 1 in the example below).

    Then create a parallel process event that does this:

    Wait 5 Frames (to avoid lag, and we really don't need to do this every frame)Comment: Check where event 1 isControl Variables [001: X] = Event 1's Map XControl Variables [002: Y] = Event 1's Map YGet Location Info: Variable [003: Region] = Region Code on [001: X], [002: Y]Conditional Branch: Variable [003: Region] <> 1 (this is the region code you used) Exit Event ProcessingBranch EndComment: Check where event 2 is(do all the above, but get Event 2's map x and y)...repeat this for each of your sheep events...Comment: If we've reached this point, all the sheep are on the correct regionControl Switches [001: Trigger Event] = ONNow, in a Parallel Process event, Exit Event Processing simply takes you to the bottom of the event command list, and then it starts over from the top.So what the above is doing is looking at your sheep events, one by one. It grabs the x and y coordinates, then checks what region code is on that tile. If it's the special region, it moves on to the next sheep event. If it's not, it skips the rest of the checks and starts over. If all events are on the correct region code, it makes it to the last command, which is to turn on a switch that triggers the event that's been waiting for them. Depending on what that event is, you could just put its commands in your parallel process event (not a fan of having one event turn on a switch, which triggers another event conditioned by that switch and set to autorun). Make sure you add an extra page also conditioned by that switch, so your parallel process event stops running once all the sheep are in.
     
    #9
    Tagger101 likes this.
  10. DoctorQ

    DoctorQ Villager Member

    Messages:
    24
    Likes Received:
    24
    First Language:
    english
    I just make Event 2 have two tabs, the second one set to activate and auto-run when a global variable is turned on. Then I have event 1 turn on the global variable. Remember to have Event 2 set a local variable to turn it off!
     
    #10
  11. Tagger101

    Tagger101 Veteran Veteran

    Messages:
    30
    Likes Received:
    1
    Location:
    New York
    First Language:
    English
    Thanks everyone for the suggestions! 

    Ended up working out perfectly the way Shaz explained, thank you.
     
    #11

Share This Page