Jump to content
Rpg²S Forum
  • 0

Character 8-Direzioni


FenriX`
 Share

Question

Allora... mi scuso per questo topic, ho visto che ve ne sono milioni gia aperti nel forum XD ma a nessuno è stata data una risposta... tutti broken-link... script che fan crashare i giochi, tutta roba inconcludente...

ora... è assurdo che non si trovi neanche uno script decente per la grafica ad 8 direzioni O_O generalmente è uno degli script che gli utenti vanno a cercare più frequentemente...

 

Ho girato su 4-5 siti di making... e non ho trovato assolutamente niente, ho cercato qui, con le parole chiave "isometrico", "direzioni" stesse parole chiave (in inglese) ho usato negli altri siti... ma non si trova assolutamente niente di funzionante, a me sa incredibile XD

 

O meglio... A dire il vero uno l'ho trovato XD però imposta le 8 direzioni a tutti gli eventi, non solo per il protagonista, e questo mi crea numerosissimi problemi, visto che lo devo attivare solo occasionalmente...

 

La mia domanda quindi è:

Esiste o no uno script per grafica 8-direzionale che influisce solo sul protagonista? (Non pensavo avrei incontrato tanti problemi per trovarne uno)

 

 

#============================================================================# * 8 Directional Movement in RPG Maker XP#----------------------------------------------------------------------------# by MegatotsuRPG# Date created: 01.05.08# Last Update:  01.05.08#----------------------------------------------------------------------------#	This script provides 8 directional movement, instead of the cruddy# default movement system. #----------------------------------------------------------------------------##							 Instructions								  ##  You can disable the player's movement with this: #  "$movedisabled = true" . Make sure to remove the double quotes, though.##   Also, the charsets have to be in the following format:#	 1 Lower_left#	 2 Down#	 3 Lower_right#	 4 Left#	 5 Right#	 6 Upper_left#	 7 Up#	 8 Upper_right#----------------------------------------------------------------------------##						 Credits and Thanks##			   A big thank you and kiss to Blizzard, because I figured out#	  how to do this from his ABS.#			   Thanks to Draycos Goldaryn, because I used part of his edit# to sprite_character, and the 8-directional charset from his advanced player# movement :p .###			   Now on to the script!#============================================================================ class Game_Player < Game_Character   #--------------------------------------------------------------------------  # * Frame Update (Updated for axial movement)  #--------------------------------------------------------------------------  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 or $movedisabled	  case Input.dir8	  when 1		move_lower_left	  when 2		move_down	  when 3		move_lower_right	  when 4		move_left	  when 6		move_right	  when 7		move_upper_left	  when 8		move_up	  when 9		move_upper_right	  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  endend class Game_Character   #--------------------------------------------------------------------------  # * Move Lower Left  #--------------------------------------------------------------------------  def move_lower_left(turn_enabled = true)	# Turn up	if turn_enabled	  turn_lower_left	end	# When a down to left or a left to down course is passable	if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or	   (passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))	  # Update coordinates	  @x -= 1	  @y += 1	  # Increase steps	  increase_steps	# If impassable	else	  # Determine if touch event is triggered	  check_event_trigger_touch(@x-1, @y+1)	end  end  #--------------------------------------------------------------------------  # * Move Lower Right  #--------------------------------------------------------------------------  def move_lower_right(turn_enabled = true)	# Turn up	if turn_enabled	  turn_lower_right	end	# When a down to right or a right to down course is passable	if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or	   (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))	  # Update coordinates	  @x += 1	  @y += 1	  # Increase steps	  increase_steps	# If impassable	else	  # Determine if touch event is triggered	  check_event_trigger_touch(@x+1, @y+1)	end  end  #--------------------------------------------------------------------------  # * Move Upper Left  #--------------------------------------------------------------------------  def move_upper_left(turn_enabled = true)	# Turn up	if turn_enabled	  turn_upper_left	end	# When an up to left or a left to up course is passable	if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or	   (passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))	  # Update coordinates	  @x -= 1	  @y -= 1	  # Increase steps	  increase_steps	# If impassable	else	  # Determine if touch event is triggered	  check_event_trigger_touch(@x-1, @y-1)	end  end  #--------------------------------------------------------------------------  # * Move Upper Right  #--------------------------------------------------------------------------  def move_upper_right(turn_enabled = true)	# Turn up	if turn_enabled	  turn_upper_right	end	# When an up to right or a right to up course is passable	if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or	   (passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))	  # Update coordinates	  @x += 1	  @y -= 1	  # Increase steps	  increase_steps	# If impassable	else	  # Determine if touch event is triggered	  check_event_trigger_touch(@x+1, @y-1)	end  end  #--------------------------------------------------------------------------  # * Move at Random  #--------------------------------------------------------------------------  def move_random	case rand(8)	when 0  # Move down	  move_down	when 1  # Move left	  move_left	when 2  # Move right	  move_right	when 3  # Move up	  move_up	when 4	  move_lower_left	when 5	  move_lower_right	when 6	  move_upper_left	when 7	  move_upper_right	end  end  #--------------------------------------------------------------------------  # * Move toward Player  #--------------------------------------------------------------------------  def move_toward_player	# Get difference in player coordinates	sx = @x - $game_player.x	sy = @y - $game_player.y	# If coordinates are equal	if sx == 0 and sy == 0	  return	end	# Get absolute value of difference	abs_sx = sx.abs	abs_sy = sy.abs	#get diagonal differences	sh = (abs_sx / 2) - abs_sy	sv = (abs_sy / 2) - abs_sx	# Is the player more towards a 45? angle?	if abs_sx == abs_sy || (sv < 0 and sh < 0)	  if $game_player.y > @y		#if the player is lower left		if $game_player.x < @x		  move_lower_left		#If the player is lower right		else		  move_lower_right		end	  else		#if the player is upper left		if $game_player.x < @x		  move_upper_left		#if the player is upper right		else		  move_upper_right		end	  end	# If horizontal distance is longer	elsif abs_sx > abs_sy	  # Move towards player, prioritize left and right directions	  sx > 0 ? move_left : move_right	  if not moving? and sy != 0		sy > 0 ? move_up : move_down	  end	# If vertical distance is longer	else	  # Move towards player, prioritize up and down directions	  sy > 0 ? move_up : move_down	  if not moving? and sx != 0		sx > 0 ? move_left : move_right	  end	end  end  #--------------------------------------------------------------------------  # * Move away from Player  #--------------------------------------------------------------------------  def move_away_from_player	# Get difference in player coordinates	sx = @x - $game_player.x	sy = @y - $game_player.y	# If coordinates are equal	if sx == 0 and sy == 0	  return	end	# Get absolute value of difference	abs_sx = sx.abs	abs_sy = sy.abs	#get diagonal differences	sh = (abs_sx / 2) - abs_sy	sv = (abs_sy / 2) - abs_sx	# Is the player more towards a 45? angle?	if abs_sx == abs_sy || (sv < 0 and sh < 0)	  if $game_player.y > @y		#if the player is lower left		if $game_player.x < @x		  move_upper_right		#If the player is lower right		else		  move_upper_left		end	  else		#if the player is upper left		if $game_player.x < @x		  move_lower_right		#if the player is upper right		else		  move_lower_left		end	  end	# If horizontal distance is longer	elsif abs_sx > abs_sy	  # Move away from player, prioritize left and right directions	  sx > 0 ? move_right : move_left	  if not moving? and sy != 0		sy > 0 ? move_down : move_up	  end	# If vertical distance is longer	else	  # Move away from player, prioritize up and down directions	  sy > 0 ? move_down : move_up	  if not moving? and sx != 0		sx > 0 ? move_right : move_left	  end	end  end  #--------------------------------------------------------------------------  # * 1 Step Forward  #--------------------------------------------------------------------------  def move_forward	case @direction	when 2	  move_down(false)	when 4	  move_left(false)	when 6	  move_right(false)	when 8	  move_up(false)	when 1 #lower left	  move_lower_left(false)	when 3 #lower right	  move_lower_right(false)	when 7 #upper left	  move_upper_left(false)	when 9 #upper right	  move_upper_right(false)	end  end  #--------------------------------------------------------------------------  # * 1 Step Backward  #--------------------------------------------------------------------------  def move_backward	# Remember direction fix situation	last_direction_fix = @direction_fix	# Force directino fix	@direction_fix = true	# Branch by direction	case @direction	when 2  # Down	  move_up(false)	when 4  # Left	  move_right(false)	when 6  # Right	  move_left(false)	when 8  # Up	  move_down(false)	when 1 #lower left	  move_upper_right(false)	when 3 #lower right	  move_upper_left(false)	when 7 #upper left	  move_lower_right(false)	when 9 #upper right	  move_lower_left(false)	end	# Return direction fix situation back to normal	@direction_fix = last_direction_fix  end  #--------------------------------------------------------------------------  # * Jump  #	 x_plus : x-coordinate plus value  #	 y_plus : y-coordinate plus value  #--------------------------------------------------------------------------  def jump(x_plus, y_plus)	# If plus value is not (0,0)	if x_plus != 0 or y_plus != 0	  # If horizontal distnace is longer	  if x_plus.abs > y_plus.abs		# Change direction to left or right		x_plus < 0 ? turn_left : turn_right	  # If vertical distance is longer	  elsif x_plus.abs < y_plus.abs		# Change direction to up or down		y_plus < 0 ? turn_up : turn_down	  # if distances are equal	  else		if x_plus < 0		  if y_plus < 0			turn_upper_left		  else			turn_lower_left		  end		else		  if y_plus < 0			turn_upper_right		  else			turn_lower_right		  end		end	  end	end	# Calculate new coordinates	new_x = @x + x_plus	new_y = @y + y_plus	# If plus value is (0,0) or jump destination is passable	if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)	  # Straighten position	  straighten	  # Update coordinates	  @x = new_x	  @y = new_y	  # Calculate distance	  distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round	  # Set jump count	  @jump_peak = 10 + distance - @move_speed	  @jump_count = @jump_peak * 2	  # Clear stop count	  @stop_count = 0	end  end  #--------------------------------------------------------------------------  # * Turn Lower Left  #--------------------------------------------------------------------------  def turn_lower_left	unless @direction_fix	  @direction = 1	  @stop_count = 0	end  end  #--------------------------------------------------------------------------  # * Turn Lower Right  #--------------------------------------------------------------------------  def turn_lower_right	unless @direction_fix	  @direction = 3	  @stop_count = 0	end  end  #--------------------------------------------------------------------------  # * Turn Upper Left  #--------------------------------------------------------------------------  def turn_upper_left	unless @direction_fix	  @direction = 7	  @stop_count = 0	end  end  #--------------------------------------------------------------------------  # * Turn Upper Right  #--------------------------------------------------------------------------  def turn_upper_right	unless @direction_fix	  @direction = 9	  @stop_count = 0	end  end  #--------------------------------------------------------------------------  # * Turn 90? Right  #--------------------------------------------------------------------------  def turn_right_90	case @direction	when 2	  turn_left	when 4	  turn_up	when 6	  turn_down	when 8	  turn_right	when 1	  turn_upper_left	when 3	  turn_lower_left	when 7	  turn_upper_right	when 9	  turn_lower_right	end  end  #--------------------------------------------------------------------------  # * Turn 90? Left  #--------------------------------------------------------------------------  def turn_left_90	case @direction	when 2	  turn_right	when 4	  turn_down	when 6	  turn_up	when 8	  turn_left	when 1	  turn_upper_right	when 3	  turn_upper_left	when 7	  turn_lower_right	when 9	  turn_lower_left	end  end  #--------------------------------------------------------------------------  # * Turn 180?  #--------------------------------------------------------------------------  def turn_180	case @direction	when 2	  turn_up	when 4	  turn_right	when 6	  turn_left	when 8	  turn_down	when 1	  turn_upper_left	when 3	  turn_lower_left	when 7	  turn_upper_right	when 9	  turn_lower_right	end  end  #--------------------------------------------------------------------------  # * Turn 90? Right or Left  #--------------------------------------------------------------------------  def turn_right_or_left_90	if rand(2) == 0	  turn_right_90	else	  turn_left_90	end  end  #--------------------------------------------------------------------------  # * Turn at Random  #--------------------------------------------------------------------------  def turn_random	case rand(8)	when 0	  turn_up	when 1	  turn_right	when 2	  turn_left	when 3	  turn_down	when 4	  turn_lower_left	when 5	  turn_lower_right	when 6	  turn_upper_left	when 7	  turn_upper_right	end  end  #--------------------------------------------------------------------------  # * Turn 45? Right  #--------------------------------------------------------------------------  def turn_45_right	case @direction	when 2	  turn_lower_left	when 4	  turn_upper_left	when 6	  turn_lower_right	when 8	  turn_upper_right	when 1	  turn_left	when 3	  turn_down	when 7	  turn_up	when 9	  turn_right	end  end  #--------------------------------------------------------------------------  # * Turn 45? Left  #--------------------------------------------------------------------------  def turn_45_left	case @direction	when 2	  turn_lower_right	when 4	  turn_lower_left	when 6	  turn_upper_right	when 8	  turn_upper_left	when 1	  turn_down	when 3	  turn_right	when 7	  turn_left	when 9	  turn_up	end  end  #--------------------------------------------------------------------------  # * Turn 45? Right or Left  #--------------------------------------------------------------------------  def turn_45_right_or_left	if rand(2) == 0	  turn_right_45	else	  turn_left_45	end  end  #--------------------------------------------------------------------------  # * Turn Forward Right  #--------------------------------------------------------------------------  def turn_forward_right	turn_45_right	move_forward  end  #--------------------------------------------------------------------------  # * Turn Forward Left  #--------------------------------------------------------------------------  def turn_forward_left	turn_45_left	move_forward  end  #--------------------------------------------------------------------------  # * Turn Backward Right  #--------------------------------------------------------------------------  def turn_backward_right	turn_45_right	move_backward  end  #--------------------------------------------------------------------------  # * Turn Backward Left  #--------------------------------------------------------------------------  def turn_backward_left	turn_45_left	move_backward  end  #--------------------------------------------------------------------------  # * Turn Towards Player  #--------------------------------------------------------------------------  def turn_toward_player	# Get difference in player coordinates	sx = @x - $game_player.x	sy = @y - $game_player.y	# If coordinates are equal	if sx == 0 and sy == 0	  return	end	# Get absolute value of difference	abs_sx = sx.abs	abs_sy = sy.abs	#get diagonal differences	sh = (abs_sx / 2) - abs_sy	sv = (abs_sy / 2) - abs_sx	# If the diagonal distance is equal	if (sh == 0 or sv == 0) && 	   ((abs_sx != 1 and abs_sy != 0) or (abs_sx != 0 and abs_sy != 1))	  return	end	# Is the player more towards a 45? angle?	if abs_sx == abs_sy || (sv < 0 and sh < 0)	  if $game_player.y > @y		#if the player is lower left		if $game_player.x < @x		  turn_lower_left		#If the player is lower right		else		  turn_lower_right		end	  else		#if the player is upper left		if $game_player.x < @x		  turn_upper_left		#if the player is upper right		else		  turn_upper_right		end	  end	# If horizontal distance is longer	elsif abs_sx > abs_sy	  # Turn to the right or left toward player	  sx > 0 ? turn_left : turn_right	# If vertical distance is longer	else	  # Turn up or down toward player	  sy > 0 ? turn_up : turn_down	end  end  #--------------------------------------------------------------------------  # * Turn Away from Player  #--------------------------------------------------------------------------  def turn_away_from_player	# Get difference in player coordinates	sx = @x - $game_player.x	sy = @y - $game_player.y	# If coordinates are equal	if sx == 0 and sy == 0	  return	end	# Get absolute value of difference	abs_sx = sx.abs	abs_sy = sy.abs	#get diagonal differences	sh = (abs_sx / 2) - abs_sy	sv = (abs_sy / 2) - abs_sx	# If the diagonal distance is equal	if (sh == 0 or sv == 0) && 	   ((abs_sx != 1 and abs_sy != 0) or (abs_sx != 0 and abs_sy != 1))	  return	end	# Is the player more towards a 45? angle?	if abs_sx == abs_sy || (sv < 0 and sh < 0)	  if $game_player.y > @y		#if the player is lower left		if $game_player.x < @x		  turn_upper_right		#If the player is lower right		else		  turn_upper_left		end	  else		#if the player is upper left		if $game_player.x < @x		  turn_lower_right		#if the player is upper right		else		  turn_lower_left		end	  end	# If horizontal distance is longer	elsif abs_sx > abs_sy	  # Turn to the right or left away from player	  sx > 0 ? turn_right : turn_left	# If vertical distance is longer	else	  # Turn up or down away from player	  sy > 0 ? turn_down : turn_up	end  endend class Sprite_Character < RPG::Sprite   #--------------------------------------------------------------------------  # * Frame Update (edited)  #--------------------------------------------------------------------------  def update	super	# If tile ID, file name, or hue are different from current ones	if @tile_id != @character.tile_id or	   @character_name != @character.character_name or	   @character_hue != @character.character_hue	  # Remember tile ID, file name, and hue	  @tile_id = @character.tile_id	  @character_name = @character.character_name	  @character_hue = @character.character_hue	  # If tile ID value is valid	  if @tile_id >= 384		self.bitmap = RPG::Cache.tile($game_map.tileset_name,									  @tile_id, @character.character_hue)		self.src_rect.set(0, 0, 32, 32)		self.ox = 16		self.oy = 32	  # If tile ID value is invalid	  else		self.bitmap = RPG::Cache.character(@character.character_name,										   @character.character_hue)		@cw = bitmap.width / 4		@ch = bitmap.height / 8		self.ox = @cw / 2		self.oy = @ch	  end	end	# Set visible situation	self.visible = (not @character.transparent)	# If graphic is character	if @tile_id == 0	  # Set rectangular transfer	  sx = @character.pattern * @cw	  if @character.direction >= 6		sy = (@character.direction - 2 ) * @ch	  else		sy = (@character.direction - 1 ) * @ch	  end	  self.src_rect.set(sx, sy, @cw, @ch)	end	# Set sprite coordinates	self.x = @character.screen_x	self.y = @character.screen_y	self.z = @character.screen_z(@ch)	# Set opacity level, blend method, and bush depth	self.opacity = @character.opacity	self.blend_type = @character.blend_type	self.bush_depth = @character.bush_depth	# Animation	if @character.animation_id != 0	  animation = $data_animations[@character.animation_id]	  animation(animation, true)	  @character.animation_id = 0	end  endend

 

 

Forse è possibile modificare questo per far si che influisca solo sul protagonista... non so...

eventualmente farà comodo a chi cerca uno script per le 8 direzioni... Spero fortemente che sia possibile trovarne uno funzionante XD

Edited by FenriX`

 

 

Membro # 8-8-8 [Hachi] della:

http://img3.imageshack.us/img3/9636/bannergm.png

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Risolto... opera di ProGM, detto anche Prottino U.U creditate lui...

 

#==============================================================================# ** Sprite_Character#------------------------------------------------------------------------------#  This sprite is used to display the character.It observes the Game_Character#  class and automatically changes sprite conditions.#============================================================================== class Sprite_Character < RPG::Sprite  #--------------------------------------------------------------------------  # * Public Instance Variables  #--------------------------------------------------------------------------  attr_accessor :character				# character  #--------------------------------------------------------------------------  # * Object Initialization  #	 viewport  : viewport  #	 character : character (Game_Character)  #--------------------------------------------------------------------------  def initialize(viewport, character = nil)	super(viewport)	@character = character	update  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update	super	# If tile ID, file name, or hue are different from current ones	if @tile_id != @character.tile_id or	   @character_name != @character.character_name or	   @character_hue != @character.character_hue	  # Remember tile ID, file name, and hue	  @tile_id = @character.tile_id	  @character_name = @character.character_name	  @character_hue = @character.character_hue	  # If tile ID value is valid	  if @tile_id >= 384		self.bitmap = RPG::Cache.tile($game_map.tileset_name,		  @tile_id, @character.character_hue)		self.src_rect.set(0, 0, 32, 32)		self.ox = 16		self.oy = 32	  # If tile ID value is invalid	  else		self.bitmap = RPG::Cache.character(@character.character_name,		  @character.character_hue)		@cw = bitmap.width / 4		@ch = bitmap.height / (@character.is_a?(Game_Player) ? 8 : 4)		self.ox = @cw / 2		self.oy = @ch	  end	end	# Set visible situation	self.visible = (not @character.transparent)	# If graphic is character	if @tile_id == 0	  # Set rectangular transfer	  sx = @character.pattern * @cw	  if @character.is_a?(Game_Player)		case @character.direction		when 1		sy = 0		when 2		sy = @ch		when 3		sy = 2*@ch		when 4		sy = 3*@ch		when 6		sy = 4*@ch		when 7		sy = 5*@ch		when 8		sy = 6*@ch		when 9		sy = 7*@ch		end	  else		sy = (@character.direction - 2) / 2 * @ch	  end	  self.src_rect.set(sx, sy, @cw, @ch)	end	# Set sprite coordinates	self.x = @character.screen_x	self.y = @character.screen_y	self.z = @character.screen_z(@ch)	# Set opacity level, blend method, and bush depth	self.opacity = @character.opacity	self.blend_type = @character.blend_type	self.bush_depth = @character.bush_depth	# Animation	if @character.animation_id != 0	  animation = $data_animations[@character.animation_id]	  animation(animation, true)	  @character.animation_id = 0	end  endend#==============================================================================# ** 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.dir8	  when 2		move_down	  when 4		move_left	  when 6		move_right	  when 8		move_up	  when 7		move_upper_left	  when 9		move_upper_right	  when 1		move_lower_left	  when 3		move_lower_right	  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	#--------------------------------------------------------------------------  # * Move Lower Left  #--------------------------------------------------------------------------  def move_lower_left	# If no direction fix	unless @direction_fix	  # Face down is facing right or up	  @direction = 1	end	# When a down to left or a left to down course is passable	if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 4)) or	   (passable?(@x, @y, 4) and passable?(@x - 1, @y, 2))	  # Update coordinates	  @x -= 1	  @y += 1	  # Increase steps	  increase_steps	end  end  #--------------------------------------------------------------------------  # * Move Lower Right  #--------------------------------------------------------------------------  def move_lower_right	# If no direction fix	unless @direction_fix	  # Face right if facing left, and face down if facing up	  @direction = 3	end	# When a down to right or a right to down course is passable	if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or	   (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))	  # Update coordinates	  @x += 1	  @y += 1	  # Increase steps	  increase_steps	end  end  #--------------------------------------------------------------------------  # * Move Upper Left  #--------------------------------------------------------------------------  def move_upper_left	# If no direction fix	unless @direction_fix	  # Face left if facing right, and face up if facing down	  @direction = 7	end	# When an up to left or a left to up course is passable	if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 4)) or	   (passable?(@x, @y, 4) and passable?(@x - 1, @y, 8))	  # Update coordinates	  @x -= 1	  @y -= 1	  # Increase steps	  increase_steps	end  end  #--------------------------------------------------------------------------  # * Move Upper Right  #--------------------------------------------------------------------------  def move_upper_right	# If no direction fix	unless @direction_fix	  # Face right if facing left, and face up if facing down	  @direction = 9	end	# When an up to right or a right to up course is passable	if (passable?(@x, @y, 8) and passable?(@x, @y - 1, 6)) or	   (passable?(@x, @y, 6) and passable?(@x + 1, @y, 8))	  # Update coordinates	  @x += 1	  @y -= 1	  # Increase steps	  increase_steps	end  endend

Edited by FenriX`

 

 

Membro # 8-8-8 [Hachi] della:

http://img3.imageshack.us/img3/9636/bannergm.png

Link to comment
Share on other sites

  • 0
Ben fatto! :smile:

http://rpg2s.net/gif/SCContest1Oct.gif

 

Game Contest #3

http://www.rpg2s.net/gif/GC_premio2.gifhttp://www.rpg2s.net/gif/GC_premio3.gifhttp://www.rpg2s.net/gif/GC_premio3.gifhttp://www.rpg2s.net/gif/GC_premio2.gifhttp://www.rpg2s.net/gif/GC_premio2.gifhttp://www.rpg2s.net/gif/GC_grafica3.gifhttp://www.rpg2s.net/gif/GC_musica1.gifhttp://www.rpg2s.net/gif/GC_bestoftool1.gif

Link to comment
Share on other sites

  • 0

L'ho cercato per anni *ç* Prottino We Love U!! xD

 

 

 

:smile:


Hai una firma?

Mmh...no?

NON HAI UNA FIRMA?! NON HO UNA FIRMA?!?! AAAAAAAAAAAAHH!!

http://screenshot.it.sftcdn.net/it/scrn/83000/83352/homer-munch-theme-2.jpg

 

Tributo al folletto 8D (ad opera di Flame, ovviamente o_o'):
http://img12.imageshack.us/img12/3218/tryflamelol3.gif http://img29.imageshack.us/img29/9633/flameswordman.gif

PREMI:

Il tasto Invio!

http://rpg2s.net/gif/SCContest3Oct.gif

 

Link to comment
Share on other sites

  • 0
Ragazzi qualcuno l'ha provato insieme allo script per i chara a + frame?

Iscriviti sul mio canale youtube -

https://www.youtube.com/channel/UCYOxXExvlXiOFfYD1fTFpww?view_as=subscriber

Seguimi su Instagram -

https://www.instagram.com/ancestralguitarist/

---------------------------------------------------------------------------------------------------------------------------------------
Contest vinti
---------------------------------------------------------------------------------------------------------------------------------------

FACE CONTEST # 3
BANNER CONTEST #69

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...