Jump to content
Rpg²S Forum
  • 0

Aspetta fine movimento con script


FenriX`
 Share

Question

Come da titolo : | è possibile tramite script impostare un comando che richiede al sistema di attandere la fine di uno spostamento? la stessa cosa che si mette negli eventi, solo fatto a script : |

qualcuno ne sa qualcosa per aiutarmi? XD magari anche un metodo per girarci intorno : | in pratica c'ho no script per il dash:

uno preme Z mentre è in muovimento e fa il dash in una direzione, e fino a qui funziona tutto bene, l'unica cosa è che la velocità torna normale dopo il primo passo X| e gli altri due passi se li fa un sacco lenti X| cioè... a velocità normale

#=========================================================================
# ■ Run Script by Kamahl
#==============================================================================

class Game_Player < Game_Character

alias update_primary update
def update
update_primary
$game_player.refresh
if @move_speed = 6.5
  @move_speed = 4
end
if Input.trigger?(Input::SHIFT)
  @move_speed = 6.5
  if Input.press?(Input::DOWN)
	$game_player.refresh
	$game_player.move_down
	$game_player.move_down
	$game_player.move_down
  end
  if Input.press?(Input::LEFT)
	$game_player.refresh
	$game_player.move_left
	$game_player.move_left
	$game_player.move_left
  end
  if Input.press?(Input::RIGHT)
	$game_player.refresh
	$game_player.move_right
	$game_player.move_right
	$game_player.move_right
  end
  if Input.press?(Input::UP)
	$game_player.refresh
	$game_player.move_up
	$game_player.move_up
	$game_player.move_up
  end
end
 end
end

io pensavo di trovare un comando di questo tipo in modo che alla fine dei 3 passi ci impostasse la velocità normale, altrimenti così va no schifo :\ qualcuno può aiutarmi? anche con una specie di wait magari oppure un giochetto per aggirare il problema, se proprio non esiste questo comando

 

 

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

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

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
Se vuoi ti do uno script del Dash che funziona correttamente.

http://img58.imageshack.us/img58/4264/newheavenhd2.jpg

 

Iscrivetevi alla nostra accademia di Rpgmaking, presto sarà piena di contenuti e lezioni su Mapping, Eventing, Pixel Art e Scrittura, a livelli bassi, medi e avanzati!

http://img185.imageshack.us/img185/4599/bannerua7.gif

Link to comment
Share on other sites

  • 0
emm... me sa che non avete compreso la mia definizione di dash XD io non intendo la corsa (quella che ci sta nella maggior parte dei gdr) che premi un tasto e ti cambia la velocità, io intendo un dash alla megaman che te fai un tot di strada in una direzione per poi fermarti come l'abilità destrezza su kingdom hearts 1 o il doppio avanti su kh:com o ancora il tagliavento su kingdom hearts 2... io intendevo una cosa di quel tipo : |

 

 

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

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

Link to comment
Share on other sites

  • 0

inserisci questo sotto class Game_Player

 

attr_writer :base_speed
 def initialize
super
@dash_count = 0
@base_speed = 4
@move_increase = 2
@dash_steps = 4
 end

 

e sostituisci questo update col vecchio

 

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
  if @dash_count > 0
				 move_forward
	 @dash_count -= 1
  else
	 @move_speed = @base_speed
  case Input.dir4
  when 2
	move_down
  when 4
	move_left
  when 6
	move_right
  when 8
	move_up
  end
end
			unless $game_system.map_interpreter.running? or
				@move_route_forcing or $game_temp.message_window_showing
				 if Input.trigger?(Input::SHIFT)
				   if @dash_count == 0
					 @dash_count = @dash_steps
					 @move_speed += @move_increase
				   end
				 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

 

@base_speed è la velocità del pg puoi modificarla dallo script o con un call script da evento scrivendo $game_player.base_speed = *numero*

 

@move_increase è l aumento di velocità durante il dash (velocità di base + @move_increase)

@dash_steps è il numero di passi percorsi durante il dash

 

non ho mai giocato a kingdom hearts spero di aver capito la tua richiesta :)

Edited by DarkSchneider
Link to comment
Share on other sites

  • 0
figo ^^

http://img63.imageshack.us/img63/9295/ogame2hb7da9.png

http://img209.imageshack.us/img209/1457/heartlesslf1.gif

http://img177.imageshack.us/img177/1690/playstation2sc1tt1.png

http://img205.imageshack.us/img205/7797/italiafh9.gif

http://img215.imageshack.us/img215/4053/fan21brtw0.jpg

http://img223.imageshack.us/img223/7123/tff0opaa4.jpg

http://img215.imageshack.us/img215/6347/vivalarazana6vx9hu5.gif

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...