Controlling self switches from common events

Discussion in 'RPG Maker VX Ace' started by Llov11, Aug 21, 2018.

  1. Llov11

    Llov11 Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Buenos Aires, Argentina
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Hello friends! I didn't find any information about this in the forum. I guess my question is if it's possible to control the state of a self switch of an event via common events. Maybe it involves some scripting, if that is the case I would really appreciate if you could help me out!

    Thank you so much and sorry for my english.
     
    #1
  2. Engr. Adiktuzmiko

    Engr. Adiktuzmiko Chemical Engineer, Game Developer, Using BlinkBoy' Veteran

    Messages:
    14,536
    Likes Received:
    2,891
    Location:
    Philippines
    First Language:
    Tagalog
    $game_self_switches[[mapid,eventid,switch]]

    so like of you want to modify the self switch A of event 1 in map 1

    Code:
    $game_self_switches[[1,1,"A"]]=true/false
     
    #2
    Llov11 and 2098-Face like this.
  3. Llov11

    Llov11 Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Buenos Aires, Argentina
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Thank you so much for your answer! It's exactly what I needed!

    Kudos for you my friend.
     
    #3
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,706
    Likes Received:
    11,411
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    How are you calling your common event? If it is a parallel process or autorun event, conditioned by a switch, you will have to use the above method. You will also have to use that method if the common event is attached to an item or skill, and is run when the item or skill is used in battle or from the menu.

    However, if you are calling it directly from an event, using the Common Event command, it just becomes an extension to the event that calls it, and you can use the Control Self Switch command, and it will change the self switches on the event that did the calling.
     
    #4
    Llov11 likes this.
  5. Llov11

    Llov11 Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Buenos Aires, Argentina
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Hi! It's attached to an ítem. I'm trying to implement a portal gun, like the game Portal. Whenever the portal gun (which is associated with a button) is fired, it calls a common event. So this method works like a charm.

    Thank you for your help!
     
    #5
    Shaz likes this.
  6. Llov11

    Llov11 Villager Member

    Messages:
    12
    Likes Received:
    1
    Location:
    Buenos Aires, Argentina
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Hello! Sorry to bother you again. I'm not sure this is the right place to ask something else. Maybe I should make another thread, but since it's related to the concept of the portal gun before mentioned I thought maybe it's not so off topic.

    Is there a way to make a conditional branch that checks wether or not THIS event is in a given region? I'm guessing there has to be a way to store the position of the event in a variable and check the region ID that such position has. I have the feeling that i'm missing a little script call to do so.

    I would really appreciate your help!

    [EDIT]: Don't worry I posted another thread. Thank you!
     
    Last edited: Aug 23, 2018
    #6
  7. Shaz

    Shaz Veteran Veteran

    Messages:
    37,706
    Likes Received:
    11,411
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    yeah, it might be related to the portal gun, but it's not related to changing self switches, so another thread is the go :)
     
    #7
  8. CynicSyndrome

    CynicSyndrome Veteran Veteran

    Messages:
    50
    Likes Received:
    30
    First Language:
    English
    Primarily Uses:
    RMMV

    I just finished my own completely evented portal gun and wondered if you ever finished yours. I never thought to govern placement by region. I went with ◆If:Script:$gameMap.isPassable(x, y, d) && $gamePlayer.canPass(x, y, d)
     
    #8
  9. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,367
    Likes Received:
    4,934
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Yeah, but the solution you posted is for RMMV, not VXA. Besides, it's an old question.
     
    #9
  10. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,766
    Likes Received:
    10,579
    First Language:
    English
    Primarily Uses:
    RMVXA

    CynicSyndrome, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.




    Closing

     
    #10

Share This Page