- 1
- Posts
- 4
- Years
- Seen Jul 30, 2021
Hey everyone, this is my first post on the forums. I have created a script that allows you to export all maps that are connected to each and combines them into a single image. The script is for pokemon essentials v17.2. I havnt tested it for any other version.
-Guide: in order to use this script
-Copy this code into a script section above main.
and also paste this code in the Editor_MapConnectionEditor script section, at line 778, or search for this "elsif Input.trigger?(Input::F5)" and paste the code below it.
-The script is executed by pressing the F8 key while in the map connections editor screen and the map will be exported to whatever filename you wrote down in ExportedWorldMapFileName (this can be found by searching "ExportedWorldMapFileName" in your scripts, and you can replace the value with whatever you suits you). By default it is "World_Map.png".
please provide any feedback, bugs or errors you may encounter while using this script, and I will do my best to fix them.
-Guide: in order to use this script
-Copy this code into a script section above main.
Spoiler:
Code:
ExportedWorldMapFileName = "World_Map.png"
class MapScreenScene
def CombineImages(maps)
sprites = maps.values
points = [sprites.map {|num| num.x},sprites.map {|num| num.y}]
x= points[0].max.abs + points[0].min.abs + sprites[points[0].index(points[0].min)].bitmap.width
y= points[1].max.abs + points[1].min.abs + sprites[points[1].index(points[1].min)].bitmap.height
bitmap=BitmapWrapper.new(x,y)
for i in sprites
new_bitmap = createMinimap3(maps.keys[sprites.index(i)])
bitmap.blt(points[0].min.abs + i.x,
points[1].min.abs + i.y,new_bitmap,new_bitmap.rect)
end
bitmap.saveToPng(ExportedWorldMapFileName)
print("bitmap was successfully exported to ", ExportedWorldMapFileName)
end
def createMinimap3(mapid)
map=load_data(sprintf("Data/Map%03d.rxdata",mapid)) rescue nil
return BitmapWrapper.new(32,32) if !map
bitmap=BitmapWrapper.new(map.width*4,map.height*4)
black=Color.new(0,0,0)
tilesets=load_data("Data/Tilesets.rxdata")
tileset=tilesets[map.tileset_id]
return bitmap if !tileset
helper=TileDrawingHelper.fromTileset(tileset)
for y in 0...map.height
for x in 0...map.width
for z in 0..2
id=map.data[x,y,z]
id=0 if !id
helper.bltSmallTile(bitmap,x*4,y*4,4,4,id)
end
end
end
return bitmap
end
end
and also paste this code in the Editor_MapConnectionEditor script section, at line 778, or search for this "elsif Input.trigger?(Input::F5)" and paste the code below it.
Spoiler:
Code:
elsif Input.trigger?(Input::F8)
CombineImages(@mapsprites)
-The script is executed by pressing the F8 key while in the map connections editor screen and the map will be exported to whatever filename you wrote down in ExportedWorldMapFileName (this can be found by searching "ExportedWorldMapFileName" in your scripts, and you can replace the value with whatever you suits you). By default it is "World_Map.png".
please provide any feedback, bugs or errors you may encounter while using this script, and I will do my best to fix them.
Last edited: