Script call for region ID?

Discussion in 'RGSSx Script Support' started by Oddball, Sep 21, 2019.

  1. Oddball

    Oddball Veteran Veteran

    Messages:
    1,667
    Likes Received:
    445
    First Language:
    English
    Primarily Uses:
    N/A
    Not sure if this is the right place to put this, but was wondering if there was a script call to make an event change it's behavior based on what reigion it's in. Not looking for a script, just want to do this purley through eventing

    Like for example, you use reigon 1 for open ground, 2 for a tree, and 3 for around a building. A squirrel would run up the tree when in reigon 2, and then bury a nut in region 1
     
    #1
  2. Thefirelion

    Thefirelion Veteran Veteran

    Messages:
    49
    Likes Received:
    11
    First Language:
    Spanish
    Primarily Uses:
    RMVXA
    Create a parallel event that controls this situation with respect to the "squirrel" with the following condional call scipt command:
    If you want something to happen when the event enters that region:

    $game_map.events[event_id].region_id == n
    event_id = event number
    n == region number

    Example:
    if $game_map.events[1].region_id == 1
    do stuff
    end
     
    #2
    Bex, Oddball and Another Fen like this.
  3. ShadowDragon

    ShadowDragon Veteran Veteran

    Messages:
    972
    Likes Received:
    306
    Location:
    Netherlands
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    you are probably looking for those scriptcalls?:

    $game_player.region_id
    $game_map.events[EVENT_ID].region_id
     
    #3
    Bex, Oddball and Another Fen like this.
  4. Another Fen

    Another Fen Veteran Veteran

    Messages:
    536
    Likes Received:
    248
    First Language:
    German
    Hey there,

    You can usually check the region using the "Get Location Info..." event command (page 3) after setting variables to your events coordinates.
    Of course, if you prefer script commands you could try

    $game_map.region_id(x, y)
    for a specific location or
    $game_map.events[id].region_id
    get_character(id).region_id
    (event script commands only; -1 for the player, 0 for "this event", others for the event with that ID)
    $game_player.region_id
    for the region under a specific character.

    Edit: Uh... too slow. :)
     
    Last edited: Sep 21, 2019
    #4
    Bex and Oddball like this.

Share This Page