Parbus Posted January 18, 2010 Share Posted January 18, 2010 Salve gente! Stavo spulciando un pò di script quando mi sono imbattuto in questo che permette la camminata a pixel class Game_Player < Game_Character#----------------------# ?œ ’è?”#---------------------TOP_SPACE = BOTTOM_SPACE = 16 # ?㉺‚Ì”»’è–³Ž‹—̈æLEFT_SPACE = RIGHT_SPACE = 16 # ?¶‰E‚Ì”»’è–³Ž‹—̈æ#-----------------# ?œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï?”#-----------------attr_accessor :dot_moving #---------------------# ?œ ?‰Šú‰»#--------------------------def initialize super # ƒh @dot_moving = 0end#-----------# ?œ ˆÚ“®’†”»’è#-----------------def moving?(by_update = false) # if !by_update and @dot_moving # —§‚¿Ž~‚Ü‚Á‚Ä‚¢‚È‚¯‚ê‚Έړ®’† return @dot_moving != 0 else return (!@dot_moving and (@real_x != @x * 128 or @real_y != @y * 128)) endend#---------------# ?œ ˆÚ“®ƒ‹?[ƒg‚Ì‹?§# move_route : ?V‚µ‚¢ˆÚ“®ƒ‹?[ƒg#-----------------def force_move_route(move_route) # —§‚¿Ž~‚܂点‚é @dot_moving = 0 super(move_route)end#-------------------# ?œ ƒtƒŒ?[ƒ€?X?V#-----------------------def update # ƒ??[ƒJƒ‹•Ï?”‚É?À•W‚ð‹L‰¯ last_real_x, last_real_y = @real_x, @real_y last_x, last_y = @x, @y # ƒ last_moving = moving?(true) # ˆA # ƒ unless moving?(true) or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing # ƒhƒbƒgˆÚ“® dot_move(Input.dir4) end super if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y # ƒ}ƒbƒv‚ð‰º‚ÉƒXƒNƒ??[ƒ‹ $game_map.scroll_down(@real_y - last_real_y) end if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X # ƒ}ƒbƒv‚ð?¶‚ɃXƒNƒ??[ƒ‹ $game_map.scroll_left(last_real_x - @real_x) end if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X # ƒ}ƒbƒv‚ð‰E‚ɃXƒNƒ??[ƒ‹ $game_map.scroll_right(@real_x - last_real_x) end if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y # ƒ}ƒbƒv‚ð?ã‚ɃXƒNƒ??[ƒ‹ $game_map.scroll_up(last_real_y - @real_y) end # ˆÚ“®’†‚ł͂Ȃ¢?ê?‡ unless moving?(true) if last_x != @x or last_y != @y or (!@dot_moving and last_moving) # “¯ˆÊ’u‚̃Cƒxƒ“ƒg‚Æ‚Ì?Ú result = check_event_trigger_here([1,2]) # ‹N“®‚µ‚½ƒCƒxƒ“ƒg‚ª‚È‚¢?ê?‡ if result == false unless $DEBUG and Input.press?(Input::CTRL) # ƒGƒ“ƒJƒEƒ“ƒg ƒJƒEƒ“ƒgƒ_ƒEƒ“ if @encounter_count > 0 @encounter_count -= 1 end end # ‹N“®‚µ else # —§‚¿Ž~‚ @dot_moving = @dot_moving ? 0 : nil end end # C ƒ{ƒ^ƒ“‚ if Input.trigger?(Input::C) # “¯ˆÊ’u‚ check_event_trigger_here([0]) check_event_trigger_there([0,1,2]) end endend#---------------# ?œ ˆÚ“®ƒ^ƒCƒv : ƒJƒXƒ^ƒ€#---------------def move_type_custom # ’âŽ~’†‚łȂ¯‚ê‚Î’†’f if jumping? or moving? return end # ˆÚ“®ƒRƒ}ƒ“ƒh‚ÌƒŠ while @move_route_index < @move_route.list.size # ˆÚ“®ƒRƒ}ƒ“ƒh‚ðŽæ“¾ command = @move_route.list[@move_route_index] # ƒRƒ}ƒ“ƒhƒR?[ƒ if command.code == 0 # ƒIƒvƒVƒ‡ƒ“ if @move_route.repeat # ˆÚ“®ƒ‹?[ƒ @move_route_index = 0 end # ƒIƒvƒVƒ‡ƒ“ [“®?ì‚ðŒJ‚è•Ô‚·] ‚ª OFF ‚Ì?ê?‡ unless @move_route.repeat # ˆÚ“®ƒ‹?[ƒg‹?§’†‚Ì?ê?‡ if @move_route_forcing and not @move_route.repeat # ˆÚ“®ƒ‹?[ƒg‚Ì‹?§‚ð‰ð?œ @move_route_forcing = false # ƒIƒŠƒWƒiƒ‹‚̈ړ®ƒ‹?[ƒg‚𕜋A @move_route = @original_move_route @move_route_index = @original_move_route_index @original_move_route = nil end # ’âŽ~ƒJƒEƒ“ƒg‚ðƒNƒŠƒA @stop_count = 0 end return end # ˆÚ“®ŒnƒRƒ} if command.code <= 14 # ƒhƒbƒgˆÚ“®‹?§?I—¹ @dot_moving = nil # ƒRƒ}ƒ“ƒhƒR?[ƒh‚Å•ªŠò case command.code when 1 # ‰º‚Ɉړ® move_down when 2 # ?¶‚Ɉړ® move_left when 3 # ‰E‚Ɉړ® move_right when 4 # ?ã‚Ɉړ® move_up when 5 # ?¶‰º‚Ɉړ® move_lower_left when 6 # ‰E‰º‚Ɉړ® move_lower_right when 7 # ?¶?ã‚Ɉړ® move_upper_left when 8 # ‰E?ã‚Ɉړ® move_upper_right when 9 # ƒ‰ƒ“ƒ_ƒ€‚Ɉړ® move_random when 10 # ƒvƒŒƒC move_toward_player when 11 # ƒvƒŒƒCƒ move_away_from_player when 12 # ˆê•à‘O?i move_forward when 13 # ˆê•àŒã‘Þ move_backward when 14 # ƒWƒƒƒ“ƒv jump(command.parameters[0], command.parameters[1]) end if not @move_route.skippable and not moving? and not jumping? return end @move_route_index += 1 return end # ƒEƒFƒCƒg‚Ì?ê?‡ if command.code == 15 # ƒEƒFƒCƒgƒJƒEƒ“ƒg‚ð?Ý’è @wait_count = command.parameters[0] * 2 - 1 @move_route_index += 1 return end # Œü‚«•Ï?XŒn‚̃Rƒ}ƒ“ƒh‚Ì?ê?‡ if command.code >= 16 and command.code <= 26 # ƒRƒ}ƒ“ƒhƒR?[ƒh‚Å•ªŠò case command.code when 16 # ‰º‚ðŒü‚ turn_down when 17 # ?¶‚ðŒü‚ turn_left when 18 # ‰E‚ðŒü‚ turn_right when 19 # ?ã‚ðŒü‚ turn_up when 20 # ‰E‚É 90 “x‰ñ“] turn_right_90 when 21 # ?¶‚É 90 “x‰ñ“] turn_left_90 when 22 # 180 “x‰ñ“] turn_180 when 23 # ‰E‚©?¶‚É 90 “x‰ñ“] turn_right_or_left_90 when 24 # ƒ‰ƒ“ƒ_ƒ€‚É•ûŒü“]Š· turn_random when 25 # ƒvƒŒƒCƒ„?[‚Ì•û‚ðŒü‚ turn_toward_player when 26 # ƒvƒŒƒCƒ„?[‚Ì‹t‚ðŒü‚ turn_away_from_player end @move_route_index += 1 return end # ‚»‚Ì‘¼‚̃Rƒ}ƒ“ƒh‚Ì?ê?‡ if command.code >= 27 # ƒRƒ}ƒ“ƒhƒR?[ƒh‚Å•ªŠò case command.code when 27 # ƒXƒCƒbƒ` ON $game_switches[command.parameters[0]] = true $game_map.need_refresh = true when 28 # ƒXƒCƒbƒ` OFF $game_switches[command.parameters[0]] = false $game_map.need_refresh = true when 29 # ˆÚ“®‘¬“x‚Ì•Ï?X @move_speed = command.parameters[0] when 30 # ˆÚ“®•p“x‚Ì•Ï?X @move_frequency = command.parameters[0] when 31 # ˆÚ“®ŽžƒAƒjƒ? ON @walk_anime = true when 32 # ˆÚ“®ŽžƒAƒjƒ? OFF @walk_anime = false when 33 # ’âŽ~ŽžƒAƒjƒ? ON @step_anime = true when 34 # ’âŽ~ŽžƒAƒjƒ? OFF @step_anime = false when 35 # Œü‚«ŒÅ’è ON @direction_fix = true when 36 # Œü‚«ŒÅ’è OFF @direction_fix = false when 37 # ‚·‚蔲‚¯ ON @through = true when 38 # ‚·‚蔲‚¯ OFF @through = false when 39 # ?Å‘O–Ê‚É•Ž¦ ON @always_on_top = true when 40 # ?Å‘O–Ê‚É•Ž¦ OFF @always_on_top = false when 41 # ƒOƒ‰ƒtƒBƒbƒN•Ï?X @tile_id = 0 @character_name = command.parameters[0] @character_hue = command.parameters[1] if @original_direction != command.parameters[2] @direction = command.parameters[2] @original_direction = @direction @prelock_direction = 0 end if @original_pattern != command.parameters[3] @pattern = command.parameters[3] @original_pattern = @pattern end when 42 # •s“§–¾“x‚Ì•Ï?X @opacity = command.parameters[0] when 43 # ?‡?¬•û–@‚Ì•Ï?X @blend_type = command.parameters[0] when 44 # SE ‚̉‰‘t $game_system.se_play(command.parameters[0]) when 45 # ƒXƒNƒŠƒvƒg result = eval(command.parameters[0]) end @move_route_index += 1 end endend#---------------# ?œ ƒtƒŒ?[ƒ€?X?V (ˆÚ“®)#---------------def update_move # ƒhƒb unless @dot_moving # ˆÚ“®‘¬“x‚©‚çƒ}ƒbƒv?À•WŒn‚ł̈ړ®‹——£‚ɕϊ· distance = 2 ** @move_speed # ˜_—??À•W‚ªŽÀ?À•W‚æ‚艺‚Ì?ê?‡ if @y * 128 > @real_y # ‰º‚Ɉړ® @real_y = [@real_y + distance, @y * 128].min end # ˜_—??À•W‚ªŽÀ?À•W‚æ‚è?¶‚Ì?ê?‡ if @x * 128 < @real_x # ?¶‚Ɉړ® @real_x = [@real_x - distance, @x * 128].max end # ˜_—??À•W‚ªŽÀ?À•W‚æ‚è‰E‚Ì?ê?‡ if @x * 128 > @real_x # ‰E‚Ɉړ® @real_x = [@real_x + distance, @x * 128].min end # ˜_—??À•W‚ªŽÀ?À•W‚æ‚è?ã‚Ì?ê?‡ if @y * 128 < @real_y # ?ã‚Ɉړ® @real_y = [@real_y - distance, @y * 128].max end end # ˆÚ“®ŽžƒAƒjƒ?‚ª ON ‚Ì?ê?‡ if @walk_anime # ƒAƒjƒ?ƒJƒEƒ“ƒg‚ð 1.5 ‘?‚â‚· @anime_count += 1.5 # ˆÚ“®ŽžƒAƒjƒ?‚ª OFF ‚Å?A’âŽ~ŽžƒAƒjƒ?‚ª ON ‚Ì?ê?‡ elsif @step_anime # ƒAƒjƒ?ƒJƒEƒ“ƒg‚ð 1 ‘?‚â‚· @anime_count += 1 endend#---------# ?œ ƒhƒbƒgˆÚ“®?i’ljÁ?j# dir : •ûŒü?i0,2,4,6,8?j#---------def dot_move(dir) @dot_moving = dir if dir == 0 or !dir return end # ?À•W‚̕ۑ¶ last_real_x, last_real_y = @real_x, @real_y last_x, last_y = @x, @y # ˆÚ“®‘¬“x‚©‚çƒ}ƒbƒv?À•WŒn‚ł̈ړ®‹——£‚ɕϊ· distance = 2 ** @move_speed # ?À•W‚ð?X?V?A?i?s•ûŒü‘¤‚Ì“ñ‹÷‚Ì?À•W‚𓾂é case dir when 2 turn_down @real_y += distance dx, dy = 0, 1 x1, y1 = @real_x + LEFT_SPACE, @real_y + 127 - BOTTOM_SPACE x2, y2 = @real_x + 127 - RIGHT_SPACE, y1 when 4 turn_left @real_x -= distance dx, dy = -1, 0 x1, y1 = @real_x + LEFT_SPACE, @real_y + TOP_SPACE x2, y2 = x1, @real_y + 127 - BOTTOM_SPACE when 6 turn_right @real_x += distance dx, dy = 1, 0 x1, y1 = @real_x + 127 - RIGHT_SPACE, @real_y + TOP_SPACE x2, y2 = x1, @real_y + 127 - BOTTOM_SPACE when 8 turn_up @real_y -= distance dx, dy = 0, -1 x1, y1 = @real_x + LEFT_SPACE, @real_y + TOP_SPACE x2, y2 = @real_x + 127 - RIGHT_SPACE, y1 end if (x1 / 128 != @x or y1 / 128 != @y) and (x2 / 128 != @x or y2 / 128 != @y) # ?i?s•ûŒü‚Ì“ñ‹÷‚ª‚Æ‚à‚É’Ê?s‰Â”‚©’²‚ׂé @x, @y = x1 / 128 - dx, y1 / 128 - dy pass1 = passable?(@x, @y, dir) @x, @y = x2 / 128 - dx, y2 / 128 - dy pass2 = passable?(@x, @y, dir) # ?À•W‚ðŒ³‚É–ß‚· @x, @y = last_x, last_y # ’Ê?s‰Â”‚È?ê?‡ if pass1 and pass2 # ?V‚µ‚¢ŽÀ?À•W‚ÌŒvŽZ @x, @y = (@real_x + 64) / 128, (@real_y + 64) / 128 # ?À•W‚ª•ω»‚µ‚½‚È‚ç•à?”?X?V if last_x != @x or last_y != @y increase_steps end # ’Ê?s•s‰Â”‚È?ê?‡ else # —§‚¿Ž~‚Ü‚é @dot_moving = 0 # ŽÀ?À•W‚ð‹¸?³‚·‚é case dir when 2 @real_y = [(last_real_y + 64) / 128 * 128, last_real_y].max # ‰E‘¤‚ÉŠñ‚Á‚Ä‚¢‚邯‚« if @real_x / 128 < @x # ‰E‚̃Cƒxƒ“ƒg‚ð?æ‚É?ˆ—? x1, x2 = x2, x1 end when 4 @real_x = [(last_real_x + 64) / 128 * 128, last_real_x].min # ‰º‘¤‚ÉŠñ‚Á‚Ä‚¢‚邯‚« if @real_y / 128 < @y # ‰º‚̃Cƒxƒ“ƒg‚ð?æ‚É?ˆ—? y1, y2 = y2, y1 end when 6 @real_x = [(last_real_x + 64) / 128 * 128, last_real_x].max # ‰º‘¤‚ÉŠñ‚Á‚Ä‚¢‚邯‚« if @real_y / 128 < @y # ‰º‚̃Cƒxƒ“ƒg‚ð?æ‚É?ˆ—? y1, y2 = y2, y1 end when 8 @real_y = [(last_real_y + 64) / 128 * 128, last_real_y].min # ‰E‘¤‚ÉŠñ‚Á‚Ä‚¢‚邯‚« if @real_x / 128 < @x # ‰E‚̃Cƒxƒ“ƒg‚ð?æ‚É?ˆ—? x1, x2 = x2, x1 end end check_event_trigger_touch(x1 / 128, y1 / 128) or check_event_trigger_touch(x2 / 128, y2 / 128) end endendend class Scene_Mapdef update # ƒ‹?[ƒv loop do $game_map.update $game_system.map_interpreter.update $game_player.update # ƒVƒXƒeƒ€ (ƒ^ƒCƒ}?[)?A‰æ–Ê‚ð?X?V $game_system.update $game_screen.update unless $game_temp.player_transferring break end # ?ê?ŠˆÚ“®‚ðŽÀ?s transfer_player if $game_temp.transition_processing break end end # ƒXƒv @spriteset.update # ƒ? @message_window.update # ƒQ?[ƒ€ƒI?[ƒo?[‚Ì?ê?‡ if $game_temp.gameover # ƒQ?[ƒ€ƒI $scene = Scene_Gameover.new return end # ƒ^ƒCƒgƒ‹‰æ–ʂɖ߂·?ê?‡ if $game_temp.to_title # ƒ^ƒCƒgƒ‹‰æ–Ê‚É?Ø‚è‘Ö‚¦ $scene = Scene_Title.new return end # ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“?ˆ—?’†‚Ì?ê?‡ if $game_temp.transition_processing # ƒgƒ‰ƒ“ƒW $game_temp.transition_processing = false # ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀ?s if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end # ƒ?ƒbƒZ?[ƒW if $game_temp.message_window_showing return end if $game_player.encounter_count == 0 and $game_map.encounter_list != [] unless $game_system.map_interpreter.running? or $game_system.encounter_disabled # ƒgƒ‹?[ƒv‚ðŒˆ’è n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] # ƒgƒ‹?[ƒv‚ª—LŒø‚È‚ç if $data_troops[troop_id] != nil # ƒ $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end # if Input.trigger?(Input::B) # unless $game_system.map_interpreter.running? or $game_system.menu_disabled # $game_temp.menu_calling = true $game_temp.menu_beep = true end end # ƒ if $DEBUG and Input.press?(Input::F9) # ƒfƒoƒbƒOŒÄ‚Ñ?o‚µƒtƒ‰ƒO‚ðƒZƒbƒg $game_temp.debug_calling = true end # ƒhƒbƒgˆÚ“®« unless !$game_player.dot_moving and $game_player.moving? # ŠeŽí‰æ–ʂ̌ĂÑ?o‚µ‚ðŽÀ?s if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug end endendend Ora la domanda è: Come faccio a far si che questo effetto sia presente solo tramite un mio richiamo?Per esempio che ci sia solo in mappe da me stabilite? Ho provato a smanettarci un pò, ma non ho idea di come fare :rovatfl: http://img143.imageshack.us/img143/1411/ubd6549sd1.png <-- La volpe è megliohttp://img215.imageshack.us/img215/1198/rmxpuser1ox4nwzd1.png <-- ma va? http://img246.imageshack.us/img246/1826/powlm5pr5.gifhttp://img530.imageshack.us/img530/4523/crashnewqw3.gifhttp://img407.imageshack.us/img407/1639/gintokiep5.gif http://img204.imageshack.us/img204/5715/naptitolopiccolo.png\--->Topic di Riferimento<---/ Link to comment Share on other sites More sharing options...
0 giver Posted January 19, 2010 Share Posted January 19, 2010 (edited) Allora. In alcuni minuti di tempo libero ho messo insieme questa versiona modificata.Lo script originale non è stato analizzato approfonditamente.La modifica non è stata fatta nel miglior modo possibile.Non è stata testata per vedere se funziona . . . Indi per cui, se vuoi provare ad usarlo è a tuo rischio . . . Ho aggiunto una costante, PIXEL_MOVE_START, che indica se, ad inizio partita, il pixel movement deve essere attivo, quando il valore inserito è true, o se si usa il movimento a tiles, quando il valore della costante è false . . . Per attivare il Pixel Movement, si usa, tramite (call) script$game_player.pixel_move = truee, ovviamente, per disattivarlo$game_player.pixel_move = false Cerca di cambiare l'impostazione, o appena prima di cambiare mappa, o come prima cosa nella nuova mappa che deve usarla diversa dalla precedente, per limitare il sorgere di problemi . . . Come ho detto, dubito che funzioni al primo colpo, comunque . . . EDIT - Sostituito lo script con una nuova versione modificata, in cui dovrebbe essere corretta l'anomalia riscontrata da Parbus . . . Edited January 20, 2010 by giver SCRIPT RGSS (RPG Maker XP) VINTAGE LIBRARY [2018+]http://www.rpg2s.net/forum/index.php/topic/21892-vintagevisualsrewrite-enhanced-revised-victory-screen-v-35-da-autori-vari-a-giver/ http://www.rpg2s.net/forum/index.php/topic/21868-eventing-utility-simple-last-battle-events-fix-v-30-by-giver/ http://www.rpg2s.net/forum/index.php/topic/21853-vintagerewrite-constance-menu-per-4-personaggi-da-team-constance-a-giver/ http://www.rpg2s.net/forum/index.php/topic/22126-vintagedoveroso-necroedit-dummy-title-22u-update-per-crearlo-ad-eventi-su-mappa-by-giver/ http://www.rpg2s.net/forum/index.php/topic/22127-vintagevisuals-tale-chapters-save-system-20-by-giver/ Breaking (in ogni senso) News: "Treno deraglia per via del seno di Sakurai Aoi . . ." - Info nello spoiler !! http://afantasymachine.altervista.org/_altervista_ht/NOOOOOOOOOilMIOtreninooooo_500.gifNon riesco a smettere di essere affascinato da immagini come questa . . .http://anime.vl-vostok.ru/art/photos2011/17/78049800/wall_VladAnime_WWA_1885-1680x1050.jpgAlcuni wallpapers che faccio ruotare sul mio vecchio PC . . .http://afantasymachine.altervista.org/_altervista_ht/gits_window.jpghttp://afantasymachine.altervista.org/_altervista_ht/madoka_group01.jpghttp://afantasymachine.altervista.org/_altervista_ht/arisu_picipici_01.jpghttp://afantasymachine.altervista.org/_altervista_ht/phantom_wp01_einzwei.jpg La parte più spassosa della mia vita è quando gli altri cercano di spiegarmi i miei pensieri . . . BBCode TestingTypeface & Size Link to comment Share on other sites More sharing options...
0 Parbus Posted January 20, 2010 Author Share Posted January 20, 2010 Intanto grazie dell'attenzione giver :rovatfl: Provando lo script effettivamente qualche problemino lo da. In pratica, lasciando le impostazioni base come PIXEL_MOVE_START = false Il charset del pg non si muove, cambiando solo la direzione sul posto in base ai comandi impartiti. Ho notato però che in realtà il pg si muove lo stesso, o meglio il suo evento, infatti nella mappa in cui l'ho provato ha interaggito con un'altro evento che stava parecchi tiles sopra. Nonostante il charset fosse riamasto immobile sul suo posto. Cambiando col richiamo script in game le impostazioni, torna tutto normale e perfettamente funzionante. Infatti anche se il PIXEL_MOVE_START è settato su "false" dallo script base. Se richiamo il $game_player.pixel_move = false senza passare per il "true", il Pg riprende a camminare normalmente. Niente da segnalare se le impostazioni di base vengono settate con PIXEL_MOVE_START = true http://img143.imageshack.us/img143/1411/ubd6549sd1.png <-- La volpe è megliohttp://img215.imageshack.us/img215/1198/rmxpuser1ox4nwzd1.png <-- ma va? http://img246.imageshack.us/img246/1826/powlm5pr5.gifhttp://img530.imageshack.us/img530/4523/crashnewqw3.gifhttp://img407.imageshack.us/img407/1639/gintokiep5.gif http://img204.imageshack.us/img204/5715/naptitolopiccolo.png\--->Topic di Riferimento<---/ Link to comment Share on other sites More sharing options...
0 giver Posted January 20, 2010 Share Posted January 20, 2010 Forse ho capito cosa crea quella anomalia, e se la mia ipotesi è corretta dovrebbe bastare la modifica della riga 19 della versione che ho realizzato, ossia@dot_moving = 0che deve diventare@dot_moving = 0 if PIXEL_MOVE_START Prova un po' a vedere se così funziona partendo dall'impostazione false . . . Nota: ho sostituito nel mio post precedente lo script allegato con una versione in cui la riga 19 è stata già modificata come indicato. SCRIPT RGSS (RPG Maker XP) VINTAGE LIBRARY [2018+]http://www.rpg2s.net/forum/index.php/topic/21892-vintagevisualsrewrite-enhanced-revised-victory-screen-v-35-da-autori-vari-a-giver/ http://www.rpg2s.net/forum/index.php/topic/21868-eventing-utility-simple-last-battle-events-fix-v-30-by-giver/ http://www.rpg2s.net/forum/index.php/topic/21853-vintagerewrite-constance-menu-per-4-personaggi-da-team-constance-a-giver/ http://www.rpg2s.net/forum/index.php/topic/22126-vintagedoveroso-necroedit-dummy-title-22u-update-per-crearlo-ad-eventi-su-mappa-by-giver/ http://www.rpg2s.net/forum/index.php/topic/22127-vintagevisuals-tale-chapters-save-system-20-by-giver/ Breaking (in ogni senso) News: "Treno deraglia per via del seno di Sakurai Aoi . . ." - Info nello spoiler !! http://afantasymachine.altervista.org/_altervista_ht/NOOOOOOOOOilMIOtreninooooo_500.gifNon riesco a smettere di essere affascinato da immagini come questa . . .http://anime.vl-vostok.ru/art/photos2011/17/78049800/wall_VladAnime_WWA_1885-1680x1050.jpgAlcuni wallpapers che faccio ruotare sul mio vecchio PC . . .http://afantasymachine.altervista.org/_altervista_ht/gits_window.jpghttp://afantasymachine.altervista.org/_altervista_ht/madoka_group01.jpghttp://afantasymachine.altervista.org/_altervista_ht/arisu_picipici_01.jpghttp://afantasymachine.altervista.org/_altervista_ht/phantom_wp01_einzwei.jpg La parte più spassosa della mia vita è quando gli altri cercano di spiegarmi i miei pensieri . . . BBCode TestingTypeface & Size Link to comment Share on other sites More sharing options...
0 Parbus Posted January 20, 2010 Author Share Posted January 20, 2010 Con la tua modifica della riga 19 non da più quell'anomalia. Così mi sembra andare tutto a meraviglia Non ho riscontrato bug o quant'altro almeno per ora. Se ci dovessero essere altri problemi ti faccio sapere! Grazie mille giver http://img143.imageshack.us/img143/1411/ubd6549sd1.png <-- La volpe è megliohttp://img215.imageshack.us/img215/1198/rmxpuser1ox4nwzd1.png <-- ma va? http://img246.imageshack.us/img246/1826/powlm5pr5.gifhttp://img530.imageshack.us/img530/4523/crashnewqw3.gifhttp://img407.imageshack.us/img407/1639/gintokiep5.gif http://img204.imageshack.us/img204/5715/naptitolopiccolo.png\--->Topic di Riferimento<---/ Link to comment Share on other sites More sharing options...
Question
Parbus
Salve gente!
Stavo spulciando un pò di script quando mi sono imbattuto in questo che permette la camminata a pixel
class Game_Player < Game_Character#----------------------# ?œ ’è?”#---------------------TOP_SPACE = BOTTOM_SPACE = 16 # ?㉺‚Ì”»’è–³Ž‹—̈æLEFT_SPACE = RIGHT_SPACE = 16 # ?¶‰E‚Ì”»’è–³Ž‹—̈æ#-----------------# ?œ ŒöŠJƒCƒ“ƒXƒ^ƒ“ƒX•Ï?”#-----------------attr_accessor :dot_moving #---------------------# ?œ ?‰Šú‰»#--------------------------def initialize super # ƒh @dot_moving = 0end#-----------# ?œ ˆÚ“®’†”»’è#-----------------def moving?(by_update = false) # if !by_update and @dot_moving # —§‚¿Ž~‚Ü‚Á‚Ä‚¢‚È‚¯‚ê‚Έړ®’† return @dot_moving != 0 else return (!@dot_moving and (@real_x != @x * 128 or @real_y != @y * 128)) endend#---------------# ?œ ˆÚ“®ƒ‹?[ƒg‚Ì‹?§# move_route : ?V‚µ‚¢ˆÚ“®ƒ‹?[ƒg#-----------------def force_move_route(move_route) # —§‚¿Ž~‚܂点‚é @dot_moving = 0 super(move_route)end#-------------------# ?œ ƒtƒŒ?[ƒ€?X?V#-----------------------def update # ƒ??[ƒJƒ‹•Ï?”‚É?À•W‚ð‹L‰¯ last_real_x, last_real_y = @real_x, @real_y last_x, last_y = @x, @y # ƒ last_moving = moving?(true) # ˆA # ƒ unless moving?(true) or $game_system.map_interpreter.running? or @move_route_forcing or $game_temp.message_window_showing # ƒhƒbƒgˆÚ“® dot_move(Input.dir4) end super if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y # ƒ}ƒbƒv‚ð‰º‚ÉƒXƒNƒ??[ƒ‹ $game_map.scroll_down(@real_y - last_real_y) end if @real_x < last_real_x and @real_x - $game_map.display_x < CENTER_X # ƒ}ƒbƒv‚ð?¶‚ɃXƒNƒ??[ƒ‹ $game_map.scroll_left(last_real_x - @real_x) end if @real_x > last_real_x and @real_x - $game_map.display_x > CENTER_X # ƒ}ƒbƒv‚ð‰E‚ɃXƒNƒ??[ƒ‹ $game_map.scroll_right(@real_x - last_real_x) end if @real_y < last_real_y and @real_y - $game_map.display_y < CENTER_Y # ƒ}ƒbƒv‚ð?ã‚ɃXƒNƒ??[ƒ‹ $game_map.scroll_up(last_real_y - @real_y) end # ˆÚ“®’†‚ł͂Ȃ¢?ê?‡ unless moving?(true) if last_x != @x or last_y != @y or (!@dot_moving and last_moving) # “¯ˆÊ’u‚̃Cƒxƒ“ƒg‚Æ‚Ì?Ú result = check_event_trigger_here([1,2]) # ‹N“®‚µ‚½ƒCƒxƒ“ƒg‚ª‚È‚¢?ê?‡ if result == false unless $DEBUG and Input.press?(Input::CTRL) # ƒGƒ“ƒJƒEƒ“ƒg ƒJƒEƒ“ƒgƒ_ƒEƒ“ if @encounter_count > 0 @encounter_count -= 1 end end # ‹N“®‚µ else # —§‚¿Ž~‚ @dot_moving = @dot_moving ? 0 : nil end end # C ƒ{ƒ^ƒ“‚ if Input.trigger?(Input::C) # “¯ˆÊ’u‚ check_event_trigger_here([0]) check_event_trigger_there([0,1,2]) end endend#---------------# ?œ ˆÚ“®ƒ^ƒCƒv : ƒJƒXƒ^ƒ€#---------------def move_type_custom # ’âŽ~’†‚łȂ¯‚ê‚Î’†’f if jumping? or moving? return end # ˆÚ“®ƒRƒ}ƒ“ƒh‚ÌƒŠ while @move_route_index < @move_route.list.size # ˆÚ“®ƒRƒ}ƒ“ƒh‚ðŽæ“¾ command = @move_route.list[@move_route_index] # ƒRƒ}ƒ“ƒhƒR?[ƒ if command.code == 0 # ƒIƒvƒVƒ‡ƒ“ if @move_route.repeat # ˆÚ“®ƒ‹?[ƒ @move_route_index = 0 end # ƒIƒvƒVƒ‡ƒ“ [“®?ì‚ðŒJ‚è•Ô‚·] ‚ª OFF ‚Ì?ê?‡ unless @move_route.repeat # ˆÚ“®ƒ‹?[ƒg‹?§’†‚Ì?ê?‡ if @move_route_forcing and not @move_route.repeat # ˆÚ“®ƒ‹?[ƒg‚Ì‹?§‚ð‰ð?œ @move_route_forcing = false # ƒIƒŠƒWƒiƒ‹‚̈ړ®ƒ‹?[ƒg‚𕜋A @move_route = @original_move_route @move_route_index = @original_move_route_index @original_move_route = nil end # ’âŽ~ƒJƒEƒ“ƒg‚ðƒNƒŠƒA @stop_count = 0 end return end # ˆÚ“®ŒnƒRƒ} if command.code <= 14 # ƒhƒbƒgˆÚ“®‹?§?I—¹ @dot_moving = nil # ƒRƒ}ƒ“ƒhƒR?[ƒh‚Å•ªŠò case command.code when 1 # ‰º‚Ɉړ® move_down when 2 # ?¶‚Ɉړ® move_left when 3 # ‰E‚Ɉړ® move_right when 4 # ?ã‚Ɉړ® move_up when 5 # ?¶‰º‚Ɉړ® move_lower_left when 6 # ‰E‰º‚Ɉړ® move_lower_right when 7 # ?¶?ã‚Ɉړ® move_upper_left when 8 # ‰E?ã‚Ɉړ® move_upper_right when 9 # ƒ‰ƒ“ƒ_ƒ€‚Ɉړ® move_random when 10 # ƒvƒŒƒC move_toward_player when 11 # ƒvƒŒƒCƒ move_away_from_player when 12 # ˆê•à‘O?i move_forward when 13 # ˆê•àŒã‘Þ move_backward when 14 # ƒWƒƒƒ“ƒv jump(command.parameters[0], command.parameters[1]) end if not @move_route.skippable and not moving? and not jumping? return end @move_route_index += 1 return end # ƒEƒFƒCƒg‚Ì?ê?‡ if command.code == 15 # ƒEƒFƒCƒgƒJƒEƒ“ƒg‚ð?Ý’è @wait_count = command.parameters[0] * 2 - 1 @move_route_index += 1 return end # Œü‚«•Ï?XŒn‚̃Rƒ}ƒ“ƒh‚Ì?ê?‡ if command.code >= 16 and command.code <= 26 # ƒRƒ}ƒ“ƒhƒR?[ƒh‚Å•ªŠò case command.code when 16 # ‰º‚ðŒü‚ turn_down when 17 # ?¶‚ðŒü‚ turn_left when 18 # ‰E‚ðŒü‚ turn_right when 19 # ?ã‚ðŒü‚ turn_up when 20 # ‰E‚É 90 “x‰ñ“] turn_right_90 when 21 # ?¶‚É 90 “x‰ñ“] turn_left_90 when 22 # 180 “x‰ñ“] turn_180 when 23 # ‰E‚©?¶‚É 90 “x‰ñ“] turn_right_or_left_90 when 24 # ƒ‰ƒ“ƒ_ƒ€‚É•ûŒü“]Š· turn_random when 25 # ƒvƒŒƒCƒ„?[‚Ì•û‚ðŒü‚ turn_toward_player when 26 # ƒvƒŒƒCƒ„?[‚Ì‹t‚ðŒü‚ turn_away_from_player end @move_route_index += 1 return end # ‚»‚Ì‘¼‚̃Rƒ}ƒ“ƒh‚Ì?ê?‡ if command.code >= 27 # ƒRƒ}ƒ“ƒhƒR?[ƒh‚Å•ªŠò case command.code when 27 # ƒXƒCƒbƒ` ON $game_switches[command.parameters[0]] = true $game_map.need_refresh = true when 28 # ƒXƒCƒbƒ` OFF $game_switches[command.parameters[0]] = false $game_map.need_refresh = true when 29 # ˆÚ“®‘¬“x‚Ì•Ï?X @move_speed = command.parameters[0] when 30 # ˆÚ“®•p“x‚Ì•Ï?X @move_frequency = command.parameters[0] when 31 # ˆÚ“®ŽžƒAƒjƒ? ON @walk_anime = true when 32 # ˆÚ“®ŽžƒAƒjƒ? OFF @walk_anime = false when 33 # ’âŽ~ŽžƒAƒjƒ? ON @step_anime = true when 34 # ’âŽ~ŽžƒAƒjƒ? OFF @step_anime = false when 35 # Œü‚«ŒÅ’è ON @direction_fix = true when 36 # Œü‚«ŒÅ’è OFF @direction_fix = false when 37 # ‚·‚蔲‚¯ ON @through = true when 38 # ‚·‚蔲‚¯ OFF @through = false when 39 # ?Å‘O–Ê‚É•Ž¦ ON @always_on_top = true when 40 # ?Å‘O–Ê‚É•Ž¦ OFF @always_on_top = false when 41 # ƒOƒ‰ƒtƒBƒbƒN•Ï?X @tile_id = 0 @character_name = command.parameters[0] @character_hue = command.parameters[1] if @original_direction != command.parameters[2] @direction = command.parameters[2] @original_direction = @direction @prelock_direction = 0 end if @original_pattern != command.parameters[3] @pattern = command.parameters[3] @original_pattern = @pattern end when 42 # •s“§–¾“x‚Ì•Ï?X @opacity = command.parameters[0] when 43 # ?‡?¬•û–@‚Ì•Ï?X @blend_type = command.parameters[0] when 44 # SE ‚̉‰‘t $game_system.se_play(command.parameters[0]) when 45 # ƒXƒNƒŠƒvƒg result = eval(command.parameters[0]) end @move_route_index += 1 end endend#---------------# ?œ ƒtƒŒ?[ƒ€?X?V (ˆÚ“®)#---------------def update_move # ƒhƒb unless @dot_moving # ˆÚ“®‘¬“x‚©‚çƒ}ƒbƒv?À•WŒn‚ł̈ړ®‹——£‚ɕϊ· distance = 2 ** @move_speed # ˜_—??À•W‚ªŽÀ?À•W‚æ‚艺‚Ì?ê?‡ if @y * 128 > @real_y # ‰º‚Ɉړ® @real_y = [@real_y + distance, @y * 128].min end # ˜_—??À•W‚ªŽÀ?À•W‚æ‚è?¶‚Ì?ê?‡ if @x * 128 < @real_x # ?¶‚Ɉړ® @real_x = [@real_x - distance, @x * 128].max end # ˜_—??À•W‚ªŽÀ?À•W‚æ‚è‰E‚Ì?ê?‡ if @x * 128 > @real_x # ‰E‚Ɉړ® @real_x = [@real_x + distance, @x * 128].min end # ˜_—??À•W‚ªŽÀ?À•W‚æ‚è?ã‚Ì?ê?‡ if @y * 128 < @real_y # ?ã‚Ɉړ® @real_y = [@real_y - distance, @y * 128].max end end # ˆÚ“®ŽžƒAƒjƒ?‚ª ON ‚Ì?ê?‡ if @walk_anime # ƒAƒjƒ?ƒJƒEƒ“ƒg‚ð 1.5 ‘?‚â‚· @anime_count += 1.5 # ˆÚ“®ŽžƒAƒjƒ?‚ª OFF ‚Å?A’âŽ~ŽžƒAƒjƒ?‚ª ON ‚Ì?ê?‡ elsif @step_anime # ƒAƒjƒ?ƒJƒEƒ“ƒg‚ð 1 ‘?‚â‚· @anime_count += 1 endend#---------# ?œ ƒhƒbƒgˆÚ“®?i’ljÁ?j# dir : •ûŒü?i0,2,4,6,8?j#---------def dot_move(dir) @dot_moving = dir if dir == 0 or !dir return end # ?À•W‚̕ۑ¶ last_real_x, last_real_y = @real_x, @real_y last_x, last_y = @x, @y # ˆÚ“®‘¬“x‚©‚çƒ}ƒbƒv?À•WŒn‚ł̈ړ®‹——£‚ɕϊ· distance = 2 ** @move_speed # ?À•W‚ð?X?V?A?i?s•ûŒü‘¤‚Ì“ñ‹÷‚Ì?À•W‚𓾂é case dir when 2 turn_down @real_y += distance dx, dy = 0, 1 x1, y1 = @real_x + LEFT_SPACE, @real_y + 127 - BOTTOM_SPACE x2, y2 = @real_x + 127 - RIGHT_SPACE, y1 when 4 turn_left @real_x -= distance dx, dy = -1, 0 x1, y1 = @real_x + LEFT_SPACE, @real_y + TOP_SPACE x2, y2 = x1, @real_y + 127 - BOTTOM_SPACE when 6 turn_right @real_x += distance dx, dy = 1, 0 x1, y1 = @real_x + 127 - RIGHT_SPACE, @real_y + TOP_SPACE x2, y2 = x1, @real_y + 127 - BOTTOM_SPACE when 8 turn_up @real_y -= distance dx, dy = 0, -1 x1, y1 = @real_x + LEFT_SPACE, @real_y + TOP_SPACE x2, y2 = @real_x + 127 - RIGHT_SPACE, y1 end if (x1 / 128 != @x or y1 / 128 != @y) and (x2 / 128 != @x or y2 / 128 != @y) # ?i?s•ûŒü‚Ì“ñ‹÷‚ª‚Æ‚à‚É’Ê?s‰Â”‚©’²‚ׂé @x, @y = x1 / 128 - dx, y1 / 128 - dy pass1 = passable?(@x, @y, dir) @x, @y = x2 / 128 - dx, y2 / 128 - dy pass2 = passable?(@x, @y, dir) # ?À•W‚ðŒ³‚É–ß‚· @x, @y = last_x, last_y # ’Ê?s‰Â”‚È?ê?‡ if pass1 and pass2 # ?V‚µ‚¢ŽÀ?À•W‚ÌŒvŽZ @x, @y = (@real_x + 64) / 128, (@real_y + 64) / 128 # ?À•W‚ª•ω»‚µ‚½‚È‚ç•à?”?X?V if last_x != @x or last_y != @y increase_steps end # ’Ê?s•s‰Â”‚È?ê?‡ else # —§‚¿Ž~‚Ü‚é @dot_moving = 0 # ŽÀ?À•W‚ð‹¸?³‚·‚é case dir when 2 @real_y = [(last_real_y + 64) / 128 * 128, last_real_y].max # ‰E‘¤‚ÉŠñ‚Á‚Ä‚¢‚邯‚« if @real_x / 128 < @x # ‰E‚̃Cƒxƒ“ƒg‚ð?æ‚É?ˆ—? x1, x2 = x2, x1 end when 4 @real_x = [(last_real_x + 64) / 128 * 128, last_real_x].min # ‰º‘¤‚ÉŠñ‚Á‚Ä‚¢‚邯‚« if @real_y / 128 < @y # ‰º‚̃Cƒxƒ“ƒg‚ð?æ‚É?ˆ—? y1, y2 = y2, y1 end when 6 @real_x = [(last_real_x + 64) / 128 * 128, last_real_x].max # ‰º‘¤‚ÉŠñ‚Á‚Ä‚¢‚邯‚« if @real_y / 128 < @y # ‰º‚̃Cƒxƒ“ƒg‚ð?æ‚É?ˆ—? y1, y2 = y2, y1 end when 8 @real_y = [(last_real_y + 64) / 128 * 128, last_real_y].min # ‰E‘¤‚ÉŠñ‚Á‚Ä‚¢‚邯‚« if @real_x / 128 < @x # ‰E‚̃Cƒxƒ“ƒg‚ð?æ‚É?ˆ—? x1, x2 = x2, x1 end end check_event_trigger_touch(x1 / 128, y1 / 128) or check_event_trigger_touch(x2 / 128, y2 / 128) end endendend class Scene_Mapdef update # ƒ‹?[ƒv loop do $game_map.update $game_system.map_interpreter.update $game_player.update # ƒVƒXƒeƒ€ (ƒ^ƒCƒ}?[)?A‰æ–Ê‚ð?X?V $game_system.update $game_screen.update unless $game_temp.player_transferring break end # ?ê?ŠˆÚ“®‚ðŽÀ?s transfer_player if $game_temp.transition_processing break end end # ƒXƒv @spriteset.update # ƒ? @message_window.update # ƒQ?[ƒ€ƒI?[ƒo?[‚Ì?ê?‡ if $game_temp.gameover # ƒQ?[ƒ€ƒI $scene = Scene_Gameover.new return end # ƒ^ƒCƒgƒ‹‰æ–ʂɖ߂·?ê?‡ if $game_temp.to_title # ƒ^ƒCƒgƒ‹‰æ–Ê‚É?Ø‚è‘Ö‚¦ $scene = Scene_Title.new return end # ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“?ˆ—?’†‚Ì?ê?‡ if $game_temp.transition_processing # ƒgƒ‰ƒ“ƒW $game_temp.transition_processing = false # ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀ?s if $game_temp.transition_name == "" Graphics.transition(20) else Graphics.transition(40, "Graphics/Transitions/" + $game_temp.transition_name) end end # ƒ?ƒbƒZ?[ƒW if $game_temp.message_window_showing return end if $game_player.encounter_count == 0 and $game_map.encounter_list != [] unless $game_system.map_interpreter.running? or $game_system.encounter_disabled # ƒgƒ‹?[ƒv‚ðŒˆ’è n = rand($game_map.encounter_list.size) troop_id = $game_map.encounter_list[n] # ƒgƒ‹?[ƒv‚ª—LŒø‚È‚ç if $data_troops[troop_id] != nil # ƒ $game_temp.battle_calling = true $game_temp.battle_troop_id = troop_id $game_temp.battle_can_escape = true $game_temp.battle_can_lose = false $game_temp.battle_proc = nil end end end # if Input.trigger?(Input::B) # unless $game_system.map_interpreter.running? or $game_system.menu_disabled # $game_temp.menu_calling = true $game_temp.menu_beep = true end end # ƒ if $DEBUG and Input.press?(Input::F9) # ƒfƒoƒbƒOŒÄ‚Ñ?o‚µƒtƒ‰ƒO‚ðƒZƒbƒg $game_temp.debug_calling = true end # ƒhƒbƒgˆÚ“®« unless !$game_player.dot_moving and $game_player.moving? # ŠeŽí‰æ–ʂ̌ĂÑ?o‚µ‚ðŽÀ?s if $game_temp.battle_calling call_battle elsif $game_temp.shop_calling call_shop elsif $game_temp.name_calling call_name elsif $game_temp.menu_calling call_menu elsif $game_temp.save_calling call_save elsif $game_temp.debug_calling call_debug end endendendOra la domanda è: Come faccio a far si che questo effetto sia presente solo tramite un mio richiamo?
Per esempio che ci sia solo in mappe da me stabilite?
Ho provato a smanettarci un pò, ma non ho idea di come fare :rovatfl:
http://img143.imageshack.us/img143/1411/ubd6549sd1.png <-- La volpe è meglio
http://img215.imageshack.us/img215/1198/rmxpuser1ox4nwzd1.png <-- ma va?
http://img246.imageshack.us/img246/1826/powlm5pr5.gifhttp://img530.imageshack.us/img530/4523/crashnewqw3.gifhttp://img407.imageshack.us/img407/1639/gintokiep5.gif
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now