[RMXP] How to lock panorama on only one map

nekozneko

Warper
Member
Joined
Apr 8, 2018
Messages
3
Reaction score
1
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).

# Update panorama plane
@panorama.ox = $game_map.display_x / 8
@panorama.oy = $game_map.display_y / 8
to this:

# Update panorama plane
@panorama.ox = $game_map.display_x / 4
@panorama.oy = $game_map.display_y / 4
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:

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.
 

DrDhoom

Monkey Needs a Hug
Veteran
Joined
Mar 16, 2012
Messages
154
Reaction score
157
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
 

nekozneko

Warper
Member
Joined
Apr 8, 2018
Messages
3
Reaction score
1
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?
 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
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.
 

nekozneko

Warper
Member
Joined
Apr 8, 2018
Messages
3
Reaction score
1
First Language
French
Primarily Uses
RMXP
edit: okay i finally got it haha! thanks, both of you!
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top