From 16926144da4334c843f6478e338d977daecaaa1b Mon Sep 17 00:00:00 2001
From: Marcus Huderle Reference Reference Reference Prefab Tab¶ Porymap provides a set of default prefabs for each supported base game version (pokeemerald, pokefirered, and pokeruby). When opening a project for the first time, Porymap will prompt the user for importing those default prefabs. To create a new prefab, simply select a group of metatiles from the main map view. (See the Selecting Metatiles. section above for how to use right-click-drag to select from the map area.) Then, click the “Create from Selection” button. This will bring up the following window where individual metatiles can be toggled on/off in the prefab. You can also give your prefab a name. Prefab data is saved to a JSON file. It defaults to Prefab data is saved to a JSON file. It defaults to Porymap relies on the user maintaining a certain level of integrity with their project files.
This is a list of files that porymap reads from and writes to. Generally, if porymap writes
to a file, it probably is not a good idea to edit yourself unless otherwise noted. The filepath that Porymap expects for each file can be overridden with config options. The name of each config override is listed in the table, and should begin with File Name Read Write Override Notes data/maps/*/map.json yes yes data/maps/*/scripts.[inc|pory] yes no for finding script labels data/scripts/*.[inc|pory] yes no for finding script labels data/event_scripts.s no yes only appends new script files to end of file data/maps/map_groups.json yes yes data/layouts/layouts.json yes yes also reads border and blockdata files listed in this file data/layouts/*/[border|map].bin yes yes src/data/tilesets/headers.h yes yes src/data/tilesets/graphics.h yes yes also edits palette and tile image files listed in this file src/data/tilesets/metatiles.h yes yes also edits metatile files listed in this file data/tilesets/headers.inc yes yes only if data/tilesets/graphics.inc yes yes also edits palette and tile image files listed in this file only if data/tilesets/metatiles.inc yes yes also edits metatile files listed in this file only if src/data/wild_encounters.json data/tilesets/[primary|secondary]/* yes yes default tileset data location src/data/wild_encounters.json yes yes src/data/object_events/object_event_graphics_info_pointers.h src/data/object_events/object_event_graphics_info_pointers.h yes no src/data/object_events/object_event_graphics_info.h src/data/object_events/object_event_graphics_info.h yes no src/data/object_events/object_event_pic_tables.h src/data/object_events/object_event_pic_tables.h yes no src/data/object_events/object_event_graphics.h src/data/object_events/object_event_graphics.h yes no src/data/graphics/pokemon.h src/data/graphics/pokemon.h yes no for pokemon sprite icons src/data/heal_locations.h src/data/heal_locations.h yes yes src/data/region_map/region_map_entries.h src/data/region_map/region_map_sections.json yes yes src/data/region_map/porymap_config.json yes yes include/constants/global.h yes no reads include/constants/map_groups.h no yes include/constants/items.h yes no include/constants/opponents.h yes no reads max trainers constant include/constants/flags.h yes no include/constants/vars.h yes no include/constants/weather.h yes no include/constants/heal_locations.h no include/constants/songs.h yes no include/constants/pokemon.h include/constants/heal_locations.h yes yes include/constants/pokemon.h yes no reads min and max level constants include/constants/map_types.h include/constants/map_types.h yes no include/constants/trainer_types.h include/constants/trainer_types.h yes no include/constants/secret_bases.h include/constants/secret_bases.h yes no pokeemerald and pokeruby only include/constants/event_object_movement.h include/constants/event_object_movement.h yes no include/constants/event_objects.h yes no include/constants/event_bg.h yes no include/constants/region_map_sections.h yes no include/constants/metatile_labels.h yes yes include/constants/metatile_behaviors.h yes no include/fieldmap.h yes no reads tileset related constants src/event_object_movement.c yes no reads src/pokemon_icon.c yes no reads files in Reference Let’s test the script out by re-launching Porymap. If we try to paint grass on the map, we should see our script inserting a nice randomized grass pattern. Called when the selected tab in the map view tab bar is changed. Tabs are indexed from left to right, starting at 0 ( Called when the selected tab in the map view tab bar is changed. Tabs are indexed from left to right, starting at 0 ( All scripting functions are callable via the global The following functions are related to editing the map’s blocks or retrieving information about them. All map editing functions are callable via the global The following functions are related to reading/writing the map’s header properties. All map header functions are callable via the global The following functions are related to an overlay that is drawn on top of the map area. Text, images, and shapes can be drawn using these functions. Items can be drawn and manipulated on separate layers by specifiying a layer id. Items on higher layer ids will be drawn above those on lower layers. If no layer is specified they will be added to the default layer Clears and erases all overlay items on the specified layer that were previously-added to the map. layer (number) – the layer id. Defaults to Clears and erases all overlay items that were previously-added to the map. Hides all overlay items on the specified layer. layer (number) – the layer id. Defaults to Hides all overlay items on all active layers. Shows all overlay items on the specified layer. layer (number) – the layer id. Defaults to Shows all overlay items on all active layers. Gets whether the specified overlay layer is currently showing or not. layer (number) – the layer id. Defaults to whether the layer is showing Sets the visibility of the specified overlay layer. visible (boolean) – whether the layer should be showing layer (number) – the layer id. Defaults to Sets the visibility of all active overlay layers. visible (boolean) – whether the layers should be showing Gets the opacity of the specified overlay layer. Opacity ranges from 0 (invisible) to 100 (completely opaque). layer (number) – the layer id. Defaults to the opacity Sets the opacity of the specified overlay layer. Opacity ranges from 0 (invisible) to 100 (completely opaque). opacity (number) – the opacity layer (number) – the layer id. Defaults to Sets the opacity of all active overlay layers. Opacity ranges from 0 (invisible) to 100 (completely opaque). opacity (number) – the opacity Gets the x position of the specified overlay layer. layer (number) – the layer id. Defaults to the pixel x coordinate Gets the y position of the specified overlay layer. layer (number) – the layer id. Defaults to the pixel y coordinate Sets the x position of the specified overlay layer. x (number) – the pixel x coordinate layer (number) – the layer id. Defaults to Sets the y position of the specified overlay layer. y (number) – the pixel y coordinate layer (number) – the layer id. Defaults to Sets the x position of all active overlay layers. x (number) – the pixel x coordinate Sets the y position of all active overlay layers. y (number) – the pixel y coordinate Gets the position of the specified overlay layer. layer (number) – the layer id. Defaults to the layer’s pixel coordinates Sets the position of the specified overlay layer. x (number) – the pixel x coordinate y (number) – the pixel y coordinate layer (number) – the layer id. Defaults to Sets the position of all active overlay layers. x (number) – the pixel x coordinate y (number) – the pixel y coordinate Moves the specified overlay layer. deltaX (number) – the number of pixels to move horizontally deltaY (number) – the number of pixels to move vertically layer (number) – the layer id. Defaults to Moves all active overlay layers. deltaX (number) – the number of pixels to move horizontally deltaY (number) – the number of pixels to move vertically Adds a text item to the specified overlay layer. text (string) – the text to display x (number) – the x pixel coordinate of the text (relative to the layer’s position) y (number) – the y pixel coordinate of the text (relative to the layer’s position) color (string) – the color of the text. Can be specified as “#RRGGBB” or “#AARRGGBB”. Defaults to black. size (number) – the font size of the text. Defaults to 12. layer (number) – the layer id. Defaults to Adds a rectangle outline item to the specified overlay layer. x (number) – the x pixel coordinate of the rectangle’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the rectangle’s top-left corner (relative to the layer’s position) width (number) – the pixel width of the rectangle height (number) – the pixel height of the rectangle color (string) – the color of the rectangle. Can be specified as “#RRGGBB” or “#AARRGGBB”. Defaults to black. layer (number) – the layer id. Defaults to Adds a filled rectangle item to the specified overlay layer. x (number) – the x pixel coordinate of the rectangle’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the rectangle’s top-left corner (relative to the layer’s position) width (number) – the pixel width of the rectangle height (number) – the pixel height of the rectangle color (string) – the color of the rectangle. Can be specified as “#RRGGBB” or “#AARRGGBB”. Defaults to black. layer (number) – the layer id. Defaults to Adds an image item to the specified overlay layer. x (number) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position) filepath (string) – the image’s filepath layer (number) – the layer id. Defaults to useCache (boolean) – whether the image should be saved/loaded using the cache. Defaults to Creates an image item on the specified overlay layer. This differs from x (number) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position) filepath (string) – the image’s filepath width (number) – the width in pixels of the area to read in the image. If height (number) – the height in pixels of the area to read in the image. If offset (number) – the pixel offset into the original image where data should be read from. Defaults to hScale (number) – the horizontal scale for the image. Negative values will be a horizontal flip of the original image. Defaults to vScale (number) – the vertical scale for the image. Negative values will be a vertical flip of the original image. Defaults to paletteId (number) – the id of which currently loaded tileset palette to use for the image. If setTransparency (boolean) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to layer (number) – the layer id. Defaults to useCache (boolean) – whether the image should be saved/loaded using the cache. Defaults to Creates an image of a tile on the specified overlay layer. x (number) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position) tileId (number) – tile value for the image xflip (boolean) – whether the tile image is flipped horizontally yflip (boolean) – whether the tile image is flipped vertically palette (number) – palette number for the tile image setTransparency (boolean) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to layer (number) – the layer id. Defaults to Creates an image of a tile on the specified overlay layer. This is an overloaded function that takes a single tile as a JavaScript object instead of each of the tile’s properties individually. x (number) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position) tile ({tileId,xflip,yflip,palette}) – the tile to create an image of setTransparency (boolean) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to layer (number) – the layer id. Defaults to Creates an image of a metatile on the specified overlay layer. x (number) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position) metatileId (number) – id of the metatile to create an image of setTransparency (boolean) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to layer (number) – the layer id. Defaults to The following functions are related to tilesets and how they are rendered. The functions with “preview” in their name operate on a “fake” version of the palette colors. This means that changing these “preview” colors won’t affect the actual tileset colors in the project. A good use of the “preview” palettes would be Day/Night tints, for example. Gets a palette from the primary tileset of the currently-opened map. paletteIndex (number) – the palette index array of colors. Each color is a 3-element RGB array Sets a palette in the primary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap. paletteIndex (number) – the palette index colors (array) – array of colors. Each color is a 3-element RGB array Gets all of the palettes from the primary tileset of the currently-opened map. array of arrays of colors. Each color is a 3-element RGB array Sets all of the palettes in the primary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap. palettes (array) – array of arrays of colors. Each color is a 3-element RGB array Gets a palette from the secondary tileset of the currently-opened map. paletteIndex (number) – the palette index array of colors. Each color is a 3-element RGB array Sets a palette in the secondary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap. paletteIndex (number) – the palette index colors (array) – array of colors. Each color is a 3-element RGB array Gets all of the palettes from the secondary tileset of the currently-opened map. array of arrays of colors. Each color is a 3-element RGB array Sets all of the palettes in the secondary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap. palettes (array) – array of arrays of colors. Each color is a 3-element RGB array Gets a palette from the primary tileset of the currently-opened map. paletteIndex (number) – the palette index array of colors. Each color is a 3-element RGB array Sets a palette in the primary tileset of the currently-opened map. This will permanently affect the palette and save the palette to disk. paletteIndex (number) – the palette index colors (array) – array of colors. Each color is a 3-element RGB array Gets all of the palettes from the primary tileset of the currently-opened map. array of arrays of colors. Each color is a 3-element RGB array Sets all of the palettes in the primary tileset of the currently-opened map. This will permanently affect the palettes and save the palettes to disk. palettes (array) – array of arrays of colors. Each color is a 3-element RGB array Gets a palette from the secondary tileset of the currently-opened map. paletteIndex (number) – the palette index array of colors. Each color is a 3-element RGB array Sets a palette in the secondary tileset of the currently-opened map. This will permanently affect the palette and save the palette to disk. paletteIndex (number) – the palette index colors (array) – array of colors. Each color is a 3-element RGB array Gets all of the palettes from the secondary tileset of the currently-opened map. array of arrays of colors. Each color is a 3-element RGB array Sets all of the palettes in the secondary tileset of the currently-opened map. This will permanently affect the palettes and save the palettes to disk. palettes (array) – array of arrays of colors. Each color is a 3-element RGB array Gets whether the specified tileset is a primary tileset. tilesetName (string) – the tileset name is a primary tileset Gets whether the specified tileset is a secondary tileset. tilesetName (string) – the tileset name is a secondary tileset All tileset functions are callable via the global Gets the number of metatiles in the primary tileset for the currently-opened map. number of metatiles Gets the maximum number of metatiles allowed in a primary tileset. maximum number of metatiles Gets the number of metatiles in the secondary tileset for the currently-opened map. number of metatiles Gets the maximum number of metatiles allowed in a secondary tileset. maximum number of metatiles Gets the maximum number of tiles allowed in a primary tileset. maximum number of tiles Gets the maximum number of tiles allowed in a secondary tileset. Gets the number of metatiles in the primary tileset for the currently-opened map. maximum number of tiles number of metatiles Gets the number of tiles in a metatile. Will be either Gets the number of metatiles in the secondary tileset for the currently-opened map. number of tiles in a metatile number of metatiles Gets the number of layers in a metatiles. Will be either Gets a palette from the primary tileset of the currently-opened map. number of layers in a metatile paletteIndex (number) – the palette index array of colors. Each color is a 3-element RGB array Sets a palette in the primary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap. paletteIndex (number) – the palette index colors (array) – array of colors. Each color is a 3-element RGB array forceRedraw (boolean) – Redraw the elements with the updated palette. Defaults to Gets all of the palettes from the primary tileset of the currently-opened map. array of arrays of colors. Each color is a 3-element RGB array Sets all of the palettes in the primary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap. palettes (array) – array of arrays of colors. Each color is a 3-element RGB array forceRedraw (boolean) – Redraw the elements with the updated palettes. Defaults to Gets a palette from the secondary tileset of the currently-opened map. paletteIndex (number) – the palette index array of colors. Each color is a 3-element RGB array Sets a palette in the secondary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap. paletteIndex (number) – the palette index colors (array) – array of colors. Each color is a 3-element RGB array forceRedraw (boolean) – Redraw the elements with the updated palette. Defaults to Gets all of the palettes from the secondary tileset of the currently-opened map. array of arrays of colors. Each color is a 3-element RGB array Sets all of the palettes in the secondary tileset of the currently-opened map. This will NOT affect the true underlying colors–it only displays these colors in the map-editing area of Porymap. palettes (array) – array of arrays of colors. Each color is a 3-element RGB array forceRedraw (boolean) – Redraw the elements with the updated palettes. Defaults to Gets a palette from the primary tileset of the currently-opened map. paletteIndex (number) – the palette index array of colors. Each color is a 3-element RGB array Sets a palette in the primary tileset of the currently-opened map. This will permanently affect the palette and save the palette to disk. paletteIndex (number) – the palette index colors (array) – array of colors. Each color is a 3-element RGB array forceRedraw (boolean) – Redraw the elements with the updated palette. Defaults to Gets all of the palettes from the primary tileset of the currently-opened map. array of arrays of colors. Each color is a 3-element RGB array Sets all of the palettes in the primary tileset of the currently-opened map. This will permanently affect the palettes and save the palettes to disk. palettes (array) – array of arrays of colors. Each color is a 3-element RGB array forceRedraw (boolean) – Redraw the elements with the updated palettes. Defaults to Gets a palette from the secondary tileset of the currently-opened map. paletteIndex (number) – the palette index array of colors. Each color is a 3-element RGB array Sets a palette in the secondary tileset of the currently-opened map. This will permanently affect the palette and save the palette to disk. paletteIndex (number) – the palette index colors (array) – array of colors. Each color is a 3-element RGB array forceRedraw (boolean) – Redraw the elements with the updated palette. Defaults to Gets all of the palettes from the secondary tileset of the currently-opened map. array of arrays of colors. Each color is a 3-element RGB array Sets all of the palettes in the secondary tileset of the currently-opened map. This will permanently affect the palettes and save the palettes to disk. palettes (array) – array of arrays of colors. Each color is a 3-element RGB array forceRedraw (boolean) – Redraw the elements with the updated palettes. Defaults to Sets the tile at the specified index of the metatile. This is an overloaded function that takes a single tile as a JavaScript object instead of each of the tile’s properties individually. Warning: This function writes directly to the tileset. There is no undo for this. Sets the tiles in the specified range of the metatile. This is an overloaded function that takes an array of tiles as JavaScript objects instead of each of the tile properties individually. Warning: This function writes directly to the tileset. There is no undo for this. The following functions are related to an overlay that is drawn on top of the map area. Text, images, and shapes can be drawn using these functions. Items can be drawn and manipulated on separate layers by specifiying a layer id. Items on higher layer ids will be drawn above those on lower layers. The visibility, opacity, position, rotation, and scale of each layer can be changed; by default all layers are visible, have an opacity of All overlay functions are callable via the global Clears and erases all previously-added overlay items on the specified layer. layer (number) – the layer id This is an overloaded function. Clears and erases all previously-added overlay items on every layer. Hides all overlay items on the specified layer. layer (number) – the layer id This is an overloaded function. Hides all overlay items on all active layers. Layers that have not been used yet will not be hidden. Shows all overlay items on the specified layer. layer (number) – the layer id This is an overloaded function. Shows all overlay items on all active layers. Gets whether the specified overlay layer is currently showing or not. layer (number) – the layer id. Defaults to whether the layer is showing Sets the visibility of the specified overlay layer. visible (boolean) – whether the layer should be showing layer (number) – the layer id This is an overloaded function. Sets the visibility of all active overlay layers. visible (boolean) – whether the layers should be showing Gets the opacity of the specified overlay layer. Opacity ranges from layer (number) – the layer id. Defaults to the opacity Sets the opacity of the specified overlay layer. Opacity ranges from opacity (number) – the opacity layer (number) – the layer id This is an overloaded function. Sets the opacity of all active overlay layers. Layers that have not been used yet will not have their opacity changed. Opacity ranges from opacity (number) – the opacity Gets the horizontal scale of the specified overlay layer. layer (number) – the layer id. Defaults to the scale Gets the vertical scale of the specified overlay layer. layer (number) – the layer id. Defaults to the scale Sets the horizontal scale of the specified overlay layer. scale (number) – the scale to set layer (number) – the layer id This is an overloaded function. Sets the horizontal scale of all active overlay layers. Layers that have not been used yet will not have their scale changed. scale (number) – the scale to set Sets the vertical scale of the specified overlay layer. scale (number) – the scale to set layer (number) – the layer id This is an overloaded function. Sets the vertical scale of all active overlay layers. Layers that have not been used yet will not have their scale changed. scale (number) – the scale to set Gets the angle the specified overlay layer is rotated to. layer (number) – the layer id. Defaults to the angle the layer is rotated to Sets the angle the specified overlay layer is rotated to. angle (number) – the angle to set layer (number) – the layer id This is an overloaded function. Sets the angle that all active overlay layers are rotated to. Layers that have not been used yet will not have their angle changed. angle (number) – the angle to set Rotates the specified overlay layer. A positive number of degrees is clockwise rotation, a negative number of degrees is counterclockwise rotation. degrees (number) – the number of degrees to rotate layer (number) – the layer id This is an overloaded function. Rotates the all active overlay layers. Layers that have not been used yet will not be rotated. A positive number of degrees is clockwise rotation, a negative number of degrees is counterclockwise rotation. degrees (number) – the number of degrees to rotate Gets the x position of the specified overlay layer. layer (number) – the layer id. Defaults to the pixel x coordinate Gets the y position of the specified overlay layer. layer (number) – the layer id. Defaults to the pixel y coordinate Sets the x position of the specified overlay layer. x (number) – the pixel x coordinate layer (number) – the layer id This is an overloaded function. Sets the x position of all active overlay layers. Layers that have not been used yet will not have their position changed. x (number) – the pixel x coordinate Sets the y position of the specified overlay layer. y (number) – the pixel y coordinate layer (number) – the layer id This is an overloaded function. Sets the y position of all active overlay layers. Layers that have not been used yet will not have their position changed. y (number) – the pixel y coordinate Sets the rectangular clipping region for the specifieid overlay layer. A clipping region will cause the overlay’s rendering to be contained inside it. In other words, any content from the overlay layer will not be visible outside of the specified rectangle. x (number) – the rectangle’s pixel x coordinate, 0 is the left edge of the current map. A negative value is where the left map border’s region is y (number) – the rectangle’s pixel y coordinate, 0 is the top edge of the current map. A negative value is where the top map border’s region is width (number) – the rectangle’s pixel width height (number) – the rectangle’s pixel height layer (number) – the layer id This is an overloaded function. Sets the rectangular clipping region for all overlay layers. A clipping region will cause the overlay’s rendering to be contained inside it. In other words, any content from the overlay layer will not be visible outside of the specified rectangle. x (number) – the rectangle’s pixel x coordinate, 0 is the left edge of the current map. A negative value is where the left map border’s region is y (number) – the rectangle’s pixel y coordinate, 0 is the top edge of the current map. A negative value is where the top map border’s region is width (number) – the rectangle’s pixel width height (number) – the rectangle’s pixel height Clears any clipping for the specified overlay layer. See layer (number) – the layer id Clears any clipping for all overlay layers. See Gets the position of the specified overlay layer. layer (number) – the layer id. Defaults to the layer’s pixel coordinates Sets the position of the specified overlay layer. x (number) – the pixel x coordinate y (number) – the pixel y coordinate layer (number) – the layer id This is an overloaded function. Sets the position of all active overlay layers. Layers that have not been used yet will not have their position changed. x (number) – the pixel x coordinate y (number) – the pixel y coordinate Moves the specified overlay layer. deltaX (number) – the number of pixels to move horizontally deltaY (number) – the number of pixels to move vertically layer (number) – the layer id This is an overloaded function. Moves all active overlay layers. Layers that have not been used yet will not have their position changed. deltaX (number) – the number of pixels to move horizontally deltaY (number) – the number of pixels to move vertically Adds a text item to the specified overlay layer. Text can be additionally formatted with a limited set of HTML tags. Note that only text can be displayed, so text decoration like underlines or table borders will not appear. text (string) – the text to display x (number) – the x pixel coordinate of the text (relative to the layer’s position) y (number) – the y pixel coordinate of the text (relative to the layer’s position) color (string) – the color of the text. Can be specified as size (number) – the font size of the text. Defaults to 12. layer (number) – the layer id. Defaults to Adds a rectangle outline item to the specified overlay layer. x (number) – the x pixel coordinate of the rectangle’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the rectangle’s top-left corner (relative to the layer’s position) width (number) – the pixel width of the rectangle height (number) – the pixel height of the rectangle borderColor (string) – the color of the rectangle’s border. Can be specified as fillColor (string) – the color of the area enclosed by the rectangle. Can be specified as rounding (number) – the percent degree the corners will be rounded. layer (number) – the layer id. Defaults to Draws a straight path on the specified layer by connecting the coordinate pairs in coords (array) – array of pixel coordinates to connect to create the path. Each element of the array should be an array containing an x and y pixel coordinate borderColor (string) – the color of the path. Can be specified as fillColor (string) – the color of the area enclosed by the path. Can be specified as layer (number) – the layer id. Defaults to This is an overloaded function. Draws a straight path on the specified layer by connecting the coordinates at ( xCoords (array) – array of x pixel coordinates to connect to create the path yCoords (array) – array of y pixel coordinates to connect to create the path borderColor (string) – the color of the path. Can be specified as fillColor (string) – the color of the area enclosed by the path. Can be specified as layer (number) – the layer id. Defaults to Adds an image item to the specified overlay layer. x (number) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position) filepath (string) – the image’s filepath layer (number) – the layer id. Defaults to useCache (boolean) – whether the image should be saved/loaded using the cache. Defaults to Creates an image item on the specified overlay layer. This differs from x (number) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position) filepath (string) – the image’s filepath width (number) – the width in pixels of the area to read in the image. If height (number) – the height in pixels of the area to read in the image. If xOffset (number) – the x pixel coordinate on the original image where data should be read from. Defaults to yOffset (number) – the y pixel coordinate on the original image where data should be read from. Defaults to hScale (number) – the horizontal scale for the image. Negative values will be a horizontal flip of the original image. Defaults to vScale (number) – the vertical scale for the image. Negative values will be a vertical flip of the original image. Defaults to paletteId (number) – the id of which currently loaded tileset palette to use for the image. If setTransparency (boolean) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to layer (number) – the layer id. Defaults to useCache (boolean) – whether the image should be saved/loaded using the cache. Defaults to Creates an image of a tile on the specified overlay layer. x (number) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position) tileId (number) – tile value for the image xflip (boolean) – whether the tile image is flipped horizontally yflip (boolean) – whether the tile image is flipped vertically palette (number) – palette number for the tile image setTransparency (boolean) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to layer (number) – the layer id. Defaults to Creates an image of a tile on the specified overlay layer. This is an overloaded function that takes a single tile as a JavaScript object instead of each of the tile’s properties individually. x (number) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position) tile ({tileId,xflip,yflip,palette}) – the tile to create an image of setTransparency (boolean) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to layer (number) – the layer id. Defaults to Creates an image of a metatile on the specified overlay layer. x (number) – the x pixel coordinate of the image’s top-left corner (relative to the layer’s position) y (number) – the y pixel coordinate of the image’s top-left corner (relative to the layer’s position) metatileId (number) – id of the metatile to create an image of setTransparency (boolean) – whether the color at index 0 should be overwritten with transparent pixels. Defaults to layer (number) – the layer id. Defaults to The following functions are related to settings. All settings functions are callable via the global Gets the visibility of the map grid overlay. Sets the visibility of the map grid overlay. Gets the visibility of the map’s border. Sets the visibility of the map’s border. Gets the toggle state of smart paths. Sets the toggle state of smart paths. Gets the project’s base game version. Gets the current version of Porymap ( the version object Gets the list of paths to custom scripts. Gets the index of the currently selected main tab. Tabs are indexed from left to right, starting at 0 ( Sets the currently selected main tab. Tabs are indexed from left to right, starting at 0 ( Gets the index of the currently selected map view tab. Tabs are indexed from left to right, starting at 0 ( Gets the index of the currently selected map view tab. Tabs are indexed from left to right, starting at 0 ( current map view tab index Sets the currently selected map view tab. Tabs are indexed from left to right, starting at 0 ( Sets the currently selected map view tab. Tabs are indexed from left to right, starting at 0 ( These are some miscellaneous functions that can be very useful when building custom scripts. All utility functions are callable via the global Registers a JavaScript function to an action that can be manually triggered in Porymap’s This behaves essentially the same as JavaScript’s Logs a message to the Porymap log file with the prefix Logs a message to the Porymap log file with the prefix Logs a message to the Porymap log file with the prefix Displays a message box with an “Information” icon and an Displays a message box with a “Warning” icon and an Displays a message box with a “Critical” icon and an Displays a message box with a “Question” icon and a Displays a text input dialog with an Displays a number input dialog with an Displays a text input dialog with an items dropdown and an Gets the list of map names. the list of map names Gets the list of tileset names. the list of tileset names Gets the list of primary tileset names. the list of primary tileset names Gets the list of secondary tileset names. the list of secondary tileset names Gets the list of metatile behavior names. the list of metatile behavior names Gets the list of song names. the list of song names Gets the list of map location names. the list of map location names Gets the list of weather names. the list of weather names Gets the list of map type names. the list of map type names Gets the list of battle scene names. the list of battle scene names Gets whether the specified tileset is a primary tileset. tilesetName (string) – the tileset name is a primary tileset Gets whether the specified tileset is a secondary tileset. tilesetName (string) – the tileset name is a secondary tileset Some constant values are provided for convenience. These are read-only properties guaranteed not to change unless a new project is opened or the current one is reloaded. All constants are accessible via the global The maximum number of tiles in a primary tileset. The maximum number of tiles in a secondary tileset. The maximum number of metatiles in a primary tileset. The maximum number of metatiles in a secondary tileset. The number of tile layers used in each metatile. This will either be The number of tiles in each metatile. This will either be The string value of the config setting Porymap’s major version number. For example, for Porymap version Porymap’s minor version number. For example, for Porymap version Porymap’s patch version number. For example, for Porymap version Reference
-
+
-
-
-
-
-
-
-
-
-
-
@@ -205,100 +206,101 @@
-
-
-
-
Index
+C
+
+
+
+
+ M
+
+
+
+
+
U
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
@@ -206,100 +207,101 @@
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
@@ -186,93 +208,100 @@
-
<project_root>/prefabs.json. However, it can be configured in Porymap’s project config file.<project_root>/prefabs.json. However, it can be configured in Porymap’s project config file using the prefabs_filepath setting.
@@ -121,6 +122,7 @@
+
+
+
+
+
+
+
-
-
-
+
-
-
@@ -206,100 +207,101 @@
-
path/.
+For example if you wanted to rename include/constants/items.h to headers/defines/stuff.h, you would add path/constants_items=headers/defines/stuff.h to your project’s porymap.project.cfg file.
diff --git a/docs/manual/scripting-capabilities.html b/docs/manual/scripting-capabilities.html
index 79ec26b4..90417691 100644
--- a/docs/manual/scripting-capabilities.html
+++ b/docs/manual/scripting-capabilities.html
@@ -184,12 +184,13 @@
@@ -365,168 +398,273 @@ to a file, it probably is not a good idea to edit yourself unless otherwise note
+
+
+data_map_folders
+
+
+
+
+data_map_folders
+
+
+
+
+data_scripts_folders
+
+data_event_scripts
+json_map_groups
+
-
+
+json_layouts
+
+
+
+
+
+data_layouts_folders
+
+
+
+
+
+tilesets_headers
+
+
+
+
+
+tilesets_graphics
+
+
+
+
+tilesets_metatiles
-
+
+tilesets_headers_asmtilesets_headers can’t be found
-
+
+tilesets_graphics_asmtilesets_headers can’t be found
-
-
+
+tilesets_metatiles_asmtilesets_headers can’t be found
+
+
+
+data_tilesets_folders
+
-
+
+
+json_wild_encounters
+
-
+data_obj_event_gfx_pointers
+
-
+data_obj_event_gfx_info
+
-
+data_obj_event_pic_tables
+
-
+data_obj_event_gfx
+
-
+data_pokemon_gfx
+
-
+data_heal_locations
+
+
+
+json_region_map_entries
+
+
+
+json_region_porymap_cfg
-
+
+constants_globalOBJECT_EVENT_TEMPLATES_COUNT
+constants_map_groups
+constants_items
+constants_opponents
+constants_flags
+constants_vars
-
+constants_weather
-
+
-
+
+constants_songs
+
+
+
+
+
+constants_heal_locations
+
-
+constants_pokemon
+
-
+constants_map_types
+
-
+constants_trainer_types
+
-
+constants_secret_bases
+
+
+
+constants_obj_event_movement
+
+
+
+constants_obj_events
+constants_event_bg
+constants_region_map_sections
+constants_metatile_labels
+constants_metatile_behaviors
+
+constants_fieldmap
+
+
+
+
+initial_facing_table
+gInitialMovementTypeFacingDirections
+
+
+
+pokemon_icon_table
+gMonIconTable
-
+
-
-
-
-
-
-
-
-
-
-
-
-
@@ -206,100 +207,101 @@
-
onMapViewTabChanged(oldTab, newTab)¶0: Metatiles, 1: Collision).0: Metatiles, 1: Collision, 2: Prefabs).
@@ -637,10 +639,10 @@
Functions¶
-map object.Map Editing Functions¶
map object.
map.getBlock(x, y)¶Map Header Editing Functions¶
map object.
-map.getSong()¶Map Overlay Functions¶
-0. The visibility and position of each layer can be changed; by default all layers are visible, and their position is 0,0.
-
-
-map.clearOverlay(layer = 0)¶
-
-
-
-0
-
-
-map.clearOverlays()¶
-
-
-map.hideOverlay(layer = 0)¶
-
-
-
-0
-
-
-map.hideOverlays()¶
-
-
-map.showOverlay(layer = 0)¶
-
-
-
-0
-
-
-map.showOverlays()¶
-
-
-map.getOverlayVisibility(layer = 0)¶
-
-
-
-0
-
-
-map.setOverlayVisibility(visible, layer = 0)¶
-
-
-
-0
-
-
-map.setOverlaysVisibility(visible)¶
-
-
-
-
-
-
-map.getOverlayOpacity(layer = 0)¶
-
-
-
-0
-
-
-map.setOverlayOpacity(opacity, layer = 0)¶
-
-
-
-0
-
-
-map.setOverlaysOpacity(opacity)¶
-
-
-
-
-
-
-map.getOverlayX(layer = 0)¶
-
-
-
-0
-
-
-map.getOverlayY(layer = 0)¶
-
-
-
-0
-
-
-map.setOverlayX(x, layer = 0)¶
-
-
-
-0
-
-
-map.setOverlayY(y, layer = 0)¶
-
-
-
-0
-
-
-map.setOverlaysX(x)¶
-
-
-
-
-
-
-map.setOverlaysY(y)¶
-
-
-
-
-
-
-map.getOverlayPosition(layer = 0)¶
-
-
-
-0
-
-
-map.setOverlayPosition(x, y, layer = 0)¶
-
-
-
-0
-
-
-map.setOverlaysPosition(x, y)¶
-
-
-
-
-
-
-map.moveOverlay(deltaX, deltaY, layer = 0)¶
-
-
-
-0
-
-
-map.moveOverlays(deltaX, deltaY)¶
-
-
-
-
-
-
-map.addText(text, x, y, color = "#000000", size = 12, layer = 0)¶
-
-
-
-0
-
-
-map.addRect(x, y, width, height, color = "#000000", layer = 0)¶
-
-
-
-0
-
-
-map.addFilledRect(x, y, width, height, color = "#000000", layer = 0)¶
-
-
-
-0
-
-
-map.addImage(x, y, filepath, layer = 0, useCache = true)¶
-
-
-
-0true. Reading images from a file is slow. Setting useCache to true will save the image to memory so that the next time the filepath is encountered the image can be loaded from memory rather than the file.
-
-
-map.createImage(x, y, filepath, width = -1, height = -1, offset = 0, hScale = 1, vScale = 1, paletteId = -1, setTransparency = false, layer = 0, useCache = true)¶map.addImage by allowing the new image to be a transformation of the image file.
-
-
-
--1, use the full width of the original image. Defaults to -1-1, use the full height of the original image. Defaults to -1011-1, use the original image’s palette. Defaults to -1false0true. Reading images from a file is slow. Setting useCache to true will save the image to memory so that the next time the filepath is encountered the image can be loaded from memory rather than the file.
-
-
-map.addTileImage(x, y, tileId, xflip, yflip, palette, setTransparency = false, layer = 0)¶
-
-
-
-false0
-
-
-map.addTileImage(x, y, tile, setTransparency = false, layer = 0)¶
-
-
-
-false0
-
-
map.addMetatileImage(x, y, metatileId, setTransparency = false, layer = 0)¶
-
-
-
-false0Tileset Functions¶
-
-
-map.getPrimaryTilesetPalettePreview(paletteIndex)¶
-
-
-
-
-
-
-map.setPrimaryTilesetPalettePreview(paletteIndex, colors)¶
-
-
-
-
-
-
-map.getPrimaryTilesetPalettesPreview()¶
-
-
-
-
-map.setPrimaryTilesetPalettesPreview(palettes)¶
-
-
-
-
-
-
-map.getSecondaryTilesetPalettePreview(paletteIndex)¶
-
-
-
-
-
-
-map.setSecondaryTilesetPalettePreview(paletteIndex, colors)¶
-
-
-
-
-
-
-map.getSecondaryTilesetPalettesPreview()¶
-
-
-
-
-map.setSecondaryTilesetPalettesPreview(palettes)¶
-
-
-
-
-
-
-map.getPrimaryTilesetPalette(paletteIndex)¶
-
-
-
-
-
-
-map.setPrimaryTilesetPalette(paletteIndex, colors)¶
-
-
-
-
-
-
-map.getPrimaryTilesetPalettes()¶
-
-
-
-
-map.setPrimaryTilesetPalettes(palettes)¶
-
-
-
-
-
-
-map.getSecondaryTilesetPalette(paletteIndex)¶
-
-
-
-
-
-
-map.setSecondaryTilesetPalette(paletteIndex, colors)¶
-
-
-
-
-
-
-map.getSecondaryTilesetPalettes()¶
-
-
-
-
-map.setSecondaryTilesetPalettes(palettes)¶
-
-
-
-
-
-
-map.isPrimaryTileset(tilesetName)¶
-
-
-
-
-
-
+map.isSecondaryTileset(tilesetName)¶
-
-
-
-map object.
-map.getPrimaryTileset()¶
-
-
-map.getNumPrimaryTilesetMetatiles()¶
-
-
-
-
-map.getMaxPrimaryTilesetMetatiles()¶
-
-
-
-
-map.getNumSecondaryTilesetMetatiles()¶
-
-
-
-
map.getMaxSecondaryTilesetMetatiles()¶
-
-
-map.getNumPrimaryTilesetTiles()¶
-
-
map.getMaxPrimaryTilesetTiles()¶
-
-
map.getNumSecondaryTilesetTiles()¶
-
map.getMaxSecondaryTilesetTiles()¶map.getNumPrimaryTilesetMetatiles()¶
-
map.getNumTilesInMetatile()¶8 or 12 depending on enable_triple_layer_metatiles.map.getNumSecondaryTilesetMetatiles()¶
-
+
+map.getNumMetatileLayers()¶2 or 3 depending on enable_triple_layer_metatiles.map.getPrimaryTilesetPalettePreview(paletteIndex)¶
-
+
+
+
+
+
+map.setPrimaryTilesetPalettePreview(paletteIndex, colors, forceRedraw = true)¶
+
+
+
+true. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set redraw to true on the final call.
+
+
+map.getPrimaryTilesetPalettesPreview()¶
+
+
+
+
+map.setPrimaryTilesetPalettesPreview(palettes, forceRedraw = true)¶
+
+
+
+true. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set redraw to true on the final call.
+
+
+map.getSecondaryTilesetPalettePreview(paletteIndex)¶
+
+
+
+
+
+
+map.setSecondaryTilesetPalettePreview(paletteIndex, colors, forceRedraw = true)¶
+
+
+
+true. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set redraw to true on the final call.
+
+
+map.getSecondaryTilesetPalettesPreview()¶
+
+
+
+
+map.setSecondaryTilesetPalettesPreview(palettes, forceRedraw = true)¶
+
+
+
+true. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set redraw to true on the final call.
+
+
+map.getPrimaryTilesetPalette(paletteIndex)¶
+
+
+
+
+
+
+map.setPrimaryTilesetPalette(paletteIndex, colors, forceRedraw = true)¶
+
+
+
+true. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set redraw to true on the final call.
+
+
+map.getPrimaryTilesetPalettes()¶
+
+
+
+
+map.setPrimaryTilesetPalettes(palettes, forceRedraw = true)¶
+
+
+
+true. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set redraw to true on the final call.
+
+
+map.getSecondaryTilesetPalette(paletteIndex)¶
+
+
+
+
+
+
+map.setSecondaryTilesetPalette(paletteIndex, colors, forceRedraw = true)¶
+
+
+
+true. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set redraw to true on the final call.
+
+
+map.getSecondaryTilesetPalettes()¶
+
+
+
@@ -2510,8 +1968,8 @@
map.setSecondaryTilesetPalettes(palettes, forceRedraw = true)¶
+
+
true. Redrawing the elements that use palettes is expensive, so it can be useful to batch together many calls to palette functions and only set redraw to true on the final call.
-
map.setMetatileTile(metatileId, tileIndex, tile, forceRedraw = true)¶map.setMetatileTile(metatileId, tileIndex, tile, forceRedraw = true)¶
@@ -2548,8 +2006,8 @@
-
+map.setMetatileTiles(metatileId, tiles, tileStart = 0, tileEnd = -1, forceRedraw = true)¶map.setMetatileTiles(metatileId, tiles, tileStart = 0, tileEnd = -1, forceRedraw = true)¶
@@ -2576,13 +2034,697 @@
Overlay Functions¶
+100, are at position 0,0, an angle of 0, and a horizontal and vertical scale of 1.0.overlay object.
+
+
+overlay.clear(layer)¶
+
+
+
+
+
+
+overlay.clear()¶
+
+
+overlay.hide(layer)¶
+
+
+
+
+
+
+overlay.hide()¶
+
+
+overlay.show(layer)¶
+
+
+
+
+
+
+overlay.show()¶
+
+
+overlay.getVisibility(layer = 0)¶
+
+
+
+0
+
+
+overlay.setVisibility(visible, layer)¶
+
+
+
+
+
+
+overlay.setVisibility(visible)¶
+
+
+
+
+
+
+overlay.getOpacity(layer = 0)¶0 (invisible) to 100 (completely opaque).
+
+
+
+0
+
+
+overlay.setOpacity(opacity, layer)¶0 (invisible) to 100 (completely opaque).
+
+
+
+
+
+
+overlay.setOpacity(opacity)¶0 (invisible) to 100 (completely opaque).
+
+
+
+
+
+
+overlay.getHorizontalScale(layer = 0)¶1.0 is normal size.
+
+
+
+0
+
+
+overlay.getVerticalScale(layer = 0)¶1.0 is normal size.
+
+
+
+0
+
+
+overlay.setHorizontalScale(scale, layer)¶1.0 is normal size.
+
+
+
+
+
+
+overlay.setHorizontalScale(scale)¶1.0 is normal size.
+
+
+
+
+
+
+overlay.setVerticalScale(scale, layer)¶1.0 is normal size.
+
+
+
+
+
+
+overlay.setVerticalScale(scale)¶1.0 is normal size.
+
+
+
+
+
+
+overlay.getRotation(layer = 0)¶
+
+
+
+0
+
+
+overlay.setRotation(angle, layer)¶
+
+
+
+
+
+
+overlay.setRotation(angle)¶
+
+
+
+
+
+
+overlay.rotate(degrees, layer)¶
+
+
+
+
+
+
+overlay.rotate(degrees)¶
+
+
+
+
+
+
+overlay.getX(layer = 0)¶
+
+
+
+0
+
+
+overlay.getY(layer = 0)¶
+
+
+
+0
+
+
+overlay.setX(x, layer)¶
+
+
+
+
+
+
+overlay.setX(x)¶
+
+
+
+
+
+
+overlay.setY(y, layer)¶
+
+
+
+
+
+
+overlay.setY(y)¶
+
+
+
+
+
+
+overlay.setClippingRect(x, y, width, height, layer)¶
+
+
+
+
+
+
+overlay.setClippingRect(x, y, width, height)¶
+
+
+
+
+
+
+overlay.clearClippingRect(layer)¶setClippingRect for more info about clipping.
+
+
+
+
+
+
+overlay.clearClippingRect()¶setClippingRect for more info about clipping.
+
+
+overlay.getPosition(layer = 0)¶
+
+
+
+0
+
+
+overlay.setPosition(x, y, layer)¶
+
+
+
+
+
+
+overlay.setPosition(x, y)¶
+
+
+
+
+
+
+overlay.move(deltaX, deltaY, layer)¶
+
+
+
+
+
+
+overlay.move(deltaX, deltaY)¶
+
+
+
+
+
+
+overlay.addText(text, x, y, color = "#000000", size = 12, layer = 0)¶
+
+
+
+"#RRGGBB" or "#AARRGGBB". Defaults to black.0
+
+
+overlay.addRect(x, y, width, height, borderColor = "#000000", fillColor = "", rounding = 0, layer = 0)¶
+
+
+
+"#RRGGBB" or "#AARRGGBB". Defaults to black."#RRGGBB" or "#AARRGGBB". Defaults to transparent.0 is rectangular, 100 is elliptical. Defaults to 00
+
+
+overlay.addPath(coords, borderColor = "#000000", fillColor = "", layer = 0)¶coords. The area enclosed by the path can be colored in, and will follow the “odd-even” fill rule.
+
+
+
+"#RRGGBB" or "#AARRGGBB". Defaults to black."#RRGGBB" or "#AARRGGBB". Defaults to transparent.0
+
+
+overlay.addPath(xCoords, yCoords, borderColor = "#000000", fillColor = "", layer = 0)¶xCoords, yCoords). The area enclosed by the path can be colored in, and will follow the “odd-even” fill rule.
+
+
+
+"#RRGGBB" or "#AARRGGBB". Defaults to black."#RRGGBB" or "#AARRGGBB". Defaults to transparent.0
+
+
+overlay.addImage(x, y, filepath, layer = 0, useCache = true)¶
+
+
+
+0true. Reading images from a file is slow. Setting useCache to true will save the image to memory so that the next time the filepath is encountered the image can be loaded from memory rather than the file.
+
+
+overlay.createImage(x, y, filepath, width = -1, height = -1, xOffset = 0, yOffset = 0, hScale = 1, vScale = 1, paletteId = -1, setTransparency = false, layer = 0, useCache = true)¶overlay.addImage by allowing the new image to be a transformation of the image file.
+
+
+
+-1, use the full width of the original image. Defaults to -1-1, use the full height of the original image. Defaults to -10011-1, use the original image’s palette. Defaults to -1false0true. Reading images from a file is slow. Setting useCache to true will save the image to memory so that the next time the filepath is encountered the image can be loaded from memory rather than the file.
+
+
+overlay.addTileImage(x, y, tileId, xflip, yflip, palette, setTransparency = false, layer = 0)¶
+
+
+
+false0
+
+
+overlay.addTileImage(x, y, tile, setTransparency = false, layer = 0)¶
+
+
+
+false0
+
+
overlay.addMetatileImage(x, y, metatileId, setTransparency = false, layer = 0)¶
+
+
+
+false0Settings Functions¶
utility object.
-
map.getGridVisibility()¶utility.getGridVisibility()¶
-
map.setGridVisibility(visible)¶utility.setGridVisibility(visible)¶
-
map.getBorderVisibility()¶utility.getBorderVisibility()¶
-
map.setBorderVisibility(visible)¶utility.setBorderVisibility(visible)¶
-
map.getSmartPathsEnabled()¶utility.getSmartPathsEnabled()¶
-
map.setSmartPathsEnabled(enabled)¶utility.setSmartPathsEnabled(enabled)¶
-
-
-map.getBaseGameVersion()¶
-
-"pokeruby", "pokefirered", or "pokeemerald"
-
-
-map.getPorymapVersion()¶MAJOR.MINOR.PATCH).
-
-
-
map.getCustomScripts()¶utility.getCustomScripts()¶
-
map.getMainTab()¶utility.getMainTab()¶0: Map, 1: Events, 2: Header, 3: Connections, 4: Wild Pokemon).
-
map.setMainTab(tab)¶utility.setMainTab(tab)¶0: Map, 1: Events, 2: Header, 3: Connections, 4: Wild Pokemon).
-
map.getMapViewTab()¶0: Metatiles, 1: Collision).utility.getMapViewTab()¶0: Metatiles, 1: Collision, 2: Prefabs).
-
map.setMapViewTab(tab)¶0: Metatiles, 1: Collision).utility.setMapViewTab(tab)¶0: Metatiles, 1: Collision, 2: Prefabs).
@@ -2737,9 +2857,10 @@
Utility Functions¶
utility object.
-
map.registerAction(functionName, actionName, shortcut = "")¶utility.registerAction(functionName, actionName, shortcut = "")¶Tools menu. Optionally, a keyboard shortcut (e.g. "Ctrl+P") can also be specified, assuming it doesn’t collide with any existing shortcuts used by Porymap. The function specified by functionName must have the export keyword.
-
map.setTimeout(func, delayMs)¶utility.setTimeout(func, delayMs)¶setTimeout() that is used in web browsers or NodeJS. The func argument is a JavaScript function (NOT the name of a function) which will be executed after a delay. This is useful for creating animations or refreshing the overlay at constant intervals.
-
map.log(message)¶utility.log(message)¶[INFO]. This is useful for debugging custom scripts.
-
map.warn(message)¶utility.warn(message)¶[WARN].
-
map.error(message)¶utility.error(message)¶[ERROR].
-
map.showMessage(text, informativeText, detailedText)¶utility.showMessage(text, informativeText, detailedText)¶OK button. Execution stops while the window is open.
-
map.showWarning(text, informativeText, detailedText)¶utility.showWarning(text, informativeText, detailedText)¶OK button. Execution stops while the window is open.
-
map.showError(text, informativeText, detailedText)¶utility.showError(text, informativeText, detailedText)¶OK button. Execution stops while the window is open.
-
map.showQuestion(text, informativeText, detailedText)¶utility.showQuestion(text, informativeText, detailedText)¶Yes and a No button. Execution stops while the window is open.
-
map.getInputText(title, label, default)¶utility.getInputText(title, label, default)¶OK and a Cancel button. Execution stops while the window is open.
-
map.getInputNumber(title, label, default, min, max, decimals, step)¶utility.getInputNumber(title, label, default, min, max, decimals, step)¶OK and a Cancel button. Execution stops while the window is open.
-
+map.getInputItem(title, label, items, default, editable)¶utility.getInputItem(title, label, items, default, editable)¶OK and a Cancel button. Execution stops while the window is open.
+
+
+utility.getMapNames()¶
+
+
+
+
+utility.getTilesetNames()¶
+
+
+
+
+utility.getPrimaryTilesetNames()¶
+
+
+
+
+utility.getSecondaryTilesetNames()¶
+
+
+
+
+utility.getMetatileBehaviorNames()¶
+
+
+
+
+utility.getSongNames()¶
+
+
+
+
+utility.getLocationNames()¶
+
+
+
+
+utility.getWeatherNames()¶
+
+
+
+
+utility.getMapTypeNames()¶
+
+
+
+
+utility.getBattleSceneNames()¶
+
+
+
+
+utility.isPrimaryTileset(tilesetName)¶
+
+
+
+
+
+
utility.isSecondaryTileset(tilesetName)¶
+
+
+
+Constants¶
+constants object.
+
+
+constants.max_primary_tiles¶
+
+
+constants.max_secondary_tiles¶
+
+
+constants.max_primary_metatiles¶
+
+
+constants.max_secondary_metatiles¶
+
+
+constants.layers_per_metatile¶2 or 3, depending on the config setting enable_triple_layer_metatiles.
+
+
+constants.tiles_per_metatile¶8 or 12, depending on the config setting enable_triple_layer_metatiles.
+
+
+constants.base_game_version¶base_game_version. This will either be pokeruby, pokefirered, or pokeemerald.
+
+
+constants.version.major¶5.0.1 this will be 5.
+
+
+constants.version.minor¶5.0.1 this will be 0.
+
+
constants.version.patch¶5.0.1 this will be 1.
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
%Appdata%\pret\porymap\porymap.cfg on Windows, ~/Library/Application\ Support/pret/porymap/porymap.cfg on macOS).
A config file is also created when opening a project in porymap for the first time. It is stored in
your project root as porymap.project.cfg. There are several project-specific settings that are
-determined by this file.
A second config file is created for user-specific settings. It is stored in
+your project root as porymap.user.cfg. You should add this file to your gitignore.
|
- | global |
+user |
yes |
The map that will be opened on launch |
yes |
Whether porymap will monitor changes to project files |
-
|
-32x20 |
-global |
-yes |
-The dimensions of the region map tilemap |
-|
|
+|||||
|
default |
global |
yes |
The color theme for porymap windows and widgets |
|
|
+|||||
|
global |
yes |
The command that will be executed when clicking the button next the |
||
|
+|||||
|
global |
yes |
The command that will be executed when clicking |
||
|
+|||||
|
project |
no |
The base pret repo for this project |
||
|
+|||||
|
1 |
-project |
+user |
yes |
Enables wild encounter table editing |
|
+|||||
|
0 |
project |
yes |
Whether to open .pory files for scripts |
|
|
+|||||
|
0 |
project |
yes |
Whether to allow variable border sizes |
|
|
+|||||
|
1 if not |
project |
yes |
Allows adding Weather Trigger events |
|
|
+|||||
|
1 if not |
project |
yes |
Allows adding Secret Base events |
|
|
+|||||
|
1 if |
project |
yes |
Allows adding Clone Object events |
|
|
+|||||
|
1 if |
project |
yes |
Adds |
|
|
+|||||
|
1 if |
project |
yes |
Adds |
|
|
+|||||
|
1 if |
project |
yes |
Adds |
|
|
+|||||
|
1 if |
project |
yes |
Adds |
|
|
+|||||
|
1 if not |
project |
yes |
A |
|
|
+|||||
|
0 |
project |
yes |
Enables triple-layer metatiles (See https://github.com/pret/pokeemerald/wiki/Triple-layer-metatiles) |
|
|
+1 |
+project |
+yes |
+The metatile id that will be used to fill new maps |
+|
|
+3 |
+project |
+yes |
+The elevation that will be used to fill new maps |
+|
|
+
|
+project |
+yes |
+The list of metatile ids that will be used to fill the 2x2 border of new maps |
+|
|
+
|
+project |
+yes |
+The label of the default primary tileset |
+|
|
+
|
+project |
+yes |
+The label of the default secondary tileset |
+|
|
- | project |
+user |
yes |
A list of script files to load into the scripting engine |
yes |
The filepath containing prefab JSON data |
+
|
+0 |
+project |
+no |
+Keeps track of whether or not the project was prompted for importing default prefabs |
+|
|
+1 |
+project |
+yes |
+Whether new tileset headers should have the |
+|
|
+1 |
+project |
+yes |
+Whether new tileset headers should have the |
+
Some of these settings can be toggled manually in porymap via the Options menu.
diff --git a/docs/objects.inv b/docs/objects.inv index 950099c63ef7f4e57553b85f059f23312e29a71e..08474987a4e0e8f90a660b3f59fb07b6f3ab9b8f 100644 GIT binary patch delta 1813 zcmV+w2kQ9F4fhU^cYohg+c*%%-}6^^=I+&$_IlS|-+)5POrg1iEA11bSc@Z&EuU5f z(!c&B|B4-)FqJlM#F9ReR=d)EWs|5J4a*H4EEvK~$}+fl0F6TB(H(wZ#%Qr94MeY_ zjO8VhuQ1V~Fd|RmgcWQdq%Z>TU}-Y>+wW04NjjorD@(d5K!4w4V3-jSf|(h6x+%2C zm|k^IB&E_35$tbHKhiaqhFMW)m#J|fJKQ^^>1ZM+q!r90OHW$Hii1U&+=Dq2QaZ?O znJ30YjVI$wt85MuYKS*5QCTL8fBO{7k(BE3Slru+;ha;nbx26FGS5Rn$9AbD%oE5V zj3ZTYA4X7`gMa=gGRU1XA_43(h;(TPKo`v}aLx%}*Mgg65a&cmDKIE1EQQF_rxG5R z2_4LtR7zi#*#dMBhhWLSs3d$ot;Za-J1LUjj$z3jgwiCi(>zgSZa`nH3Lqf{#z%|! z!WJNjNH*d6TChZz6(P`tF&&P~{8ykg6FD8PNqk5^VSfQ&w}xq*j#jKSnixwm(s`SX zQjc{L96s9N>Reference
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project somewhat adheres to Semantic Versioning. The MAJOR version number is bumped when there are breaking changes in the pret projects.
-The “Breaking Changes” listed below are changes that have been made in the decompilation projects (e.g. pokeemerald), which porymap requires in order to work properly. If porymap is used on a project that is not up-to-date with the breaking changes, then porymap will likely break or behave improperly.
+The “Breaking Changes” listed below are changes that have been made in the decompilation projects (e.g. pokeemerald), which porymap requires in order to work properly. It also includes changes to the scripting API that may change the behavior of existing porymap scripts. If porymap is used with a project or API script that is not up-to-date with the breaking changes, then porymap will likely break or behave improperly.
+Proper support for pokefirered’s clone objects was added, which requires the changes made in pokefirered/#484.
Warp IDs are now treated as strings, which requires the change to mapjson made in pokeemerald/#1755. Additionally MAP_NONE was renamed to MAP_DYNAMIC. Both changes also apply to pokefirered and pokeruby.
Many API functions which were previously accessible via the map object are now accessible via one of the new objects overlay, utility, or constants. Some functions were renamed accordingly. See porymap/#460 for a full list of API function name changes.
Arguments for the API function createImage have changed: xflip and yflip have been replaced with hScale and vScale, and offset has been replaced with xOffset and yOffset.
The API function addFilledRect has been removed; it’s been replaced by new arguments in addRect: color has been replaced with borderColor and fillColor, and a new rounding argument allows ellipses to be drawn.
Add Copy/Paste for metatiles in the Tileset Editor.
Add new features to the scripting API, including the ability to display message boxes and user input windows, set overlay opacity, get/set map header properties, read tile pixel data, and set blocks or metatile attributes using a raw value.
Add prefab support
Add Cut/Copy/Paste for metatiles in the Tileset Editor.
Add button to copy the full metatile label to the clipboard in the Tileset Editor.
Add option to not open the most recent project on launch.
Add ability to export an image of the primary or secondary tileset’s metatiles.
Add new config options for customizing how new maps are filled, setting default tilesets, and whether the most recent project should be opened on launch.
Add color picker to palette editor for taking colors from the screen.
Add new features to the scripting API, including the ability to display messages and user input windows, set the overlay’s opacity, rotation, scale, and clipping, interact with map header properties and the map border, read tile pixel data, and more.
Overhauled the region map editor, adding support for tilemaps, and significant customization. Also now supports pokefirered.
Previous settings will be remembered in the New Map Options window.
The Custom Attributes table for map headers and events now supports types other than strings.
If an object event is inanimate, it will always render using its first frame.
Only log “Unknown custom script function” when a registered script function is not present in any script.
Unused metatile attribute bits that are set are preserved instead of being cleared.
Unused metatile attribute bits are preserved instead of being cleared.
The wild encounter editor is automatically disabled if the encounter JSON data cannot be read
Metatiles are always rendered accurately with 3 layers, and the unused layer is not assumed to be transparent.
object_event_graphics_info.h can now be parsed correctly if it uses structs with attributes.
Tileset data in headers, graphics, and metatiles can now be parsed if written in C.
The amount of time it takes to render the event panel has been reduced, which is most noticeable when selecting multiple events at once.
The selection is no longer reset when pasting events. The newly pasted events are selected instead.
The currently selected event for each event group will persist between tabs.
An object event’s sprite will now render if a number is specified instead of a graphics constant.
Palette editor ui is updated a bit to allow hex and rgb value input.
Heal location constants will no longer be deleted if they’re not used in the data tables.
The heal location prefixes SPAWN_ and HEAL_LOCATION_ may now be used interchangeably.
The number and order of entries in the heal location data tables can now be changed arbitrarily, and independently of each other.
The metatile behavior is now displayed in the bottom bar mouseover text.
Number values are now allowed in the Tileset Editor’s Metatile Behavior field.
Removed some unnecessary error logs from the scripting API and added new useful ones.
If any JSON data is the incorrect type Porymap will now attempt to convert it.
Fix events losing their assigned script when the script autocomplete is used.
Fix the unsaved changes indicator not disappearing when saving changes to events.
Fix copy and paste for events not including their custom attributes.
Fix cursor tile outline not updating at the end of a dragged selection.
Fix cursor tile and player view outlines exiting map bounds while painting.
Fix cursor tile and player view outlines not updating immediately when toggled in Collision view.
Fix selected space not updating while painting in Collision view.
Fix collision values of 2 or 3 not rendering properly.
Fix the map tree view arrows not displaying for custom themes.
Fix the map music dropdown being empty when importing a map from Advance Map.
Fix object events added by pasting ignoring the map event limit.
Fixed a bug where saving the tileset editor would reselect the main editor’s first selected metatile.
Fix a bug where saving the tileset editor would reselect the main editor’s first selected metatile.
Fix crashes / unexpected behavior if certain scripting API functions are given invalid palette or tile numbers.
Fix drawing large amounts of text with the scripting API causing a significant drop in performance.
Silence unnecessary error logging when parsing C defines Porymap doesn’t use.
Fix some windows like the Tileset Editor not raising to the front when reactivated.
Fix incorrect limits on Floor Number and Border Width/Height in the New Map Options window.
Fix Border Width/Height being set to 0 when creating a new map from an existing layout.
Fix certain UI elements not highlighting red on some platforms.
Fix Open Config Folder not responding
Properly update the minimum offset for a connection when the map is changed.
WSL project paths are now supported. (For example, \wsl$\Ubuntu-20.04\home\huderlem\pokeemerald)
Add ability to export map timelapse animated GIFs with File -> Export Map Timelapse Image....
New events will be placed in the center of the current view of the map.
Scripting API errors are more detailed and logged in more situations.
Fix % operator in C defines not being evaluated
Fix tileset palette editor crash that could occur when switching maps or tilesets with it open.
Add undoable edit history for Events tab.
Add keyboard shortcut for DEL key to delete the currently selected event(s).
Script combo-box, and Tools -> Open Project in Text Editor. The tool-button will open the containing file to the cooresponding script.
Holding shift now toggles “Smart Path” drawing; when the “Smart Paths” checkbox is checked, holding shift will temporarily disable it.
Fix a bug with the current metatile selection zoom.
Fix bug preventing the status bar from updating the current position while dragging events.
Add keyboard shortcut Ctrl + D for duplicating map events.
Add keyboard shortcut Ctrl + Shift + Z for “redo” in the tileset editor.
Add scripting api to reorder metatile layers and draw them with opacity.
The tileset editor now syncs its metatile selection with the map’s metatile selector.
The number of object events per map is now limited to OBJECT_EVENT_TEMPLATES_COUNT
The tileset editor can now flip selections that were taken from an existing metatile.
Fix bug where editing a metatile layer would have no effect.
Fix a crash that occured when creating a new tileset using triple layer mode.
Add triple-layer metatiles support.
The “Open Scripts” button will fall back to scripts.inc if scripts.pory doesn’t exist.
Fix bug where exported tileset images could be horizontally or vertically flipped.
Fix bug where the map list wasn’t filtered properly after switching filter types.
Add more project-specific configs to better support porting features from different projects.
Add metatile label names to the status bar when hovering over metatiles in the map editor tab.
Add mouse coordinates to the status bar when hovering in the events tab.
metatile_labels.h is now watched for changes.
Reduce time it takes to load maps and save in the tileset editor.
Fix crash that could occur when parsing unknown symbols when evaluating define expressions.
Add scripting capabilities, which allows the user to add custom behavior to Porymap using JavaScript scripts.
Add ability to import FRLG tileset .bvd files from Advance Map 1.92.
Edit modes are no longer shared between the Map and Events tabs. Pencil is default for Map tab, and Pointer is default for Events tab.
Disallow drawing new heal locations in the events tab.
Fix issue where the metatile selection window was not resizable.
If you are using pokeemerald or pokeruby, there were changes made in pokeemerald/#1010 and pokeruby/#776 that you will need to integrate in order to use this version of porymap.
Support for pokefirered. Kanto fans rejoice! At long last porymap supports the FRLG decompilation project.
Add ability to export map stitches with File -> Export Map Stitch Image....
Move, and Map Shift tools to the Events tab.
Porymap now saves map and encounter json data in an order consistent with the upstream repos. This will provide more comprehensible diffs when files are saved.
Update Porymap icon.
Fix bug where pressing TAB key did not navigate through widgets in the wild encounter tables.
Fix bug that allowed selecting an invalid metatile in the metatile selector.
Fix bug on Mac where tileset images were corrupted when saving.
pokeemerald and pokeruby both underwent a naming consistency update with respect to “object events”. As such, these naming changes break old versions of Porymap.
Add optional support for Poryscript script files via the use_poryscript config option.
Selecting a group of metatiles from the map area now also copies the collision properties, too.
Add keyboard shortcut Ctrl + G for toggling the map grid.
Draw map connections with the current map’s tilesets to more accurately mimic their appearance in-game.
Fix index-out-of-bounds crash when deleting the last event in an event type group.
Fix bug where exporting tileset images could add an extra row of junk at the end.
Accomodate event object graphics pointer table being explicitly indexed. From changes introduced in commits cdae0c1444bed98e652c87dc3e3edcecacfef8be and 0e8ccfc4fd3544001f4c25fafd401f7558bdefba.
New “field” key in wild encounter JSON data from pokeemerald and pokeruby commits adb0a444577b59eb02788c782a3d04bc285be0ba and https://github.com/pret/pokeruby/commit/c73de8bed752ca538d90cfc93c4a9e8c7965f8c9.
Add wild encounter table editor.
Add dark themes.
Exporting map images is now more configurable. Events, connections, collision, etc. can be toggled on and off before exporting the image.
The entire Tileset Editor selection is now conveniently flipped when selecting x-flip or y-flip.
Autocomplete for porymap’s comboboxes no longer require typing the full string prefix.
Fix bug where map group names were hardcoded when creating a new map.
Fix bug in Tileset Editor where multi-tile selections weren’t properly painted when clicking on the bottom row of the metatile layers.
Add region map editor
Add ability to add new tilesets
Add official Porymap documentation website: https://huderlem.github.io/porymap/
Event sprites now display as facing the direction of their movement type.
Default values for newly-created events now use valid values from the project, rather than hardcoded values.
Fix bug in zoomed metatile selector where a large selection rectangle was being rendered.
Fix bug where edited map icons were not rendered properly.
Add ability to zoom in and out the map metatile selector via a slider at the bottom of the metatile selector window.
Fix crash when creating a new map from a layout that has no pre-existing maps that use it.
Fix bug where var_value, trainer_type and trainer_sight_or_berry_tree_id JSON fields were being interpreted as integers.
New JSON map data format in pokeemerald and pokeruby from commits 82abc164dc9f6a74fdf0c535cc1621b7ed05318b and a0ba1b7c6353f7e4f3066025514c05b323a0123d.
Add “magic fill” mode to fill tool (hold down CTRL key). This fills all matching metatiles on the map, rather than only the contiguous region.
Add ability to import tileset palettes (JASC, .pal, .tpl, .gpl, .act).
Collapse the map list by default.
Collision view now has a transparency slider to help make it easier to view the underlying metatiles.
Fix bug where smart paths could be auto-enabled, despite the checkbox being disabled.
Fix crash that could occur when changing the palette id in the tileset palette editor.
New map header format in pokeemerald from commit a1ea3b5e394bc115ba9b86348c161094a00dcca7.
Add porymap.project.cfg config file to project repos, in order to house project-specific settings, such as base_game_version=pokeemerald.
Write all logs to porymap.log file, so users can view any errors that porymap hits.
Changelog
Add porymap.cfg base config file, rather than using built-in system settings (e.g. registry on Windows).
Properly read/write map headers for pokeemerald.
Overhauled event editing pane, which now contains tabs for each different event. Events of the same type can be iterated through using the spinner at the top of the tab. This makes it possible to edit events that are outside the viewing window.
Creating new hidden-item events now uses a valid default flag value.
Fix bug where tilesets were sometimes not displaying their bottom row of metatiles.
Reference