Sign in to follow this  
Followers 0
Fegarur

Control con el Ratón

11 posts in this topic

Descripción:
Con este script se pueden controlar los juegos creados con RMVX con el ratón. En el demo se ve mucho mejor todo, pero se puede indicar hacia dónde irá el personaje, interactuar con los NPC, utilizar los menús...

Screen:
[SPOILER]user posted image[/SPOILER]
Demo:
Descargar Demo (SkyDrive)
Descargar Demo (MegaUpload)
Descargar Demo (FileFront)
Descargar Demo (Fortaleza Friki)

Instrucciones:
El script es Plug&Play, es decir, funciona nada más instalarlo. Copia los scripts como vienen en la demo.

Créditos:
Script creado por Woratana.
También créditos, por Path Finding, módulo de ratón, sistema súper simple de ratón a:
DerVVulfman
Near Fantastica
Freak Boy
lambchop
Shun
Cybersam
Astro_mech
Mr.Mo
Fuso
Modern Algebra
Zeriab
Patrick Lester
Edited by Fegarur
0

Share this post


Link to post
Share on other sites
Me ha dado un error en la linea 184, justo aquí mira.


[SPOILER]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[/SPOILER]

Espero que tenga solución cheesy.gif y gracias por adelantado.
0

Share this post


Link to post
Share on other sites
A mí no me dio errores, la prueba es la demo. ¿Te dio error en tu proyecto o en la demo? ¿Qué hacías cuando saltó el error?
0

Share this post


Link to post
Share on other sites
Me dió error en el proyecto, justo cuando salta el menú para cambiar de nombre al PJ salta. Espero que tenga solución por que me encantaría poder usar este sistema en mi juego. Gracias por tu ayuda.
- - - - - - - - -
perdona por el doble post, pero pensé que te gustaría ver la imagen con el error para que tengas más pistas del error que es y eso. Muchas gracias.

[SPOILER]user posted image[/SPOILER]
0

Share this post


Link to post
Share on other sites
Si alguien sabe como ponerle solucion que nos lo diga porfavor ^^ gracias anticipadas
0

Share this post


Link to post
Share on other sites
Habeis encontrado alguna solución?? cheesy.gif
- - - - - - - - -
Para solucionar el error teneis que sustituir vuestro Window_NameInput por este:

CODE

#==============================================================================
# ** Window_NameInput
#------------------------------------------------------------------------------
#  This window is used to select text characters on the name input screen.
#==============================================================================

class Window_NameInput < Window_Base
 #--------------------------------------------------------------------------
 # * Text Character Table
 #--------------------------------------------------------------------------
 ENGLISH = [ 'A','B','C','D','E',  'a','b','c','d','e',
             'F','G','H','I','J',  'f','g','h','i','j',
             'K','L','M','N','O',  'k','l','m','n','o',
             'P','Q','R','S','T',  'p','q','r','s','t',
             'U','V','W','X','Y',  'u','v','w','x','y',
             'Z',' ',' ',' ',' ',  'z',' ',' ',' ',' ',
             ' ',' ',' ',' ',' ',  ' ',' ',' ',' ',' ',
             '1','2','3','4','5',  ' ',' ',' ',' ',' ',
             '6','7','8','9','0',  ' ',' ',' ',' ','OK']
 TABLE = [ENGLISH]
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     mode : Defeault input mode (always 0 in English version)
 #--------------------------------------------------------------------------
 def initialize(mode = 0)
   super(88, 148, 368, 248)
   @mode = mode
   @index = 0
   refresh
   update_cursor
 end
 #--------------------------------------------------------------------------
 # * Text Character Acquisition
 #--------------------------------------------------------------------------
 def character
   if @index < 88
     return TABLE[@mode][@index]
   else
     return ""
   end
 end
 #--------------------------------------------------------------------------
 # * Determine Cursor Position: Mode Switch
 #--------------------------------------------------------------------------
 def is_mode_change
   return (@index == 88)
 end
 #--------------------------------------------------------------------------
 # * Determine Cursor Location: Confirmation
 #--------------------------------------------------------------------------
 def is_decision
   return (@index == 89)
 end
 #--------------------------------------------------------------------------
 # * Get rectangle for displaying items
 #     index : item number
 #--------------------------------------------------------------------------
 def item_rect(index)
   rect = Rect.new(0, 0, 0, 0)
   rect.x = index % 10 * 32 + index % 10 / 5 * 16
   rect.y = index / 10 * WLH
   rect.width = 32
   rect.height = WLH
   return rect
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   for i in 0..89
     rect = item_rect(i)
     rect.x += 2
     rect.width -= 4
     self.contents.draw_text(rect, TABLE[@mode][i], 1)
   end
 end
 #--------------------------------------------------------------------------
 # * Update cursor
 #--------------------------------------------------------------------------
 def update_cursor
   self.cursor_rect = item_rect(@index)
 end
 #--------------------------------------------------------------------------
 # * Move cursor down
 #     wrap : Wraparound allowed
 #--------------------------------------------------------------------------
 def cursor_down(wrap)
   if @index < 80
     @index += 10
   elsif wrap
     @index -= 80
   end
 end
 #--------------------------------------------------------------------------
 # * Move cursor up
 #     wrap : Wraparound allowed
 #--------------------------------------------------------------------------
 def cursor_up(wrap)
   if @index >= 10
     @index -= 10
   elsif wrap
     @index += 80
   end
 end
 #--------------------------------------------------------------------------
 # * Move cursor right
 #     wrap : Wraparound allowed
 #--------------------------------------------------------------------------
 def cursor_right(wrap)
   if @index % 10 < 9
     @index += 1
   elsif wrap
     @index -= 9
   end
 end
 #--------------------------------------------------------------------------
 # * Move cursor left
 #     wrap : Wraparound allowed
 #--------------------------------------------------------------------------
 def cursor_left(wrap)
   if @index % 10 > 0
     @index -= 1
   elsif wrap
     @index += 9
   end
 end
 #--------------------------------------------------------------------------
 # * Move Cursor to [OK]
 #--------------------------------------------------------------------------
 def cursor_to_decision
   @index = 89
 end
 #--------------------------------------------------------------------------
 # * Move to Next Page
 #--------------------------------------------------------------------------
 def cursor_pagedown
   @mode = (@mode + 1) % TABLE.size
   refresh
 end
 #--------------------------------------------------------------------------
 # * Move to Previous Page
 #--------------------------------------------------------------------------
 def cursor_pageup
   @mode = (@mode + TABLE.size - 1) % TABLE.size
   refresh
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   super
   last_mode = @mode
   last_index = @index
   if Input.repeat?(Input::DOWN)
     cursor_down(Input.trigger?(Input::DOWN))
   end
   if Input.repeat?(Input::UP)
     cursor_up(Input.trigger?(Input::UP))
   end
   if Input.repeat?(Input::RIGHT)
     cursor_right(Input.trigger?(Input::RIGHT))
   end
   if Input.repeat?(Input::LEFT)
     cursor_left(Input.trigger?(Input::LEFT))
   end
   if Input.trigger?(Input::A)
     cursor_to_decision
   end
   if Input.trigger?(Input::R)
     cursor_pagedown
   end
   if Input.trigger?(Input::L)
     cursor_pageup
   end
   if Input.trigger?(Input::C) and is_mode_change
     cursor_pagedown
   end
   if @index != last_index or @mode != last_mode
     Sound.play_cursor
   end
   update_cursor
 end
end

0

Share this post


Link to post
Share on other sites

Hola... soy nuevo en esta comunidad que parece estar muy interesante y queria saber si ese script permite el uso convinado de mouse y teclado dentro del juego, es decir que ademas del nuevo manejo a partir del mouse puede usarse el teclado. Desde ya muchas gracias

0

Share this post


Link to post
Share on other sites

Sí, funciona a la vez con ratón y teclado. Por ejemplo, puedes sacar el menú tanto como con el botón derecho del ratón como con la tecla ESC del teclado. ;)

0

Share this post


Link to post
Share on other sites

el link ya no existe, alguien puede ponerme aki el codigo del script?

0

Share this post


Link to post
Share on other sites

El enlace de SkyDrive todavía funciona. ^^

0

Share this post


Link to post
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
Sign in to follow this  
Followers 0