- Joined
- Feb 8, 2014
- Messages
- 518
- Reaction score
- 223
- First Language
- English
- Primarily Uses
- RMVXA
Probably under 40 or so.
Once you have your collision maps set this way you can tell Hime's script to load a new collision map based on the combination of map id and rotation value.In the following example I am using map 42 as sample.
Map 42 standard view -> Collision map filename: map042
Map 42 90° rotation -> Collision map filename: map242
Map 42 180° rotation -> Collision map filename: map442
Map 42 270° rotation -> Collision map filename: map642
module HMRP
VARIABLE_ID = 100 # Change this to be the id of the variable you want to use to store the number of your rotations.
end
class Game_Map
def map_rotation
$game_variables[HMRP::VARIABLE_ID]
end
def check_passage(x, y, bit)
if use_collision_map?
x = x * TH::Collision_Maps::Tile_Width
y = y * TH::Collision_Maps::Tile_Height
new_map_id = 200 * map_rotation + @map_id
return Cache.collision_map(new_map_id)[x, y, 0] == 0
else
th_collision_maps_check_passage(x, y, bit)
end
end
end
class Spriteset_Map
def create_collision_map
@collision_map_sprite = Sprite.new
map_rotated_id = 200 * $game_map.map_rotation + $game_map.map_id
puts "OVERLAY: Map rotated id is: #{map_rotated_id}"
bmp = TH::Collision_Map_Overlay.draw_collision_map(map_rotated_id)
@collision_map_sprite.bitmap = Bitmap.new(bmp.width, bmp.height)
@collision_map_sprite.bitmap.blt(0, 0, bmp, bmp.rect, TH::Collision_Map_Overlay::Opacity)
end
end
module HMRP
VARIABLE_ID = 100 # Change this to be the id of the variable you want to use to store the number of your rotations.
end
class Game_Map
def map_rotation
$game_variables[HMRP::VARIABLE_ID]
end
def check_passage(x, y, bit)
if use_collision_map?
x = x * TH::Collision_Maps::Tile_Width
y = y * TH::Collision_Maps::Tile_Height
new_map_id = 200 * map_rotation + @map_id
puts "Collision map rotated id is: #{new_map_id}"
return Cache.collision_map(new_map_id)[x, y, 0] == 0
else
th_collision_maps_check_passage(x, y, bit)
end
end
end
module TH
module Collision_Maps
def self.load_collision_map(map_id)
path = sprintf(Path_Name, map_id)
puts "Collision map path is: #{path}"
bmp = Bitmap.new(path)
colltable = Table.new(bmp.width, bmp.height, 1)
@@makeCollisionTable.call(bmp.__id__, colltable.__id__, Tile_Width, Tile_Height)
return colltable
end
end
end

$game_player.x # this is player x coordinate
$game_player.y # this is player y coordinate
You might be lucky. In your screenshot I saw your free movement script above mine. Since mine overwrites check_passage - which is one of those that are aliased in the free movement script - in the latter instruction it is clearly stated that you have to put it BELOW every other script overwriting one of those methods. In your case changing your script order might be enough.I can definitely wait that long; it's not a big issue.