Midnite Reaper 2 Report post Posted January 10, 2011 (edited) Hi everyone, I need a script and tilesets for an isometric style game (think Final Fantasy Tactics advance) which work with charactersets like: I also need a script which incorporates this into the movement eg: up moves northwest, left moves southwest, down moves southeast, right moves northeast. I am sure these scripts exist out there somewhere and I have tried searching for them, but to no avail. Any help will be much appreciated. UPDATE: A RMVX demo called DrawIso Frame Modifies the parameters of a normal tileset to create the isometric feel. The scripts are below so if possible, can you run through them to see what makes this work? If you would like to check it, download is here: Gubi D's Isometric Map Render #============================================================================== # ** RSC Require #------------------------------------------------------------------------------ # Version 1.4.0 # * Yeyinde, 2007 #------------------------------------------------------------------------------ # Usage: require('My_RSCFile') or rsc_require('My_RSCFile') #============================================================================== #----------------------------------------------------------------------------- # * Aliasing #----------------------------------------------------------------------------- if @rsc_original_require.nil? alias rsc_original_require require @rsc_original_require = true end #----------------------------------------------------------------------------- # * require # file : the file to load, rsc files will be handled in it's own method #----------------------------------------------------------------------------- def require(file) begin rsc_original_require file rescue LoadError rsc_require file end end #----------------------------------------------------------------------------- # * rsc_require # file : the RSC file which will be loaded. The .rsc extension may # be ommited #----------------------------------------------------------------------------- def rsc_require(file) # Create error object load_error = LoadError.new("No such file to load -- #{file}") # Tack on the extension if the argument does not already include it. file += '.rsc' unless file.split('.')[-1] == 'rsc' # Iterate over all require directories $:.each do |dir| # Make the rout-to-file filename = dir + '/' + file # If load was successful if load_rsc(filename) # Load was successful return true end end # Raise the error if there was no file to load raise load_error end #----------------------------------------------------------------------------- # * load_rsc # file_name : the file to be evaluated #----------------------------------------------------------------------------- def load_rsc(file_name) file_name = file_name[2..file_name.length] if file_name[0..1] == './' # If the file exists and so does the encypted archive if File.exists?(file_name) && File.exists?('Game.rgssad') raise RSCSecurityError.new("Potential security breach: #{File.basename(file_name)} is a real file") end # Start a begin-rescue block begin # Load the data from the file script_data = load_data(file_name) # Iterate over each data entry in the array script_data.each_with_index do |data| # Store the script name script_name = data[0][0] # Store the script data after inflating it script = Zlib::Inflate.inflate(data[0][1]) # Start a begin-rescue block begin # Evaluate the script data eval(script) # If there is an error with the script rescue Exception => error # Remove the (eval): from the start of the message error.message.gsub!('(eval):', '') # Get the line number line = error.message.sub(/:[\w \W]+/) {$1} # Get the error details message = error.message.sub(/\d+:in `load_rsc'/) {''} # Print the error and details print "File '#{file_name}' script '#{script_name}' line #{line}: #{error.type} occured. #{message}" # Exit with value 1 (standard error) exit 1 end end # Load was a success return true # No file to load rescue Errno::ENOENT # Load was a failure return false end end #============================================================================== # ** RSCSecurityError #============================================================================== class RSCSecurityError < StandardError; end # Insert Game.exe's base folder into require array $: << '.' unless $:.include?('.') # Remove all nil objects $:.compact! #============================================================================== # ** RMXP Standard Development Kit (SDK) - RSC Require #------------------------------------------------------------------------------ # Build Date - 2005-11-22 # Version 1.0 - Near Fantastica - 2005-11-22 # Version 1.1 - SephirothSpawn - 2005-12-18 - (Near Fantastica) # Version 1.2 - Near Fantastica - 2005-12-18 - (Wachunga) # Version 1.3 - Wachunga - 2005-12-19 - (Near Fantastica) # Version 1.4 - Prexus - 2006-03-02 - (SephirothSpawn) # Version 1.5 - Jimme Reashu - 2006-03-25 - (Near Fantastica) # Version 2.0 - SephirothSpawn / Trickster / # Der Drake / Sandgolem - 2007-02-22 - (SDK Team) # Version 2.1 - tibuda /alexanderpas / Mr. Mo - 2007-02-25 - (SephirothSpawn) # Version 2.2 - SephirothSpawn / Trickster / # tibuda - 2007-04-04 - (SDK Team) # Version 2.3 - Rataime / SephirothSpawn / # Trickster / vgvgf - 2007-07-22 - (SDK Team) #============================================================================== Include_SDK_Parts = [2, 3, 4, 5] require 'RSC Hidden Files/The RMXP Standard Development Kit 2.3' #============================================================================== # ** Method and Class Library - RSC Setup #------------------------------------------------------------------------------ # Build Date - 9-17-2006 # Version 1.0 - Trickster - 9-17-2006 # Version 1.1 - Trickster - 10-03-2006 # Version 1.2 - Trickster - Selwyn - 11-01-2006 # Version 1.3 - Trickster - 11-10-2006 # Version 1.4 - Trickster - 12-1-2006 # Version 1.5 - Trickster - Yeyinde - Lobosque - 1-1-2007 # Version 2.0 - MACL Authors - 4-26-2007 # Version 2.1 - MACL Authors - 7-22-2007 #============================================================================== #============================================================================== # ** General Method & Class Library Settings #============================================================================== module MACL #------------------------------------------------------------------------- # * Pose Names for Charactersets #------------------------------------------------------------------------- Poses = ['down', 'left', 'right', 'up'] #------------------------------------------------------------------------- # * Number of Frames Per Pose for charactersets #------------------------------------------------------------------------- Frames = 4 #-------------------------------------------------------------------------- # * Real Elements #-------------------------------------------------------------------------- Real_Elements = 1, 2, 3, 4, 5, 6, 7, 8 #------------------------------------------------------------------------- # * Version Number (Do not Touch) #------------------------------------------------------------------------- Version = 2.1 #------------------------------------------------------------------------- # * Loaded Libraries (Do not Touch) #------------------------------------------------------------------------- Loaded = [] end #============================================================================== # ** Action Test Setup #============================================================================== class Game_BattleAction #------------------------------------------------------------------------- # * Attack Using # - Set this to the basic ids that perform an attack effect #------------------------------------------------------------------------- ATTACK_USING = [0] #------------------------------------------------------------------------- # * Skill Using # - Set this to the kinds that perform an skill effect #------------------------------------------------------------------------- SKILL_USING = [1] #------------------------------------------------------------------------- # * Defend Using # - Set this to the basic ids that perform an defend effect #------------------------------------------------------------------------- DEFEND_USING = [1] #------------------------------------------------------------------------- # * Item Using # - Set this to the kinds that perform a item using effect #------------------------------------------------------------------------- ITEM_USING = [2] #------------------------------------------------------------------------- # * Escape Using # - Set this to the basic ids that perform an escape effect #------------------------------------------------------------------------- ESCAPE_USING = [2] #------------------------------------------------------------------------- # * Wait Using # - Set this to the basic ids that perform a wait effect #------------------------------------------------------------------------- WAIT_USING = [3] end #============================================================================== # ** Animated Autotile Settings #============================================================================== RPG::Cache::Animated_Autotiles_Frames = 16 #============================================================================== # ** Bitmap Settings #============================================================================== class Bitmap #-------------------------------------------------------------------------- # * Bitmap.draw_equip settings # # Icon Type Settings When Item Not Equipped # - Draw_Equipment_Icon_Settings = { type_id => icon_name, ... } # # Default Type Icons # - Draw_Equipment_Icon_Settings.default = icon_name #-------------------------------------------------------------------------- Draw_Equipment_Icon_Settings = { 0 => '001-Weapon01', 1 => '009-Shield01', 2 => '010-Head01', 3 => '014-Body02', 4 => '016-Accessory01' } Draw_Equipment_Icon_Settings.default = '001-Weapon01' #-------------------------------------------------------------------------- # * Bitmap.draw_blur settings # # Master Default Settings # - Default_Blur_Settings = { setting_key => setting, ... } # # Class Default Settings # - @@default_blur_settings = { setting_key => setting, ... } # # Settings # 'offset' - Pixels to be offseted when bluring # 'spacing' - Number of times to offset blur # 'opacity' - Max Opacity of blur #-------------------------------------------------------------------------- Default_Blur_Settings = {'offset' => 2, 'spacing' => 1, 'opacity' => 255} @@default_blur_settings = {'offset' => 2, 'spacing' => 1, 'opacity' => 255} #-------------------------------------------------------------------------- # * Bitmap.draw_anim_sprite settings # # Master Default Settings # - Default_Anim_Sprite_Settings = { setting_key => setting, ... } # # Class Default Settings # - @@default_anim_sprite_settings = { setting_key => setting, ... } # # Settings # 'f' - Frame count reset # 'w' - Number of frames wide in sprite set # 'h' - Height of frames wide in sprite set #-------------------------------------------------------------------------- Default_Anim_Sprite_Settings = {'f' => 8, 'w' => 4, 'h' => 4} @@default_anim_sprite_settings = {'f' => 8, 'w' => 4, 'h' => 4} end #============================================================================== # ** RPG::State #============================================================================== class RPG::State #-------------------------------------------------------------------------- # * Normal Icon (Filename for normal (no states)) #-------------------------------------------------------------------------- Normal_Icon = '050-Skill07' #-------------------------------------------------------------------------- # * Icon Names # # Icon_Name = { state_id => 'filename', ... } # # Use Nil to default back to state name #-------------------------------------------------------------------------- Icon_Name = { 1 => '046-Skill03', 2 => 'Stop', 3 => 'Venom', 4 => 'Darkness', 5 => 'Mute', 6 => 'Confused', 7 => 'Sleep', 8 => 'Paralysis', 9 => '047-Skill04', 10 => '047-Skill04', 11 => 'Slow', 12 => '047-Skill04', 13 => '045-Skill06', 14 => '045-Skill06', 15 => '045-Skill06', 16 => '045-Skill06' } Icon_Name.default = nil end #------------------------------------------------------------------------------ # ** Reqire MACL 2.1 #------------------------------------------------------------------------------ require 'RSC Hidden Files/The Method and Class Library 2.1' #------------------------------------------------------------------------------ # ** SDK Log #------------------------------------------------------------------------------ if Object.const_defined?(:SDK) SDK.log('Method & Class Library', 'MACL Authors', 2.1, '??????????') end #============================================================================== # Isometric Script by GubiD - Original Concept from MCaladtogel #============================================================================== # ■ Scene_Title #============================================================================== class Scene_Title #-------------------------------------------------------------------------- # ● Loads MapInfos so that Iso map id's can be loaded according to the current map. #-------------------------------------------------------------------------- def initialize $data_map_info = load_data("Data/MapInfos.rxdata") end end #============================================================================== # ** Game_Map #------------------------------------------------------------------------------ # This class handles maps. It includes scrolling and passage determination # functions. The instance of this class is referenced by $game_map. #============================================================================== class Game_Map #============================================================================ # CONSTANTS #============================================================================ # CENTER_X and CENTER_Y is for Scrolling #---------------------------------------------------------------------------- #if GTBS::VX # TILESIZE = 256 # CENTER_X = (544 / 2 - 16) * 8 # Screen center X coordinate * 8 # CENTER_Y = (416 / 2 - 16) * 8 # Screen center Y coordinate * 8 #else TILESIZE = 128 CENTER_X = (640 / 2 - 16) * 4 # Center screen x-coordinate * 4 CENTER_Y = (480 / 2 - 16) * 4 # Center screen y-coordinate * 4 #end #-------------------------------------------------------------------------- # * Set Map Display Position to Center of Screen # x : x-coordinate # y : y-coordinate #-------------------------------------------------------------------------- def center(x, y, rtn_coords = false) iso_center(x,y,rtn_coords) if iso? cx = (x*TILESIZE)-CENTER_X cy = (y*TILESIZE)-CENTER_Y cx = [[0,cx].max, ((self.width-20)*TILESIZE)].min cy = [[0,cy].max, ((self.height-15)*TILESIZE)].min if rtn_coords return cx, cy else set_display_pos(cx, cy) end end #-------------------------------------------------------------------------- # * Update Scroll #-------------------------------------------------------------------------- def iso_center(x, y, rtn_coord = false) #Get X,Y coords using iso function disp_x = ((x*32)-(y*32))+(self.height*32) disp_y = (((x*32)+(y*32))/8) + 24 disp_y = adjust_height(x,y,disp_y) #Convert to 128 from 32 if GTBS::VX disp_x*=8 disp_y*=8 else disp_x*=4 disp_y*=4 end #Minus, center amount from current position center_x = disp_x-CENTER_X center_y = disp_y-CENTER_Y #Confirm not out of bounds center_x = [[0,center_x].max, (self.width *TILESIZE)-CENTER_X].min center_y = [[0,center_y].max, (self.height*TILESIZE)-CENTER_Y].min #If return scroll amounts required for center if rtn_coord return (center_x-self.display_x), (center_y-self.display_y) else #Set the current display to be centered set_display_pos(center_x, center_y) end end #-------------------------------------------------------------------------- # Adjust height by 8 pixels for every height - here for use by advanced #-------------------------------------------------------------------------- def adjust_height(x,y,disp_y) return disp_y end #-------------------------------------------------------------------------- # * Identifies if map is designated for ISO views or not #-------------------------------------------------------------------------- def iso? map = $data_map_info[@map_id] return false if map == nil return map.name.include?("ISO") if map.parent_id != 0 end #-------------------------------------------------------------------------- # Iso ID - returns the maps parent id #-------------------------------------------------------------------------- def iso_id map = $data_map_info[@map_id] return map.parent_id end #-------------------------------------------------------------------------- # * Get Map Data #-------------------------------------------------------------------------- def data return @iso_map.data if !@iso_map.nil? return @map.data end #-------------------------------------------------------------------------- # * Get Width #-------------------------------------------------------------------------- def iso_width return @iso_map.width end #-------------------------------------------------------------------------- # * Get Height #-------------------------------------------------------------------------- def iso_height return @iso_map.height end #-------------------------------------------------------------------------- # * Setup # map_id : map ID #-------------------------------------------------------------------------- alias gtbs_iso_gmsetup setup def setup(map_id) @map_id = map_id gtbs_iso_gmsetup(map_id) if !iso? @iso_map = nil else @iso_map = load_data(sprintf("Data/Map%03d.rxdata", iso_id)) end if !@iso_map.nil? tileset = $data_tilesets[@iso_map.tileset_id] @tileset_name = tileset.tileset_name @autotile_names = tileset.autotile_names @panorama_name = tileset.panorama_name @panorama_hue = tileset.panorama_hue @fog_name = tileset.fog_name @fog_hue = tileset.fog_hue @fog_opacity = tileset.fog_opacity @fog_blend_type = tileset.fog_blend_type @fog_zoom = tileset.fog_zoom @fog_sx = tileset.fog_sx @fog_sy = tileset.fog_sy @battleback_name = tileset.battleback_name @priorities = tileset.priorities end end #-------------------------------------------------------------------------- # * Scroll Down # distance : scroll distance #-------------------------------------------------------------------------- alias iso_scdwn scroll_down def scroll_down(distance) if !iso? iso_scdwn(distance) else last_y = @display_y corr = ((height + width)%2 == 0 ? 0 : 4*16) @display_y = [@display_y + distance, (iso_height - 15) * 128].min end end #-------------------------------------------------------------------------- # * Scroll Right # distance : scroll distance #-------------------------------------------------------------------------- alias iso_scrght scroll_right def scroll_right(distance) if !iso? iso_scrght(distance) else last_x = @display_x @display_x = [@display_x + distance, (iso_width - 20) * 128].min end end #-------------------------------------------------------------------------- # * Determine if Passable # x : x-coordinate # y : y-coordinate # d : direction (0,2,4,6,8,10) # * 0,10 = determine if all directions are impassable # self_event : Self (If event is determined passable) #-------------------------------------------------------------------------- def passable?(x, y, d, self_event = nil) # If coordinates given are outside of the map unless valid?(x, y) # impassable return false end # Change direction (0,2,4,6,8,10) to obstacle bit (0,1,2,4,8,0) bit = (1 << (d / 2 - 1)) & 0x0f # Loop in all events for event in events.values # If tiles other than self are consistent with coordinates if event.tile_id >= 0 and event != self_event and event.x == x and event.y == y and not event.through # If obstacle bit is set if @passages[event.tile_id] & bit != 0 # impassable return false # If obstacle bit is set in all directions elsif @passages[event.tile_id] & 0x0f == 0x0f # impassable return false # If priorities other than that are 0 elsif @priorities[event.tile_id] == 0 # passable return true end end end # Loop searches in order from top of layer for i in [2, 1, 0] # Get tile ID tile_id = @map.data[x, y, i] # Tile ID acquistion failure if tile_id == nil # impassable return false # If obstacle bit is set elsif @passages[tile_id] & bit != 0 # impassable return false # If obstacle bit is set in all directions elsif @passages[tile_id] & 0x0f == 0x0f # impassable return false # If priorities other than that are 0 elsif @priorities[tile_id] == 0 # passable return true end end # passable return true end end #============================================================================== # ■ Game_Character #============================================================================== class Game_Character #-------------------------------------------------------------------------- # ● Update the position of the characters to the screen according to x,y in isometric #-------------------------------------------------------------------------- alias gc_iso_scr_x screen_x def screen_x if !$game_map.iso? return gc_iso_scr_x else return (@real_x - @real_y)/4 + 32*$game_map.height - $game_map.display_x/4 end end #-------------------------------------------------------------------------- alias gc_iso_scr_y screen_y def screen_y if !$game_map.iso? return gc_iso_scr_y else y = (@real_y + @real_x) / 8 + 24 - $game_map.display_y/4 if @jump_count >= @jump_peak n = @jump_count - @jump_peak else n = @jump_peak - @jump_count end return y - (@jump_peak * @jump_peak - n * n) / 2 end end end class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- alias gmpl_iso_update update def update gmpl_iso_update if $game_map.iso? update_iso_scroll(@real_x, @real_y) end end #-------------------------------------------------------------------------- # * Update Scroll #-------------------------------------------------------------------------- def update_iso_scroll(last_real_x, last_real_y) return if !$game_map.iso? disp_y = screen_y + $game_map.display_y/4 disp_x = screen_x + $game_map.display_x/4 if CENTER_Y - (4*disp_y - $game_map.display_y) < 0 $game_map.scroll_down(4*disp_y - $game_map.display_y - CENTER_Y) end if CENTER_X - (4*disp_x - $game_map.display_x) > 0 $game_map.scroll_left(CENTER_X - (4*disp_x - $game_map.display_x)) end if CENTER_X - (4*disp_x - $game_map.display_x) < 0 $game_map.scroll_right(4*disp_x - $game_map.display_x - CENTER_X) end if CENTER_Y - (4*disp_y - $game_map.display_y) > 0 $game_map.scroll_up(CENTER_Y - (4*disp_y - $game_map.display_y)) end end #-------------------------------------------------------------------------- # * Set Map Display Position to Center of Screen # x : x-coordinate # y : y-coordinate #-------------------------------------------------------------------------- alias gp_iso_ctr center def center(x, y) if !$game_map.iso? gp_iso_ctr(x, y) else update_iso_scroll(@real_x, @real_y) end end end #============================================================================== # Isometric Height Script by GubiD - Original Concept by Siegfried and MCaladtogel #============================================================================== # ** Global variables #============================================================================== ISO_ENABLE_JUMP = true #Enable Jump while on maps? MOVE_WHILE_JUMP = true #Enable Player to move while jumping? CLIMBABLE_MOVE = 2 #The height change that you can climb without jump (jumping can add up to 2) DROPABLE_MOVE = -4 #The height change that you can walk down (MUST be negative) #============================================================================== # ** Game_Map #------------------------------------------------------------------------------ # This class handles maps. It includes scrolling and passage determination # functions. The instance of this class is referenced by $game_map. #============================================================================== class Game_Map #-------------------------------------------------------------------------- # * Public Instance Variables #-------------------------------------------------------------------------- attr_reader :map # map screen state #-------------------------------------------------------------------------- # Adjust height by 8 pixels for every height #-------------------------------------------------------------------------- def adjust_height(x,y,disp_y) h = screen_th(x,y) return disp_y-(h*8) end #-------------------------------------------------------------------------- # ● Screen_th : height of the ground #-------------------------------------------------------------------------- def screen_th(x=0,y=0) return 0 if !iso? tile_id = @map.data[x,y,0] t_x = (tile_id - 384) % 8 t_y = (tile_id - 384) / 8 th = t_x + t_y * 8 return th end end #============================================================================== # ● Game_Character #============================================================================== class Game_Character #-------------------------------------------------------------------------- # ● Initialize #-------------------------------------------------------------------------- alias gc_iso_init initialize def initialize @h = 0 @th = 0 gc_iso_init end #-------------------------------------------------------------------------- # ● Screen_th : height of the ground #-------------------------------------------------------------------------- def screen_th(x=self.x,y=self.y) return 0 if !$game_map.iso? tile_id = $game_map.map.data[x,y,0] t_x = (tile_id - 384) % 8 t_y = (tile_id - 384) / 8 th = t_x + t_y * 8 return th end #-------------------------------------------------------------------------- # ● Screen_h : height of the character #-------------------------------------------------------------------------- def screen_h return @h end #-------------------------------------------------------------------------- # ● Update #-------------------------------------------------------------------------- alias gc_iso_update update def update if !$game_map.iso? gc_iso_update else if @h < screen_th @h += 1 #if !jumping? elsif @h > screen_th if !jumping? if (@h - screen_th) > 2 @h -= [0.5 * 2, 1].min else @h -= 0.5 end end elsif @h == screen_th and jumping? end gc_iso_update end end #-------------------------------------------------------------------------- # ● Update the position of the characters to the screen according to x,y in isometric #-------------------------------------------------------------------------- alias gc2_iso_scr_y screen_y def screen_y y = gc2_iso_scr_y @h = 0 if @h == nil y -= @h*8 if $game_map.iso? return y end #-------------------------------------------------------------------------- alias gc_iso_scr_z screen_z def screen_z(h=0) if !$game_map.iso? return gc_iso_scr_z(h) else if h > 32 z = 8 end z += (self.screen_h * 8) return z end end #============================================================================== # ● Passabilities and interactions with events #============================================================================== #-------------------------------------------------------------------------- # * Determine if Passable # x : x-coordinate # y : y-coordinate # d : direction (0,2,4,6,8) # * 0 = Determines if all directions are impassable (for jumping) #-------------------------------------------------------------------------- alias gc_iso_passable? passable? def passable?(x, y, d) # Get new coordinates new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0) new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0) # If coordinates are outside of map unless $game_map.valid?(new_x, new_y) # impassable return false end # If through is ON if @through # passable return true end h = screen_h new_h = screen_th(new_x,new_y) if !((CLIMBABLE_MOVE+((@jump_count/2)/2)) >= (new_h-h) and DROPABLE_MOVE <= (new_h-h)) return false end # If unable to leave first move tile in designated direction unless $game_map.passable?(x, y, d, self) # impassable return false end # If unable to enter move tile in designated direction unless $game_map.passable?(new_x, new_y, 10 - d) # impassable return false end # Loop all events for event in $game_map.events.values # If event coordinates are consistent with move destination if event.x == new_x and event.y == new_y # If through is OFF unless event.through # If self is event if self != $game_player # impassable return false end # With self as the player and partner graphic as character if event.character_name != "" # impassable return false end end end end # If player coordinates are consistent with move destination if $game_player.x == new_x and $game_player.y == new_y # If through is OFF unless $game_player.through # If your own graphic is the character if @character_name != "" # impassable return false end end end # passable return true end end #============================================================================== # ● Game_Event #============================================================================== class Game_Event < Game_Character #-------------------------------------------------------------------------- # ● Start #-------------------------------------------------------------------------- alias ge_iso_evnt_start start def start if !$game_map.iso? ge_iso_evnt_start return end h = screen_th($game_player.x, $game_player.y) ev_h = screen_th if @list.size > 1 and (ev_h - h).abs <= 1 @starting = true end end end #============================================================================== # ● Game_Character - Jump Update #============================================================================== class Game_Character #-------------------------------------------------------------------------- # * Initialize Objects #-------------------------------------------------------------------------- alias gc_isopix_init initialize def initialize gc_isopix_init @end_press = true @move_set = 0 end #-------------------------------------------------------------------------- # * Update #-------------------------------------------------------------------------- alias gc_isopix_upd update def update @move_set = 0 #Counter so that update move is not run more than once gc_isopix_upd end #-------------------------------------------------------------------------- # * Frame Update (jump) - This is so that the jump position is adjusted based # on the current x,y but to the current position of the actor in transition #-------------------------------------------------------------------------- def update_jump # Reduce jump count by 1 @jump_count -= 1 # Calculate new coordinates @real_x = (@real_x * @jump_count + @real_x) / (@jump_count + 1) @real_y = (@real_y * @jump_count + @real_y) / (@jump_count + 1) #----------------- # Old Formula # @real_x = (@real_x * @jump_count + @x * 128) / (@jump_count + 1) # @real_y = (@real_y * @jump_count + @y * 128) / (@jump_count + 1) #----------------- end #-------------------------------------------------------------------------- # * Update While Jumping #-------------------------------------------------------------------------- alias gc_isopix_upd_jmp update_jump def update_jump if self.is_a?(Game_Player) @end_press = true if !Input.press?(Input::Z) if MOVE_WHILE_JUMP update_move end if Input.press?(Input::Z) and !@end_press and @jump_peak != 8 @jump_peak += 1 @jump_count += 2 end end gc_isopix_upd_jmp end #-------------------------------------------------------------------------- # * Update Move - This prevents update_move from being run more than once # during any update cycle. #-------------------------------------------------------------------------- alias gc_isopix_upd_move update_move def update_move if @move_set == 0 @move_set += 1 gc_isopix_upd_move end end #-------------------------------------------------------------------------- # * IsoJump #-------------------------------------------------------------------------- def iso_jump @end_press = false @jump_peak = 1 @jump_count = @jump_peak * 2 @stop_count = 0 end end #============================================================================== # Scene Map - read message_window current status #============================================================================== class Scene_Map attr_reader :message_window end #============================================================================== # Game_Player - Jump Update #============================================================================== class Game_Player < Game_Character alias gmpl_isopix_update update def update gmpl_isopix_update if $scene.is_a?(Scene_Map) and !$scene.message_window.visible if ISO_ENABLE_JUMP and !jumping? and Input.trigger?(Input::Z) iso_jump return end end end end #============================================================================== # ** MapScreenshotMaker #============================================================================== module MapScreenshotMaker def self.take_iso(filename="IsoShot", dir = "Graphics/IsoMaps/") #create bitmap both = $game_map.width+$game_map.height bitmap = Bitmap.new(both*32, (both/2)*32) #save current display view sx, sy = $game_map.display_x, $game_map.display_y #set to 0 $game_map.display_x, $game_map.display_y = 0,0 #update sprites, and render to bitmap $scene.iso_sprites.each {|spr| spr.update bitmap.blt(spr.x, spr.y, spr.bitmap, Rect.new(0,0,64,32)) } #save bitmap to file bitmap.make_png(filename, dir) #reset display view $game_map.display_x, $game_map.display_y = sx, sy #update iso sprites to location $scene.iso_sprites.each {|spr| spr.update } end end class IsoNode < Sprite def initialize(x,y) super(nil) @sx = x @sy = y @real_x = x*128 @real_y = y*128 @iso = $game_map.iso? self.bitmap = RPG::Cache.picture("IsoNode").clone @h = 0 end def update @h = get_height self.x = screen_x self.y = screen_y self.z = screen_z super end #---------------------------------------------------------------------------- # Get Height - Return Screen Tile Height for the current position #---------------------------------------------------------------------------- def get_height return 0 if !@iso tile_id = $game_map.map.data[@sx,@sy,0] return 0 if tile_id == nil t_x = (tile_id - 384) % 8 t_y = (tile_id - 384) / 8 th = t_x + t_y * 8 return th end #---------------------------------------------------------------------------- # Screen X - sets X based on current map position #---------------------------------------------------------------------------- def screen_x if !@iso return (@real_x - $game_map.display_x + 3) / 4 + 16 else return (@real_x - @real_y)/4 + 32*$game_map.height - 0 - $game_map.display_x/4+2-32 end end #---------------------------------------------------------------------------- # Screen Y - sets Y based on current map position #---------------------------------------------------------------------------- def screen_y if !@iso y = (@real_y - $game_map.display_y + 3) / 4 + 32 return y else y = ((@real_y + @real_x) / 8 + 24 - $game_map.display_y / 4 - (@h) * 8) + 7 -32 return y end end def screen_z if !@iso # Get screen coordinates from real coordinates and map display position z = (@real_y - $game_map.display_y + 3) / 4 + 32 # If height exceeds 32, then add 31 return z else z = @h * 8 if screen_y < $game_player.screen_y if @h > $game_player.screen_h z -= 4 end else if @h > $game_player.screen_h z -= 2 end end return z end end end $drawn_iso_maps = [] class Scene_Map attr_reader :iso_sprites alias upd_gm_draw_iso update def update upd_gm_draw_iso update_iso_draw end def update_iso_draw if $game_map.iso? if !$drawn_iso_maps.include?($game_map.map_id) if @iso_sprites == nil draw_iso_frame else clear_iso_frame draw_iso_frame end else return if @iso_sprites == nil @iso_sprites.each {|spr| spr.update} end end end def clear_iso_frame @iso_sprites.each {|spr| spr.dispose} @iso_sprites = nil end def draw_iso_frame @iso_sprites = [] for x in 0...$game_map.width for y in 0...$game_map.height @iso_sprites.push(IsoNode.new(x,y)) end end $drawn_iso_maps.push($game_map.map_id) name = $data_map_info[$game_map.map_id].name MapScreenshotMaker.take_iso(name) end end Edited January 11, 2011 by Midnite Reaper Share this post Link to post Share on other sites
rgangsta 43 Report post Posted January 10, 2011 Use this: http://www.rmxpunlimited.net/scripts/rmxp/item/cogwheels-pixel-movement?category_id=13 If you want more scripts, find them here: http://www.rmxpunlimited.net/scripts/rmxp Share this post Link to post Share on other sites
Marked 197 Report post Posted January 10, 2011 Not too sure the pixel movement script is what he's looking for. I know dubealex released a tutorial for making up-left, up-right etc. movements. I'm sure we can edit it to suit. To be clear, what keys do you want to do what movement? I'm unfamiliar with isometric stuff. For example, will up-left be the up arrow key, or will it be the up + left arrow keys? Share this post Link to post Share on other sites
FranklinX 37 Report post Posted January 10, 2011 I hate it when people make character sets like that. They don't look right with the tilesets. Share this post Link to post Share on other sites
Midnite Reaper 2 Report post Posted January 10, 2011 (edited) Just to confirm, to go up-left, it will only use the up key, down-left will only use left key, down-right will only use the down key and up-right will only use the right key. As for the maps, I need them to be a similar style as this: A script which modifies the tileset to the isometric shape will be useful Still deciding on the free movement/pixel movement thing. I only want the diagonal directions if possible Edited January 10, 2011 by Midnite Reaper Share this post Link to post Share on other sites
Marked 197 Report post Posted January 10, 2011 Ok for isometric movement, replace Game_Player with the following: #============================================================================== # ** Game_Player #------------------------------------------------------------------------------ # This class handles the player. Its functions include event starting # determinants and map scrolling. Refer to "$game_player" for the one # instance of this class. #============================================================================== class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Invariables #-------------------------------------------------------------------------- CENTER_X = (320 - 16) * 4 # Center screen x-coordinate * 4 CENTER_Y = (240 - 16) * 4 # Center screen y-coordinate * 4 #-------------------------------------------------------------------------- # * Passable Determinants # x : x-coordinate # y : y-coordinate # d : direction (0,2,4,6,8) # * 0 = Determines if all directions are impassable (for jumping) #-------------------------------------------------------------------------- def passable?(x, y, d) # Get new coordinates new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0) new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0) # If coordinates are outside of map unless $game_map.valid?(new_x, new_y) # Impassable return false end # If debug mode is ON and ctrl key was pressed if $DEBUG and Input.press?(Input::CTRL) # Passable return true end super end #-------------------------------------------------------------------------- # * Set Map Display Position to Center of Screen #-------------------------------------------------------------------------- def center(x, y) max_x = ($game_map.width - 20) * 128 max_y = ($game_map.height - 15) * 128 $game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max $game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max end #-------------------------------------------------------------------------- # * Move to Designated Position # x : x-coordinate # y : y-coordinate #-------------------------------------------------------------------------- def moveto(x, y) super # Centering center(x, y) # Make encounter count make_encounter_count end #-------------------------------------------------------------------------- # * Increaase Steps #-------------------------------------------------------------------------- def increase_steps super # If move route is not forcing unless @move_route_forcing # Increase steps $game_party.increase_steps # Number of steps are an even number if $game_party.steps % 2 == 0 # Slip damage check $game_party.check_map_slip_damage end end end #-------------------------------------------------------------------------- # * Get Encounter Count #-------------------------------------------------------------------------- def encounter_count return @encounter_count end #-------------------------------------------------------------------------- # * Make Encounter Count #-------------------------------------------------------------------------- def make_encounter_count # Image of two dice rolling if $game_map.map_id != 0 n = $game_map.encounter_step @encounter_count = rand(n) + rand(n) + 1 end end #-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh # If party members = 0 if $game_party.actors.size == 0 # Clear character file name and hue @character_name = "" @character_hue = 0 # End method return end # Get lead actor actor = $game_party.actors[0] # Set character file name and hue @character_name = actor.character_name @character_hue = actor.character_hue # Initialize opacity level and blending method @opacity = 255 @blend_type = 0 end #-------------------------------------------------------------------------- # * Same Position Starting Determinant #-------------------------------------------------------------------------- def check_event_trigger_here(triggers) result = false # If event is running if $game_system.map_interpreter.running? return result end # All event loops for event in $game_map.events.values # If event coordinates and triggers are consistent if event.x == @x and event.y == @y and triggers.include?(event.trigger) # If starting determinant is same position event (other than jumping) if not event.jumping? and event.over_trigger? event.start result = true end end end return result end #-------------------------------------------------------------------------- # * Front Envent Starting Determinant #-------------------------------------------------------------------------- def check_event_trigger_there(triggers) result = false # If event is running if $game_system.map_interpreter.running? return result end # Calculate front event coordinates new_x = @x + (@direction == 6 ? 1 : @direction == 4 ? -1 : 0) new_y = @y + (@direction == 2 ? 1 : @direction == 8 ? -1 : 0) # All event loops for event in $game_map.events.values # If event coordinates and triggers are consistent if event.x == new_x and event.y == new_y and triggers.include?(event.trigger) # If starting determinant is front event (other than jumping) if not event.jumping? and not event.over_trigger? event.start result = true end end end # If fitting event is not found if result == false # If front tile is a counter if $game_map.counter?(new_x, new_y) # Calculate 1 tile inside coordinates new_x += (@direction == 6 ? 1 : @direction == 4 ? -1 : 0) new_y += (@direction == 2 ? 1 : @direction == 8 ? -1 : 0) # All event loops for event in $game_map.events.values # If event coordinates and triggers are consistent if event.x == new_x and event.y == new_y and triggers.include?(event.trigger) # If starting determinant is front event (other than jumping) if not event.jumping? and not event.over_trigger? event.start result = true end end end end end return result end #-------------------------------------------------------------------------- # * Touch Event Starting Determinant #-------------------------------------------------------------------------- def check_event_trigger_touch(x, y) result = false # If event is running if $game_system.map_interpreter.running? return result end # All event loops for event in $game_map.events.values # If event coordinates and triggers are consistent if event.x == x and event.y == y and [1,2].include?(event.trigger) # If starting determinant is front event (other than jumping) if not event.jumping? and not event.over_trigger? event.start result = true end end end return result end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update # Remember whether or not moving in local variables last_moving = moving? # If moving, event running, move route forcing, and message window # display are all not occurring unless moving? or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing # Move player in the direction the directional button is being pressed case Input.dir4 when 2 move_lower_right when 4 move_lower_left when 6 move_upper_right when 8 move_upper_left end end # Remember coordinates in local variables last_real_x = @real_x last_real_y = @real_y super # If character moves down and is positioned lower than the center # of the screen if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y # Scroll map down $game_map.scroll_down(@real_y - last_real_y) end # If character moves left and is positioned more let on-screen than # center if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X # Scroll map left $game_map.scroll_left(last_real_x - @real_x) end # If character moves right and is positioned more right on-screen than # center if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X # Scroll map right $game_map.scroll_right(@real_x - last_real_x) end # If character moves up and is positioned higher than the center # of the screen if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y # Scroll map up $game_map.scroll_up(last_real_y - @real_y) end # If not moving unless moving? # If player was moving last time if last_moving # Event determinant is via touch of same position event result = check_event_trigger_here([1,2]) # If event which started does not exist if result == false # Disregard if debug mode is ON and ctrl key was pressed unless $DEBUG and Input.press?(Input::CTRL) # Encounter countdown if @encounter_count > 0 @encounter_count -= 1 end end end end # If C button was pressed if Input.trigger?(Input::C) # Same position and front event determinant check_event_trigger_here([0]) check_event_trigger_there([0,1,2]) end end end end The modifications to the script are literally 4 lines. If you need to know whats edited, you can easily figure it out from this: http://www.creationasylum.net/index.php?showtopic=576 Share this post Link to post Share on other sites
Midnite Reaper 2 Report post Posted January 10, 2011 (edited) Thats exactly what I need, but on testing, the right key uses the up graphic and the left key uses the down graphic. If that could be fixed, all I need is the tilesets to fit the movement. Scripts obtain the desired movement and tile effect are now in the first post, but I need to know what renders the map into the shape, the modification to the movement and if possible how to get it to render a standard tileset. Edited January 11, 2011 by Midnite Reaper Share this post Link to post Share on other sites