[RMXP] How to lock panorama on only one map

Discussion in 'RPG Maker XP' started by nekozneko, Apr 8, 2018.

  1. nekozneko

    nekozneko Warper Member

    Messages:
    3
    Likes Received:
    1
    Location:
    France
    First Language:
    French
    Primarily Uses:
    RMXP
    (hi! this is my first post and also the first time ever i join a forum, so sorry in advance if there are some rules/manners that i unintentionally disrespect;; also sorry for my english!! )

    this is my first rpg maker project and i use rpg maker XP, and i am not skilled in scripts.

    ive spent hours trying to search how to lock a panorama/parallax so i can use it as a background layer on a map. ive found that i had to make the panorama have the same speed as tiles, and that i had to change something in Spriteset_Map (line 120).

    to this:

    when i changed the numbers in the script editor and tested the game, it totally worked!
    however, i'd like this to work only in certain maps, not all of them. i know that theres a "script" command in the event commands, but i dont know how it works.

    ive tried many things, for example this:
    [​IMG]
    but im almost certain its not correct, since i keep getting error messages.
    can anyone help me? i do not know how to word this script command properly in order to make it work.
     
    #1
    zephar123 likes this.
  2. DrDhoom

    DrDhoom Monkey Needs a Hug Veteran

    Messages:
    152
    Likes Received:
    147
    Location:
    South Borneo
    First Language:
    Indonesian
    Primarily Uses:
    N/A
    You can get the current map id with $game_map.map_id, and you can use it for the condition, like this:
    Code:
    if $game_map.map_id == MAPID
          @panorama.ox = $game_map.display_x / 4
          @panorama.oy = $game_map.display_y / 4
        else
          @panorama.ox = $game_map.display_x / 8
          @panorama.oy = $game_map.display_y / 8
        end
    Change MAPID to map ID that you want.

    If you want to change the scroll speed for multiple map, you can use an array of map ID, like this:
    Code:
    if [MAPID, MAPID, MAPID, ..., MAPID].include?($game_map.map_id)
          @panorama.ox = $game_map.display_x / 4
          @panorama.oy = $game_map.display_y / 4
        else
          @panorama.ox = $game_map.display_x / 8
          @panorama.oy = $game_map.display_y / 8
        end
     
    #2
  3. nekozneko

    nekozneko Warper Member

    Messages:
    3
    Likes Received:
    1
    Location:
    France
    First Language:
    French
    Primarily Uses:
    RMXP
    thanks a lot for the reply! sorry if i seem annoying, but where do you put each of these things? is it in the script editor or in a event (event command)?

    edit: i found the map ID i think! is it 080, like on the picture?
    [​IMG]
     
    Last edited: Apr 8, 2018
    #3
  4. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,409
    Likes Received:
    10,415
    First Language:
    English
    Primarily Uses:
    RMVXA
    Although the full map ID is 080, in script calls etc., do not use the leading zero. So you would just use 80.
     
    #4
  5. nekozneko

    nekozneko Warper Member

    Messages:
    3
    Likes Received:
    1
    Location:
    France
    First Language:
    French
    Primarily Uses:
    RMXP
    edit: okay i finally got it haha! thanks, both of you!
     
    Last edited: Apr 9, 2018
    #5

Share This Page