Per 2016, RMID pindah ke RMID Discord (Invite link dihapus untuk mencegah spambot -Theo @ 2019). Posting sudah tidak bisa dilakukan lagi.
Mohon maaf atas ketidaknyamanannya dan mohon kerjasamanya.
|
|
| [VX] Membuat CTS Dari Event | |
| 2010-01-20, 18:12 | [VX] Membuat CTS Dari Event |
---|
Tamu Tamu
| SAYURI KANISIA TUTORIAL SERIES : MEMBUAT CTS DARI EVENT Deskripsi - Bosen ama Title screen yg biasa biasa aja ?, males pake script orang karena biasa biasa aja ? atau emang Pingin Kreatif ?. nah dengan tutorial ini km bisa bkn Title screen DENGAN event. Alat Dan Bahan 1. Kamu Membutuhkan 3 Script Ini Untuk Membuat CTS mu untuk berfungsi. - Wora Skip Title Screen - Spoiler:
- Code:
-
#============================================================================== # ■ [RMVX] +Skip Title Script+ #------------------------------------------------------------------------------ # Version 2.0 # by Woratana [woratana@hotmail.com] # Release Date: 21/04/2008 # # Exclusive for RPG RPG Revolution # # - To use this script: # >> Put this script above Main # >> Setup the script below # >> Go to 'Main' in Script Editor, change: # $scene = Scene_Title.new # to: # $scene = Skip_Title.new #==============================================================================
class Skip_Title < Scene_Base
#------------------------------------ # SETUP START LOCATION HERE! #----------------------------------- MAP_ID = 1 # Map ID of the Start Location START_XY = [0,12] # [X,Y] of the Start Location START_MEMBER = [1] # e.g. [Actor ID, Actor ID, Actor ID] # (0 for default start members.) #------------------------------------ # SETUP START LOCATION END #-----------------------------------
def main @title = Scene_Title.new $BTEST ? @title.battle_test : start end def start @title.load_database @title.create_game_objects if START_MEMBER != 0 $game_party.setup_starting_members_skip(START_MEMBER) else $game_party.setup_starting_members end $game_map.setup(MAP_ID) $game_player.moveto(START_XY[0],START_XY[1]) $game_player.refresh $scene = Scene_Map.new $game_map.autoplay end end
class Game_Party def setup_starting_members_skip(actor_list) @actors = [] actor_list.each {|i| @actors << i } end end
- Script Simple Mouse System - Spoiler:
- Code:
-
#============================================================================== # ** Mouse Input Module (Revised) #------------------------------------------------------------------------------ # by DerVVulfman # version 1.2 # 08-18-2007 #------------------------------------------------------------------------------ # Based on... # Mouse Input Module # by Near Fantastica #------------------------------------------------------------------------------ # Set_Pos feature by # Freakboy #------------------------------------------------------------------------------ # # THE CALLS: # # Mouse.click? # This returns a true/false value when you test whether a button is clicked. # The values you pass are 1 (for the left mouse button), 2 (for the right) or # 3 (for the middle button). # # Mouse.press? # This returns a true/false value when you test whether a button is pressed # and kept depressed. The values you pass are 1 (for the left mouse button), # 2 (for the right mouse button), or 3 (for the middle). # # Mouse.pixels # This returns the mouse's screen coordinates in pixels. Based on a screen # with a 640x480 dimension, this returns an array of the mouse's position in # index values. Calling Mouse.pixels returns both x & y positions in a sin- # gle string, but calling Mouse.pixels[0] returns the x position (0-639) and # calling Mouse.pixels[1] returns the y position (0-439). If the mouse is # outside of the game's window region, this call returns nil. # # Mouse.tiles # This returns the mouse's screen coordinates in map tiles. Based on the # system's 20x15 tile size, this returns it in index values (a 0-19 width & # a 0-14 height). This functions the same manner as Mouse.pixels. # # Mouse.set_pos # This allows you to forcefully position the mouse at an x/y position within # the game screen by pixel coordinates. Given the game's normal screen width # of 640x480, adding: Mouse.set_pos(320,240) should position the mouse dead # center of the gaming window. # # Mouse.update # Add this routine into your update routines to update the mouse position. # It must be called otherwise you won't get valid mouse coordinates. # #==============================================================================
module Mouse @mouse_menu = 0 #-------------------------------------------------------------------------- # * Mouse Click # button : button #-------------------------------------------------------------------------- def Mouse.click?(button) return true if @keys.include?(button) return false end #-------------------------------------------------------------------------- # * Mouse Pressed # button : button #-------------------------------------------------------------------------- def Mouse.press?(button) return true if @press.include?(button) return false end #-------------------------------------------------------------------------- # * Mouse Pressed # button : button #-------------------------------------------------------------------------- def Mouse.area?(x, y, width=32, height=32) return false if @pos == nil return true if @pos[0] >= x and @pos[0] <= (x+width) and @pos[1] >= y and @pos[1] <= (y+height) return false end #-------------------------------------------------------------------------- # * Mouse Pixel Position #-------------------------------------------------------------------------- def Mouse.pixels return @pos == nil ? [0, 0] : @pos end #-------------------------------------------------------------------------- # * Mouse Tile Position #-------------------------------------------------------------------------- def Mouse.tiles return nil if @pos == nil x = @pos[0] / 32 y = @pos[1] / 32 return [x, y] end #-------------------------------------------------------------------------- # * Set Mouse Position #-------------------------------------------------------------------------- def Mouse.set_pos(x_pos=0, y_pos=0) width, height = Mouse.client_size if (x_pos.between?(0, width) && y_pos.between?(0, height)) x = Mouse.client_pos[0] + x_pos; y = Mouse.client_pos[1] + y_pos Win32API.new('user32', 'SetCursorPos', 'NN', 'N').call(x, y) end end #-------------------------------------------------------------------------- # * Mouse Update #-------------------------------------------------------------------------- def Mouse.update @pos = Mouse.pos @keys, @press = [], [] @keys.push(1) if Win32API.new("user32","GetAsyncKeyState",['i'],'i').call(1) & 0X01 == 1 @keys.push(2) if Win32API.new("user32","GetAsyncKeyState",['i'],'i').call(2) & 0X01 == 1 @keys.push(3) if Win32API.new("user32","GetAsyncKeyState",['i'],'i').call(4) & 0X01 == 1 @press.push(1) if Win32API.new("user32","GetKeyState",['i'],'i').call(1) & 0X01 == 1 @press.push(2) if Win32API.new("user32","GetKeyState",['i'],'i').call(2) & 0X01 == 1 @press.push(3) if Win32API.new("user32","GetKeyState",['i'],'i').call(4) & 0X01 == 1 end #-------------------------------------------------------------------------- # * Automatic functions below #-------------------------------------------------------------------------- # #-------------------------------------------------------------------------- # * Obtain Mouse position in screen #-------------------------------------------------------------------------- def Mouse.global_pos pos = [0, 0].pack('ll') if Win32API.new('user32', 'GetCursorPos', 'p', 'i').call(pos) != 0 return pos.unpack('ll') else return nil end end #-------------------------------------------------------------------------- # * Return Screen mouse position within game window #-------------------------------------------------------------------------- def Mouse.pos x, y = Mouse.screen_to_client(*Mouse.global_pos) width, height = Mouse.client_size begin if (x >= 0 and y >= 0 and x < width and y < height) return x, y else return nil end rescue return nil end end #-------------------------------------------------------------------------- # * Pass Screen to Game System #-------------------------------------------------------------------------- def Mouse.screen_to_client(x, y) return nil unless x and y pos = [x, y].pack('ll') if Win32API.new('user32', 'ScreenToClient', %w(l p), 'i').call(Mouse.hwnd, pos) != 0 return pos.unpack('ll') else return nil end end #-------------------------------------------------------------------------- # * Get Screen Window Handle #-------------------------------------------------------------------------- def Mouse.hwnd game_name = "\0" * 256 Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l').call('Game','Title','',game_name,255,".\\Game.ini") game_name.delete!("\0") return Win32API.new('user32', 'FindWindowA', %w(p p), 'l').call('RGSS Player',game_name) end #-------------------------------------------------------------------------- # * Get Game Window Size #-------------------------------------------------------------------------- def Mouse.client_size rect = [0, 0, 0, 0].pack('l4') Win32API.new('user32', 'GetClientRect', %w(l p), 'i').call(Mouse.hwnd, rect) right, bottom = rect.unpack('l4')[2..3] return right, bottom end #-------------------------------------------------------------------------- # * Get Window Position (RGSS Player) #-------------------------------------------------------------------------- def Mouse.client_pos rect = [0, 0, 0, 0].pack('l4') Win32API.new('user32', 'GetWindowRect', %w(l p), 'i').call(Mouse.hwnd, rect) left, upper = rect.unpack('l4')[0..1] return left+4, upper+30 end end
- Spoiler:
- Code:
-
#============================================================================== # Path Finding # Version: 2.0 # Author: modern algebra (rmrk.net) # Date: April 10, 2008 #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Thanks: # Patrick Lester! For his tutorial on A* Pathfinding algorithm (found at: # http://www.gamedev.net/reference/articles/article2003.asp) as well as # another amazingly helpful tutorial on using binary heaps (found at: # http://www.policyalmanac.org/games/binaryHeaps.htm). Without his excellent # tutorials, this script would not exist. So major thanks to him. # Zeriab, for tricking me into believing that this was an actual exercise. # Also, his table printout actually makes Tables useable :P #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Instructions: # To use, merely use this code in a script call INSIDE a Move Event: # # find_path (target_x, target_y, diagonal, max_iterations) # # where target_x and target_y are the target coordinates and diagonal is an # optional boolean value (true or false) stating whether or not to allow # diagonal movement. max_iterations is also optional, and you can set this if # you want the algorithm to quit if it is taking too long. The number you set # here refers to how many nodes you let it search through before cancelling # the process. If this is set to 0, it will take as many iterations as # necessary to find the shortest path. # # You can also set a default value for diagonal and max_iterations # by call script with the codes: # # $game_system.pathfinding_diagonal = true/false # Allow diagonal movement # $game_system.pathfinding_iterations = integer # When <= 0, no limit # # For scripters, you can force-move a character down a path via: # # character.force_path (x, y, diagonal, max_iterations) # # character is any Game_Character object, such as $game_player or an event. # # Then, when you do not specifically set diagonal or limit, it will default # to the values you set in there #============================================================================== #============================================================================== # ** Game_System #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Summary of Changes: # new instance variables - pathfinding_diagonal, pathfinding_iterations # aliased method - initialize #==============================================================================
class Game_System #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Public Instance Variables #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ attr_accessor :pathfinding_diagonal attr_accessor :pathfinding_iterations #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Object Initialization #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ alias modalg_pathfinding_options_init_j5yt initialize def initialize modalg_pathfinding_options_init_j5yt @pathfinding_diagonal = false @pathfinding_iterations = 0 end end
#============================================================================== # ** Game_Character #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Summary of Changes: # new methods - find_path #==============================================================================
class Game_Character #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Find Path # trgt_x, trgt_y : the target coordinates # diagonal : Is diagonal movement allowed? # max_iterations : maximum number of iterations #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def find_path (trgt_x, trgt_y, diagonal = $game_system.pathfinding_diagonal, max_iterations = $game_system.pathfinding_iterations) path = $game_map.find_path (self.x, self.y, trgt_x, trgt_y, diagonal, max_iterations, self) # Add the path to the move route being executed. @move_route.list.delete_at (@move_route_index) path.each { |i| @move_route.list.insert (@move_route_index, i) } @move_route_index -= 1 end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Force Path # trgt_x, trgt_y : target coordinates # diagonal : Is diagonal movement allowed? # max_iterations : maximum number of iterations #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def force_path (trgt_x, trgt_y, diagonal = $game_system.pathfinding_diagonal, max_iterations = $game_system.pathfinding_iterations) path = $game_map.find_path (self.x, self.y, trgt_x, trgt_y, diagonal, max_iterations, self) # The path retrieved is actually backwards, so it must be reversed path.reverse! # Add an end ccommand path.push (RPG::MoveCommand.new (0)) move_route = RPG::MoveRoute.new move_route.list = path move_route.repeat = false force_move_route (move_route) end end
#============================================================================== # ** Game_Map #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Summary of Changes: # new method - removefrom_binaryheap, find_path #============================================================================== class Game_Map #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Remove from Heap #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def removefrom_binaryheap @open_nodes[1] = @open_nodes[@listsize] @listsize -= 1 v = 1 loop do u = v w = 2*u # Check if it's cost is greater than that of it's children if w + 1 <= @listsize # If both children exist v = w if @total_cost[@open_nodes[u]] >= @total_cost[@open_nodes[w]] v = w + 1 if @total_cost[@open_nodes[v]] >= @total_cost[@open_nodes[w + 1]] elsif w <= @listsize # If only one child exists v = w if @total_cost[@open_nodes[u]] >= @total_cost[@open_nodes[w]] end # Break if parent has less cost than it's children if u == v break else temp = @open_nodes[u] @open_nodes[u] = @open_nodes[v] @open_nodes[v] = temp end end end #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Find Path # src_x, src_y : the source coordinates # trgt_x, trgt_y : the target coordinates # diagonal : Is diagonal movement allowed? # max_iterations : maximum number of iterations # char : character to follow the path #-------------------------------------------------------------------------- # Uses the A* method of pathfinding to find a path #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def find_path (src_x, src_y, trgt_x, trgt_y, diagonal, max_iterations, char) # No possible path if the target itself is impassable path = [] # Finished if Target Location is closed return path if !char.passable? (trgt_x, trgt_y) # Initialize max_elements = width*height + 2 openx = Table.new (max_elements) openy = Table.new (max_elements) @open_nodes = Table.new (max_elements) @total_cost = Table.new (max_elements) heuristic = Table.new (max_elements) step_cost = Table.new (width, height) parent_x = Table.new (width, height) parent_y = Table.new (width, height) actual_list = Table.new (width, height) # Add the source node to the open list new_openid = 1 @open_nodes[1] = 1 openx[1] = src_x openy[1] = src_y dist = [(trgt_x - src_x).abs, (trgt_y - src_y).abs] heuristic[1] = diagonal ? (dist.max*14) + (dist.min*10) : (dist[0] + dist[1])*10 @total_cost[1] = heuristic[1] actual_list[src_x, src_y] = 1 @listsize = 1 count = 0 loop do break if actual_list[trgt_x, trgt_y] != 0 count += 1 # Update Graphics every 500 iterations Graphics.update if count % 500 == 0 return path if count == max_iterations return path if @listsize == 0 node = @open_nodes[1] # Set the x and y value as parent to all possible children parent_xval, parent_yval = openx[node], openy[node] actual_list[parent_xval, parent_yval] = 2 removefrom_binaryheap # Check all adjacent squares for i in 0...8 break if i > 3 && !diagonal # Get the node x, y = case i when 0 then [parent_xval, parent_yval - 1] # UP when 1 then [parent_xval, parent_yval + 1] # DOWN when 2 then [parent_xval - 1, parent_yval] # LEFT when 3 then [parent_xval + 1, parent_yval] # RIGHT when 4 then [parent_xval - 1, parent_yval - 1] # UP LEFT when 5 then [parent_xval + 1, parent_yval - 1] # UP RIGHT when 6 then [parent_xval - 1, parent_yval + 1] # DOWN LEFT when 7 then [parent_xval + 1, parent_yval + 1] # DOWN RIGHT end # Next if this node is already in the closed list next if actual_list[x,y] == 2 # Next if this tile in impassable next unless char.passable? (x, y) # Is the tile passable? # Take into account diagonal passability concerns if i > 3 next unless case i when 4 then char.passable? (x + 1, y) || char.passable? (x, y + 1) when 5 then char.passable? (x - 1, y) || char.passable? (x, y + 1) when 6 then char.passable? (x + 1, y) || char.passable? (x, y - 1) when 7 then char.passable? (x - 1, y) || char.passable? (x, y - 1) end end # Check if this node already open plus_step_cost = ((x - parent_xval).abs + (y - parent_yval).abs) > 1 ? 14 : 10 temp_step_cost = step_cost[parent_xval, parent_yval] + plus_step_cost if actual_list[x,y] == 1 # If this is a better path to that node if temp_step_cost < step_cost[x, y] # Change Parent, step, and total cost parent_x[x, y] = parent_xval parent_y[x, y] = parent_yval step_cost[x, y] = temp_step_cost # Find index of this position index = 1 while index < @listsize index += 1 break if openx[@open_nodes[index]] == x && openy[@open_nodes[index]] == y end @total_cost[@open_nodes[index]] = temp_step_cost + heuristic[@open_nodes[index]] else next end else # If not on open nodes # Add to open nodes new_openid += 1 # New Id for new item @listsize += 1 # Increase List Size @open_nodes[@listsize] = new_openid step_cost[x, y] = temp_step_cost # Calculate Heuristic d = [(trgt_x - x).abs, (trgt_y - y).abs] heuristic[new_openid] = diagonal ? (d.max*14) + (d.min*10) : (d[0] + d[1])*10 @total_cost[new_openid] = temp_step_cost + heuristic[new_openid] parent_x[x, y] = parent_xval parent_y[x, y] = parent_yval openx[new_openid] = x openy[new_openid] = y index = @listsize actual_list[x, y] = 1 end # Sort Binary Heap while index != 1 temp_node = @open_nodes[index] if @total_cost[temp_node] <= @total_cost[@open_nodes[index / 2]] @open_nodes[index] = @open_nodes[index / 2] index /= 2 @open_nodes[index] = temp_node else break end end end end # Get actual target node path_x, path_y = trgt_x, trgt_y # Make an array of MoveRoute Commands while path_x != src_x || path_y != src_y # Get Parent x, Parent Y prnt_x, prnt_y = parent_x[path_x, path_y], parent_y[path_x, path_y] # DOWN = 1, LEFT = 2, RIGHT = 3, UP = 4, DL = 5, DR = 6, UL = 7, UR = 8 if path_x < prnt_x # LEFT # Determine if upper, lower or direct left code = path_y < prnt_y ? 7 : path_y > prnt_y ? 5 : 2 elsif path_x > prnt_x # RIGHT # Determine if upper, lower or direct right code = path_y < prnt_y ? 8 : path_y > prnt_y ? 6 : 3 else # UP or DOWN code = path_y < prnt_y ? 4 : 1 end path.push (RPG::MoveCommand.new (code)) path_x, path_y = prnt_x, prnt_y end return path end end
- Spoiler:
- Code:
-
#============================================================================== # [VX] SMS - Simple Mouse System #------------------------------------------------------------------------------ # ◦ by Woratana [woratana@hotmail.com] # ◦ Released on: 14/04/2008 (D-M-Y) # ◦ Version: 1.5 # # ◦ Credit: DerVVulfman, Near Fantastica, and Freak Boy [Mouse Input Module] # lambchop, shun, Cybersam, Astro_mech, and Mr.Mo [Super Simple Mouse System] # - Modern Algebra, Zeriab, Patrick Lester [Path Finding] # - Near Fantastica, Fuso [Path Finding] # # - I will not be able to script this without those people and scripts above #----------------------------------------------------------------------------- #====[REQUIRE]===== # - DerVVulfman's Mouse Input Module # - Modern Algebra's Path Finding [version 2.0] # #====[FEATURE]===== # - Support to use mouse in many scenes / windows # - Mouse Pointer # - Click on map to move player with Path Finding # - Click on event to go talk/interact with that event # - Click on event to walk to that event and interact # - You can choose scene(s) that don't want to use mouse # - You can turn mouse ON/OFF automatically by call script: # $scene.no_mouse = (true/false) # True to turn off mouse
#====[MOUSE TAGS]===== # Put one (or more) of these tags in the event command 'Comment..' # [mauto] : This event will run automatically after click on it # [mnone] : This event will not be determine as event when click on it # (a.k.a. Player will not interact with it)
# [mtop] : Player will always stop at tile above this event when click on it # [mleft] : Same as [mtop], but left side # [mright] : Same as [mtop], but right side # [mdown] : Same as [mtop], but below #------------------------------------------------------------------------------
module Mouse #============================================================================== # MOUSE SETUP PART #---------------------------------------------------------------------------- Scroll_Delay = 30 # (in Frames) # Mouse Delay when scroll up or down the list
Path_Finding_Iteration = 0 # (Integer, 0 for no limit) # How deep you want path finding to process until find the way # less number will be able to find only easy path, less lag # high number will be able to find complicated path, possible to increase lag
Scene_No_Mouse = [] # Scene(s) that you don't want to use mouse # e.g. Scene_No_Mouse = [Scene_File, Scene_Map, Scene_Title]
Auto_Find_Destination = true # It will automatically find the cloeset destination on map # when click on unpassable tile. #============================================================================== end
#============================================================================== # ** Mouse Input Module #============================================================================== class << Mouse show_cursor = Win32API.new('user32', 'ShowCursor', 'l', 'l') show_cursor.call(0)
$mousec = Sprite.new $mousec.z = 10001 $mousec.x = $mousec.y = 1000 $mouse_icon = $base_cursor = 'foxkeh_cursor' $mousec.bitmap = Cache.system($base_cursor) $mouse_duration = -1 $mouse_changed = false alias wor_mouse_upd_mouse update unless $@ def Mouse.update wor_mouse_upd_mouse if $scene.no_mouse $mousec.visible = false if $mousec.visible return else; $mousec.visible = true if !$mousec.visible end if $mouse_old_icon.nil? or $mouse_old_icon != $mouse_icon $mouse_old_icon = $mouse_icon $mousec.bitmap = Cache.system($mouse_old_icon) end if @pos.nil? $mousec.x = 1000 if $mousec.x != 1000 $mousec.y = 1000 if $mousec.y != 1000 else $mousec.x = @pos[0] if $mousec.x != @pos[0] $mousec.y = @pos[1] if $mousec.y != @pos[1] end end def Mouse.map_pos return nil if @pos == nil x = ($game_map.display_x / 256) + (@pos[0] / 32) y = ($game_map.display_y / 256) + (@pos[1] / 32) return [x, y] end end
#============================================================================== # ** Input #============================================================================== class << Input alias wor_input_upd_mouse update unless $@ alias wor_input_trig_mouse trigger? unless $@ alias wor_input_rep_mouse repeat? unless $@ def Input.update wor_input_upd_mouse Mouse.update end def Input.trigger?(input) return wor_input_trig_mouse(input) if Mouse.pos.nil? if input == Input::B and !$scene.no_mouse return (wor_input_trig_mouse(input) or Mouse.click?(2)) elsif input == Input::C and !$scene.no_mouse if $scene.is_a?(Scene_Map) and !$game_message.visible return wor_input_trig_mouse(input) else return (wor_input_trig_mouse(input) or Mouse.click?(1)) end else return wor_input_trig_mouse(input) end end def Input.repeat?(input) if input == Input::B and !$scene.no_mouse return (wor_input_rep_mouse(input) or Mouse.click?(2)) else return wor_input_rep_mouse(input) end end end #============================================================================== # ** Graphics #============================================================================== class << Graphics alias wor_graph_fadeout_mouse fadeout unless $@ def Graphics.fadeout(frames = 1) $mousec.visible = false if !$mousec.nil? wor_graph_fadeout_mouse(frames) end end #============================================================================== # ** Window_Selectable #============================================================================== class Window_Selectable < Window_Base alias wor_winsel_ini_mouse initialize alias wor_winsel_upd_mouse update def initialize(*args) wor_winsel_ini_mouse(*args) @scroll_wait = 0 @cursor_wait = 0 end
def update wor_winsel_upd_mouse update_mouse if self.active and self.visible end def update_mouse @cursor_wait -= 1 if @cursor_wait > 0 (0..@item_max - 1).each do |i| irect = item_rect(i) irx = self.x + 16 + irect.x - self.ox iry = self.y + 16 + irect.y - self.oy move_cursor(i) if Mouse.area?(irx, iry, irect.width, irect.height) end end
def move_cursor(index) return if @index == index @scroll_wait -= 1 if @scroll_wait > 0 row1 = @index / @column_max row2 = index / @column_max bottom = self.top_row + (self.page_row_max - 1) if row1 == self.top_row and row2 < self.top_row return if @scroll_wait > 0 @index = [@index - @column_max, 0].max @scroll_wait = Mouse::Scroll_Delay elsif row1 == bottom and row2 > bottom return if @scroll_wait > 0 @index = [@index + @column_max, @item_max - 1].min @scroll_wait = Mouse::Scroll_Delay else @index = index end return if @cursor_wait > 0 Sound.play_cursor @cursor_wait += 2 end end #============================================================================== # ** Window_MenuStatus #============================================================================== class Window_MenuStatus < Window_Selectable def item_rect(index) return Rect.new(0, index * 96, contents.width, 96) end end #============================================================================== # ** Window_NameInput #============================================================================== class Window_NameInput < Window_Base alias wor_winnam_upd_mouse update def update wor_winnam_upd_mouse if self.active and self.visible (0..TABLE[@mode].size - 1).each do |i| irect = item_rect(i) irx = self.x + 16 + irect.x - self.ox iry = self.y + 16 + irect.y - self.oy @index = i if Mouse.area?(irx, iry, irect.width, irect.height) end end end end #============================================================================== # ** Window_PartyCommand #============================================================================== class Window_PartyCommand < Window_Command def update_mouse (0..@item_max - 1).each do |i| irect = item_rect(i) irx = self.viewport.ox + 16 + irect.x - self.ox iry = 288 + 16 + irect.y - self.oy self.index = i if Mouse.area?(irx, iry, irect.width, irect.height) end end end #============================================================================== # ** Window_ActorCommand #============================================================================== class Window_ActorCommand < Window_Command def update_mouse (0..@item_max - 1).each do |i| irect = item_rect(i) irx = self.viewport.ox + 288 + 16 + irect.x iry = 288 + 16 + irect.y self.index = i if Mouse.area?(irx, iry, irect.width, irect.height) end end end #============================================================================== # ** Window_Message #============================================================================== class Window_Message < Window_Selectable def update_mouse (0..@item_max - 1).each do |i| irect = item_rect(i) irx = self.x + 16 + irect.x - self.ox iry = self.y + 16 + irect.y - self.oy + ($game_message.choice_start * WLH) self.index = i if Mouse.area?(irx, iry, irect.width, irect.height) end end end
#============================================================================== # ** Scene_Base #============================================================================== class Scene_Base alias wor_scebase_posstr_mouse post_start alias wor_scebase_preter_mouse pre_terminate attr_accessor :no_mouse def post_start if !$mousec.nil? $mousec.visible = true @no_mouse = false # If this scene is in Scene_No_Mouse Mouse::Scene_No_Mouse.each do |sce| if $scene.is_a?(sce) $mousec.visible = false @no_mouse = true end end end wor_scebase_posstr_mouse end def pre_terminate $mousec.visible = false if !$mousec.nil? wor_scebase_preter_mouse end end #============================================================================== # ** Scene_File #============================================================================== class Scene_File < Scene_Base alias wor_scefil_upd_mouse update def update (0..@item_max - 1).each do |i| ix = @savefile_windows[i].x iy = @savefile_windows[i].y iw = @savefile_windows[i].width ih = @savefile_windows[i].height if Mouse.area?(ix, iy, iw, ih) @savefile_windows[@index].selected = false @savefile_windows[i].selected = true @index = i end end wor_scefil_upd_mouse end end #============================================================================== # ** Scene_Map #============================================================================== class Scene_Map < Scene_Base alias wor_scemap_upd_mouse update def update wor_scemap_upd_mouse if !@no_mouse # IF left click if Mouse.click?(1) and !$game_message.visible and !$game_map.interpreter.running? mouse_xy = Mouse.map_pos return if mouse_xy.nil? old_direction = $game_player.direction $game_player.turn_toward_pos(mouse_xy[0], mouse_xy[1]) # IF click near player, and there's trigger to event, run event return if ($game_player.front?(mouse_xy[0],mouse_xy[1]) and $game_player.check_action_event) $game_player.clear_path $game_player.mouse_force_path(mouse_xy[0], mouse_xy[1]) # IF middle click elsif Mouse.click?(3) and !$game_message.visible and !$game_map.interpreter.running? mouse_xy = Mouse.map_pos return if mouse_xy.nil? $game_player.clear_path $game_player.turn_toward_pos(mouse_xy[0], mouse_xy[1]) end end end end #============================================================================== # ** Game_Character #============================================================================== class Game_Character def mouse_force_path(x, y, auto_check = ($game_map.events_xy(x, y).size > 0)) ori_x, ori_y = x, y path_xy = $game_map.find_dest_xy(x, y, @x, @y) return if path_xy.nil? x, y = path_xy[0] ,path_xy[1] # Force_move from MA's path finding if map_passable?(x,y) path = $game_map.find_path (self.x, self.y, x, y, false, Mouse::Path_Finding_Iteration, self) path.reverse! # Turn toward destination newmove = RPG::MoveCommand.new newmove.code = 45 # Script.. newmove.parameters = ["turn_toward_pos(#{ori_x},#{ori_y})"] path.push newmove # Add script to check if there's event trigger if auto_check newmove = RPG::MoveCommand.new newmove.code = 45 newmove.parameters = ['check_action_event'] path.push newmove end # Add an end command path.push (RPG::MoveCommand.new (0)) move_route = RPG::MoveRoute.new move_route.list = path move_route.repeat = false force_move_route (move_route) end end def clear_path @move_route_index = 0 @move_route = RPG::MoveRoute.new @move_route.repeat = false end
def turn_toward_pos(x,y) sx = distance_x_from_pos(x) sy = distance_y_from_pos(y) if sx.abs > sy.abs # Horizontal distance is longer sx > 0 ? turn_left : turn_right elsif sx.abs < sy.abs # Vertical distance is longer sy > 0 ? turn_up : turn_down end end
def distance_x_from_pos(x) sx = @x - x if $game_map.loop_horizontal? if sx.abs > $game_map.width / 2 sx -= $game_map.width end end return sx end def distance_y_from_pos(y) sy = @y - y if $game_map.loop_vertical? if sy.abs > $game_map.height / 2 sy -= $game_map.height end end return sy end def front?(x,y) case @direction when 2; return true if (x == @x-1 and y == @y) when 4; return true if (x == @x and y == @y-1) when 6; return true if (x == @x and y == @y+1) when 8; return true if (x == @x+1 and y == @y) end return false end end #============================================================================== # ** Game_Map #============================================================================== class Game_Map # Find Destination for Path Finding def find_dest_xy(x, y, self_x, self_y) has_event = false event_ary = events_xy(x, y) # Remove Event that has 'mnone' (event_ary).each do |i| event_ary.delete(i) if i.comment?('[mnone]') end # Return original x, y if there are more than 1 events, # or the only event has priority type 'Below Character' if (event_ary.size == 1 and event_ary[0].priority_type != 1) or event_ary.size > 1 return [x, y] elsif event_ary.size == 1 # IF there's event, check for reserved direction has_event = true if event_ary[0].comment?('[mtop]') return [x, y-1] elsif event_ary[0].comment?('[mleft]') return [x-1, y] elsif event_ary[0].comment?('[mright]') return [x+1, y] elsif event_ary[0].comment?('[mdown]') return [x, y+1] elsif event_ary[0].comment?('[mauto]') event_ary[0].start return nil end end # Check for passable direction or it's Same X/Y or doesn't allow auto-find if (event_ary.size != 1 and $game_player.map_passable?(x, y)) or (self_x == x and self_y == y) or (!Mouse::Auto_Find_Destination and !has_event) return [x, y] end # Find nearest path nx = (self_x - x) ny = (self_y - y) npath_real = [] if (nx.abs < ny.abs and nx != 0) or (ny == 0) # X is closer than Y npath_real << (nx > 0 ? 'right' : 'left') else # EQUAL, or Y is closer than X npath_real << (ny > 0 ? 'up' : 'down') end npath_real_tran = move_translate(npath_real, x, y) # Translate word to value # If the fastest way is possible, return it if $game_player.map_passable?(npath_real_tran[0][0], npath_real_tran[0][1]) return [npath_real_tran[0][0], npath_real_tran[0][1]] end npath = [] # Add other possible ways npath << 'up' if !npath_real.include?('up') npath << 'left' if !npath_real.include?('left') npath << 'down' if !npath_real.include?('down') npath << 'right' if !npath_real.include?('right') npath = move_translate(npath, x, y) # Translate other possible ways (0..npath.size-1).each do |np| # Calculate distance from each point npath[np] = [npath[np], (self_x - npath[np][0]).abs + (self_y - npath[np][1]).abs] end npath = npath.sort_by {|i| i[1]} # Sort by Distance # Check to move~ npath.each do |n| return [n[0][0], n[0][1]] if $game_player.map_passable?(n[0][0], n[0][1]) end # IF there's no way to go return nil end def move_translate(ary, x, y) (0..ary.size - 1).each do |n| if ary[n] == 'up' ary[n] = [x, y-1] elsif ary[n] == 'left' ary[n] = [x-1, y] elsif ary[n] == 'right' ary[n] = [x+1, y] elsif ary[n] == 'down' ary[n] = [x, y+1] end end return ary end end #============================================================================== # ** Game_Event #============================================================================== class Game_Event < Game_Character def comment?(comment, return_index = false ) if !@list.nil? for i in 0...@list.size - 1 next if @list[i].code != 108 (0..@list[i].parameters.size - 1).each do |j| if @list[i].parameters[j].include?(comment) return [true, [i,j]] if return_index return true end end end end return [false, nil] if return_index return false end end
2. Kamu Butuh Gambar Cursor Seukuran 32X32 Yang Di Simpan di System dengan nama foxkeh_cursor.png 3. Buatlah Sebuah Paralaxes Seperti Gambar Di Bawah ini (anda bisa memvarisikanya dengan TileE bila mau dan membuat Parallaxes Itu Bergerak) Cara Membuat Nya1 Buatlah Event Pada Tempat/text yang anda Inginkan, Contoh New Game. (Catatan : Di Dalam Event Harus anda Isi Dulu dengan Comment : [mauto] >Text bla bla Bla "agar text bisa di klik dan jangan lupa setting "Same As Character") 2 Variasi Script Di Eventing "Quit Game" Comment: [mauto] Script : $scene = nil "Load Game" Comment : [mauto] Script : $scene = Scene_File.new(false, false, true) ---------------------------------------------------------- Sisanya Tergantung Kreatifitas anda (anda bisa membuat sebuah OS Komputer,Phone System, Music Mode, CG Viewer dan lain lain menggunkan ini) |
| | | 2010-01-20, 18:17 | Re: [VX] Membuat CTS Dari Event |
---|
white pegasus Newbie
Posts : 93 Thanked : 0 Engine : RMVX Skill : Beginner Type : Mapper
| maaf CTS itu apa? saya belum tau |
| | | 2010-01-20, 18:19 | Re: [VX] Membuat CTS Dari Event |
---|
bradhawk Admin
Posts : 637 Thanked : 8 Skill : Beginner
| yg buat sayuri neeh ? <3 keren, tapi mungkin lebih baik kasi demo . dan inikan pre-event, masi ada yg pake skrip, wa kira full event |
| | | 2010-01-20, 18:21 | Re: [VX] Membuat CTS Dari Event |
---|
eve Loli Mecha Mesum Musume
Posts : 1620 Thanked : 30 Engine : Other Skill : Beginner Type : Writer
Awards:
| cursornya ntu mirip ama karrakter yak? jadi di sini kita bikin map baru gitu? OOT: grrrrrrrrrrrrr keybboard baaru caccat! |
| | | 2010-01-20, 18:22 | Re: [VX] Membuat CTS Dari Event |
---|
Tamu Tamu
| @brad saya akan berikan demo dalam waktu dekat |
| | | 2010-01-20, 18:27 | Re: [VX] Membuat CTS Dari Event |
---|
HayzenTZ Novice
Posts : 131 Thanked : 4 Engine : RMVX
| Hmmmm...sepertinya menarik..agak kurang paham sih tp coba atak-utik aja ah sampe bisa. OOT: Wogh! logo titlenya beneran dipake toh? (thx bwt +repnya btw) EDIT: Walah..error mulu.. apa urutan penempatan script di atas main juga berpengaruh yah? trus gimana cara ngatur biar Paralaxes yg kita inginkan biar muncul? EDIT2: Bisa2.. Ternyata harus urut scriptnya. Sesuai dgn yg di urutin Declar. Hmm.. Skrg mau dibuat apa yah..
Terakhir diubah oleh HayzenTZ tanggal 2010-01-20, 20:21, total 1 kali diubah |
| | | 2010-01-20, 20:04 | Re: [VX] Membuat CTS Dari Event |
---|
shikami Member 1000 Konsep
Posts : 3744 Thanked : 31 Engine : Multi-Engine User Skill : Beginner Type : Developer
Awards:
| @pegas : CTS = Custom Title Screen. Any question again? Nice tuts,hmm..saya kira juga full event.. Ternyata pake script juga.. Cocok bwt game2 VN nih.. |
| | | 2010-01-20, 20:12 | Re: [VX] Membuat CTS Dari Event |
---|
Tamu Tamu
| @hayzenTZ anda kan profesional masa gag memperhatikan tulisan ini - To use this script: # >> Put this script above Main # >> Setup the script below # >> Go to 'Main' in Script Editor, change: # $scene = Scene_Title.new # to: # $scene = Skip_Title.new |
| | | 2010-01-20, 20:16 | Re: [VX] Membuat CTS Dari Event |
---|
nekopia Novice
Posts : 170 Thanked : 5 Engine : RMVX
| HMMM....Maap gw emang bego, gag mudeng bagian cara pembuatan. Setubuh ama om Bradhawk, butuh demo... |
| | | 2010-01-20, 20:23 | Re: [VX] Membuat CTS Dari Event |
---|
Tamu Tamu
| ane mau buang ini trit... ntar mau ane buat ulang |
| | | 2010-01-20, 20:25 | Re: [VX] Membuat CTS Dari Event |
---|
HayzenTZ Novice
Posts : 131 Thanked : 4 Engine : RMVX
| - declaration963 wrote:
- @hayzenTZ
anda kan profesional masa gag memperhatikan tulisan ini
- To use this script: # >> Put this script above Main # >> Setup the script below # >> Go to 'Main' in Script Editor, change: # $scene = Scene_Title.new # to: # $scene = Skip_Title.new Uh.. haha, tadi udah bisa sih. lupa gw edit post gw tadi. Tuh. |
| | | 2010-01-20, 21:19 | Re: [VX] Membuat CTS Dari Event |
---|
Wildan7 Newbie
Posts : 55 Thanked : 1 Engine : RMVX Skill : Intermediate Type : Artist
| wow....nice tutorial......baru tahu klo CTS bisa pke Event.... ini nih yang aq cari......bwt game project Q...... tapi koq agak rumit ya???? Ksih demonya dong...(klo ada..) Thanks a lot....... _____________________ Aku ingin menjadi seperti Tetsuya Nomura!!!!!Bikin Profile Card ah.....- Spoiler:
Original design By M.Wildan Cahya S |
| | | 2010-01-21, 07:48 | Re: [VX] Membuat CTS Dari Event |
---|
Tamu Tamu
| @wildan ini mau saya ulangi lagi... tutnya, pake demo dan penjelasan yg jelas (step by stepnya lagi) tapi ntar abis project 14F ku jadi sibuk bgt nich |
| | | | Re: [VX] Membuat CTS Dari Event |
---|
Sponsored content
| | | | | [VX] Membuat CTS Dari Event | |
|
Similar topics | |
|
Similar topics | |
| |
Halaman 1 dari 1 | |
| Permissions in this forum: | Anda tidak dapat menjawab topik
| |
| |
Latest 10 Topics | [Web Novel] Gloria Infidelis 2016-11-17, 21:27 by LightNightKnight
[Announcement] Forum baru untuk RMID 2016-08-25, 16:39 by TheoAllen
Where I'm Wrong ? 2016-07-24, 16:10 by ReydVires
flakeheartnet's Resources part III 2016-07-08, 14:30 by flakeheartnet
Keira's Art Warehouse 2016-06-28, 19:27 by KeiraBlaze
Theo Core Time System + Bingung 2016-06-27, 16:24 by Lockin
Error Script, Maybe ? 2016-06-27, 16:20 by Lockin
Nusaimoe @ RMID Lounge 2016-06-21, 05:02 by Jihad Bagas
Call Random Battle 2016-06-15, 17:04 by Lockin
Flakeheartnet Resources Part II [come back gift] 2016-06-07, 15:51 by flakeheartnet
|
Statistics
|
Members: [ 4947 ]
Topics: [ 8258 ]
Posts: [ 112606 ]
Newest member: [ https://rmid.forumotion.net/u4968 ]
|
|
|
|
|
|