Aportes de Scripts RPG-Maker

Estado
Cerrado para nuevas respuestas
Mensajes
29
Reacciones
0
Puntos
0
Ubicación
vivo en colombiaa
bueno pero como hago para que un soldado diga hola amigo y cuando tu le vuelvas a hablar diga lalalala es un ejemplo.....
y otra cosa podrias darme un ejemplo con imagenes eske no entendi muy bien
 
Mensajes
1
Reacciones
0
Puntos
0
Existe otra forma mas facil de solucionar el problema de cuando te dice que es otra versión:
clic derecho en Game.rxproj y pones Abrir con... Bloc de notas. Donde dice "RPGXP 1.X", pones RPGXP 1.00. Guardas, sales y ya puedes abrir el proyecto desde cualquier versión de RPG Maker XP.
 
Mensajes
216
Reacciones
0
Puntos
0
Ubicación
Valdivia
Pixel Based Movement

Descripcion El funcionamiento de este script es que cambia la configuración de movimiento por tiles y lo convierte en pixeles.
asi como los juegos de zelda de gba o sword of mana de gba.ImagenesNo puedo mostrar como se mueve pero intetenlo ustedes
Bueno,

Script
Código:
#==============================================================================
# Game_Player
#==============================================================================

class Game_Player < Game_Character
UP    = 0                
DOWN  = 0              
SIDE  = 0              
SLANT = false            
#--------------------------------------------------------------------------
attr_reader   :event    
attr_accessor :move_speed  
#--------------------------------------------------------------------------
def update

if @move_speed == nil
@move_speed = 4
end
  if @revise_x == nil and @revise_y == nil
@revise_x = 0
@revise_y = 0
end
if @move_route_forcing
last_moving = moving?
last_real_x = @real_x
last_real_y = @real_y
if (@revise_x != 0 or @revise_y != 0) and not jumping? and @move == true
   if @revise_x != @real_x - @x * 128 or @revise_y != @real_y - @y * 128
     @revise_x = @real_x - @x * 128
     @revise_y = @real_y - @y * 128
   end
   distance1 = 2 ** @move_speed
   distance2 = Math.sqrt(@revise_x ** 2 + @revise_y ** 2)
   if distance1 > distance2
     @real_x = @real_x - @revise_x
     @real_y = @real_y - @revise_y
     @revise_x = 0
     @revise_y = 0
     anime_update
   else
     @real_x -= (distance1 * @revise_x / distance2).round
     @real_y -= (distance1 * @revise_y / distance2).round
     @revise_x = @real_x - @x * 128
     @revise_y = @real_y - @y * 128
     anime_update
   end
else
   super
end
else
@move = false
unless moving? or $game_system.map_interpreter.running? or
        @move_route_forcing or $game_temp.message_window_showing
   @event_run = false
   case Input.dir8
   when 1
     move_lower_left_p
   when 2
     move_down_p
   when 3
     move_lower_right_p
   when 4
     move_left_p
   when 6
     move_right_p
   when 7
     move_upper_left_p
   when 8
     move_up_p
   when 9
     move_upper_right_p
   end
end
last_real_x = @real_x
last_real_y = @real_y
@real_x = @x * 128 + @revise_x
@real_y = @y * 128 + @revise_y
last_moving = moving?
move_on
if (last_real_x != @real_x or last_real_y != @real_y)
   anime_update
else
   @pattern = 0
end
end
if @real_y > last_real_y and @real_y - $game_map.display_y > CENTER_Y
$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
$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
$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
$game_map.scroll_up(last_real_y - @real_y)
end
unless moving?
if last_moving
   result = check_event_trigger_here([1,2])
   if result == true
     if (last_real_x / 128.0).round != @x and
        (last_real_y / 128.0).round != @y
      if @direction == 2 or @direction == 8
        if (last_real_x / 128.0).round > @x
          p 1
           turn_left
        else
           p 2
           turn_right
         end
       else
         if (last_real_y / 128.0).round > @y
           p 3
           turn_up
         else
           p 4
           turn_down
         end
       end
     elsif (last_real_x / 128.0).round > @x
       turn_left
     elsif (last_real_x / 128.0).round < @x
       turn_right
     elsif (last_real_y / 128.0).round > @y
       turn_up
     elsif (last_real_y / 128.0).round < @y
       turn_down
     end
   end
   if result == false
     unless $DEBUG and Input.press?(Input::CTRL)
       if @encounter_count > 0
         @encounter_count -= 1
       end
     end
   end
end
if Input.trigger?(Input::C)
   check_event_trigger_here([0])
   check_event_trigger_there([0,1,2])
end
end
end
#--------------------------------------------------------------------------
def initialize
@revise_x = 0
@revise_y = 0
@move == false
super
end
#--------------------------------------------------------------------------
def moving?
if @move_route_forcing
if @move == false
   return false
end
super
else
return (@x != (@real_x / 128.0).round or @y != (@real_y / 128.0).round)
end
end
#--------------------------------------------------------------------------
def moving_a?
if @move == false
if (@move_route.list[@move_route_index].code <= 14 or
     @move_route.list[@move_route_index].code == 25)
   @move = true
end
return false
end
moving?
end
#--------------------------------------------------------------------------
def update_jump
@jump_count -= 1
@real_x = (@real_x * @jump_count + @x * 128) / (@jump_count + 1)
@real_y = (@real_y * @jump_count + @y * 128) / (@jump_count + 1)
if @jump_count == 0
@revise_x = 0
@revise_y = 0
end
end
#--------------------------------------------------------------------------
def move_type_custom
if jumping? or moving_a?
return
end
while @move_route_index < @move_route.list.size
command = @move_route.list[@move_route_index]
if command.code == 0
   if @move_route.repeat
     @move_route_index = 0
   end
   unless @move_route.repeat
     if @move_route_forcing and not @move_route.repeat
       @move_route_forcing = false
       @move_route = @original_move_route
       @move_route_index = @original_move_route_index
       @original_move_route = nil
     end
     @stop_count = 0
   end
   return
end
if command.code <= 14
   case command.code
   when 1
     move_down
   when 2
     move_left
   when 3
     move_right
   when 4
     move_up
   when 5
     move_lower_left
   when 6
     move_lower_right
   when 7
     move_upper_left
   when 8
     move_upper_right
   when 9
     move_random
   when 10
     move_toward_player
   when 11
     move_away_from_player
   when 12
     move_forward
   when 13
     move_backward
   when 14
     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
if command.code == 15
   @wait_count = command.parameters[0] * 2 - 1
   @move_route_index += 1
   return
end
if command.code >= 16 and command.code <= 26
   case command.code
   when 16
     turn_down
   when 17
     turn_left
   when 18
     turn_right
   when 19
     turn_up
   when 20
     turn_right_90
   when 21
     turn_left_90
   when 22
     turn_180
   when 23
     turn_right_or_left_90
   when 24
     turn_random
   when 25
     turn_toward_player
   when 26
     turn_away_from_player
   end
   @move_route_index += 1
   return
end
if command.code >= 27
   case command.code
   when 27
     $game_switches[command.parameters[0]] = true
     $game_map.need_refresh = true
   when 28
     $game_switches[command.parameters[0]] = false
     $game_map.need_refresh = true
   when 29
     @move_speed = command.parameters[0]
   when 30
     @move_frequency = command.parameters[0]
   when 31
     @walk_anime = true
   when 32
     @walk_anime = false
   when 33
     @step_anime = true
   when 34
     @step_anime = false
   when 35
     @direction_fix = true
   when 36
     @direction_fix = false
   when 37
     @through = true
   when 38
     @through = false
   when 39
     @always_on_top = true
   when 40
     @always_on_top = false
   when 41
     @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
     @opacity = command.parameters[0]
   when 43
     @blend_type = command.parameters[0]
   when 44
     $game_system.se_play(command.parameters[0])
   when 45
     result = eval(command.parameters[0])
   end
   @move_route_index += 1
   return
end
end
end
#--------------------------------------------------------------------------
def move_down_p
turn_down
distance = 2 ** @move_speed
down1(((@x * 128 + @revise_x) / 128.0).round,
     ((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
def down1(x, y, distance, down = false)
result = down2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x, y+1)
return result
end
if @revise_x < -SIDE
result = down2(x, y + 1, distance, 4)
result &= down2(x - 1, y, distance)
if result == false
   if down
     move_lower_right_p
     if @revise_x > SIDE
       @revise_x = SIDE
     end
   end
   return result
end
elsif @revise_x > SIDE
result = down2(x, y + 1, distance, 6)
result &= down2(x + 1, y, distance)
if result == false
   if down
     move_lower_left_p
     if @revise_x < -SIDE
       @revise_x = -SIDE
     end
   end
   return result
end
end
@revise_y += distance
return result
end
#--------------------------------------------------------------------------
def down2(x, y, distance, d = 2)
if @revise_y + distance > DOWN
unless passable?(x, y, d)
   if @revise_y < DOWN
     @revise_y = DOWN
   end
   return false
end
end
return true
end
#--------------------------------------------------------------------------
def move_left_p
turn_left
distance = 2 ** @move_speed
left1(((@x * 128 + @revise_x) / 128.0).round,
     ((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
def left1(x, y, distance, left = false)
result = left2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x-1, y)
return result
end
if @revise_y < -UP
result = left2(x - 1, y, distance, 8)
result &= left2(x, y - 1, distance)
if result == false
   if left
     move_lower_left_p
     if @revise_y > DOWN
       @revise_y = DOWN
     end
   end
   return result
end
elsif @revise_y > DOWN
result = left2(x - 1, y, distance, 2)
result &= left2(x, y + 1, distance)
if result == false
   if left
     move_upper_left_p
     if @revise_y < -UP
       @revise_y = -UP
     end
   end
   return result
end
end
@revise_x -= distance
return result
end
#--------------------------------------------------------------------------
def left2(x, y, distance, d = 4)
if @revise_x - distance < -SIDE
unless passable?(x, y, d)
   if @revise_x > -SIDE
     @revise_x = -SIDE
   end
   return false
end
end
return true
end
#--------------------------------------------------------------------------
def move_right_p
turn_right
distance = 2 ** @move_speed
right1(((@x * 128 + @revise_x) / 128.0).round,
       ((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
def right1(x, y, distance, right = false)
result = right2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x+1, y)
return result
end
if @revise_y < -UP
result = right2(x + 1, y, distance, 8)
result &= right2(x, y - 1, distance)
if result == false
   if right
      move_lower_right_p
   if @revise_y > DOWN
      @revise_y = DOWN
     end
   end
   return result
end
elsif @revise_y > DOWN
result = right2(x + 1, y, distance, 2)
result &= right2(x, y + 1, distance)
if result == false
   if right
     move_upper_right_p
     if @revise_y < -UP
       @revise_y = -UP
     end
   end
   return result
end
end
@revise_x += distance
return result
end
#--------------------------------------------------------------------------
def right2(x, y, distance, d = 6)
if @revise_x + distance > SIDE
unless passable?(x, y, d)
   if @revise_x < SIDE
     @revise_x = SIDE
   end
   return false
end
end
return true
end
#--------------------------------------------------------------------------
def move_up_p
turn_up
distance = 2 ** @move_speed
up1(((@x * 128 + @revise_x) / 128.0).round,
   ((@y * 128 + @revise_y) / 128.0).round, distance, true)
end
#--------------------------------------------------------------------------
def up1(x, y, distance, up = false)
result = up2(x, y, distance)
if result == false
@event_run = check_event_trigger_touch(x, y-1)
return result
end
if @revise_x < -SIDE
result = up2(x, y - 1, distance, 4)
result &= up2(x - 1, y, distance)
if result == false
   if up
     move_upper_right_p
     if @revise_x > SIDE
       @revise_x = SIDE
     end
   end
   return result
end
elsif @revise_x > SIDE
result = up2(x, y - 1, distance, 6)
result &= up2(x + 1, y, distance)
if result == false
   if up
     move_upper_left_p
     if @revise_x < -SIDE
       @revise_x = -SIDE
     end
   end
   return result
end
end
@revise_y -= distance
return result
end
#--------------------------------------------------------------------------
def up2(x, y, distance, d = 8)
if @revise_y - distance < -UP
unless passable?(x, y, d)
   if @revise_y > -UP
     @revise_y = -UP
   end
   return false
end
end
return true
end
#--------------------------------------------------------------------------
def move_lower_left_p
unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 8 ? 2 : @direction)
end
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 2
turn_left unless down1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
turn_down if @event_run
unless @event_run
   if last_move?(@real_x, @real_y, 2, distance)
     result = check_event_trigger_here([1,2], false)
     if result == true
       return
     end
   end
   move_on
   if @revise_y > DOWN and -UP > @revise_y - distance
     @revise_y = DOWN
   end
   turn_down unless left1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
   turn_left if @event_run
end
else
turn_down unless left1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
turn_left if @event_run
unless @event_run
   if last_move?(@real_x, @real_y, 4, distance)
     result = check_event_trigger_here([1,2], false)
     if result == true
       return
     end
   end
   move_on
   if  @revise_x + distance> SIDE and -SIDE > @revise_x
     @revise_x = -SIDE
   end
   turn_left unless down1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
   turn_down if @event_run
end
end
end
#--------------------------------------------------------------------------
def move_lower_right_p
unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
end
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 2
turn_right unless down1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
turn_down if @event_run
unless @event_run
   if last_move?(@real_x, @real_y, 2, distance)
     result = check_event_trigger_here([1,2], false)
     if result == true
       return
     end
   end
   move_on
   if @revise_y > DOWN and -UP > @revise_y - distance
     @revise_y = DOWN
   end
   turn_down unless right1(((@x * 128 + @revise_x) / 128.0).round,
                           ((@y * 128 + @revise_y) / 128.0).round, distance)
   turn_right if @event_run
end
else
turn_down unless right1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
turn_right if @event_run
unless @event_run
   if last_move?(@real_x, @real_y, 6, distance)
     result = check_event_trigger_here([1,2], false)
     if result == true
       return
     end
   end
   move_on
   if @revise_x > SIDE and -SIDE > @revise_x - distance
     @revise_x = SIDE
   end
   turn_right unless down1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
   turn_down if @event_run
end
end
end
#--------------------------------------------------------------------------
def move_upper_left_p
unless @direction_fix
@direction = (@direction == 6 ? 4 : @direction == 2 ? 8 : @direction)
end
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 8
turn_left unless up1(((@x * 128 + @revise_x) / 128.0).round,
                       ((@y * 128 + @revise_y) / 128.0).round, distance)
turn_up if @event_run
unless @event_run
   if last_move?(@real_x, @real_y, 8, distance)
     result = check_event_trigger_here([1,2], false)
     if result == true
       return
     end
   end
   move_on
   if @revise_y + distance > DOWN and -UP > @revise_y
     @revise_y = -UP
   end
   turn_up unless left1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
   turn_left if @event_run
end
else
turn_up unless left1(((@x * 128 + @revise_x) / 128.0).round,
                       ((@y * 128 + @revise_y) / 128.0).round, distance)
turn_left if @event_run
unless @event_run
   if last_move?(@real_x, @real_y, 4, distance)
     result = check_event_trigger_here([1,2], false)
     if result == true
       return
     end
   end
   move_on
   if @revise_x > SIDE and -SIDE > @revise_x - distance
     @revise_x = SIDE
   end
   turn_left unless up1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
   turn_up if @event_run
end
end
end
#--------------------------------------------------------------------------
def move_upper_right_p
unless @direction_fix
@direction = (@direction == 4 ? 6 : @direction == 2 ? 8 : @direction)
end
distance = (2 ** @move_speed) / Math.sqrt(2)
if @direction == 8
turn_right unless up1(((@x * 128 + @revise_x) / 128.0).round,
                       ((@y * 128 + @revise_y) / 128.0).round, distance)
turn_up if @event_run
unless @event_run
   if last_move?(@real_x, @real_y, 8, distance)
     result = check_event_trigger_here([1,2], false)
     if result == true
       return
     end
   end
   move_on
   if @revise_y + distance > DOWN and -UP > @revise_y
     @revise_y = -UP
   end
   turn_up unless right1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
   turn_right if @event_run
end
else
turn_up unless right1(((@x * 128 + @revise_x) / 128.0).round,
                       ((@y * 128 + @revise_y) / 128.0).round, distance)
turn_right if @event_run
unless @event_run
   if last_move?(@real_x, @real_y, 6, distance)
     result = check_event_trigger_here([1,2], false)
     if result == true
       return
     end
   end
   move_on
   if @revise_x > SIDE and -SIDE > @revise_x - distance
     @revise_x = SIDE
   end
   turn_right unless up1(((@x * 128 + @revise_x) / 128.0).round,
                         ((@y * 128 + @revise_y) / 128.0).round, distance)
   turn_up if @event_run
end
end
end
#--------------------------------------------------------------------------
def check_event_trigger_here(triggers, run = true)
result = false
if $game_system.map_interpreter.running?
return result
end
for event in $game_map.events.values
if event.x == ((@real_x - @revise_x) / 128.0).round and
     event.y == ((@real_y - @revise_y) / 128.0).round and
     triggers.include?(event.trigger)
   if not event.jumping? and event.over_trigger?
     if event.list.size > 1
       if run == true
         event.start
       end
       result = true
     end
   end
end
end
return result
end
#--------------------------------------------------------------------------
def move_on
if @y < (@y + @revise_y / 128.0).round
@y += 1
@revise_y -= 128
increase_steps
end
if @x > (@x + @revise_x / 128.0).round
@x -= 1
@revise_x += 128
increase_steps
end
if @x < (@x + @revise_x / 128.0).round
@x += 1
@revise_x -= 128
increase_steps
end
if @y > (@y + @revise_y / 128.0).round
@y -= 1
@revise_y += 128
increase_steps
end
end
#--------------------------------------------------------------------------
def anime_update
if @walk_anime
@anime_count += 1.5
elsif @step_anime
@anime_count += 1
end
if @anime_count > 18 - @move_speed = 3.5
if not @step_anime and @stop_count > 0
   @pattern = @original_pattern
else
   @pattern = (@pattern + 1) % 4
end
@anime_count = 0
end
end
#--------------------------------------------------------------------------
alias :moveto_original :moveto
def moveto(x, y)
@revise_x = 0
@revise_y = 0
moveto_original(x, y)
end
#--------------------------------------------------------------------------
def last_move?(x, y, direction, distance)
if direction == 2 or direction == 4
distance *= -1
end
if (direction == 2 or direction == 8) and
   (y / 128.0).round != ((y + distance) / 128.0).round
return true
end
if (direction == 4 or direction == 6) and
   (x / 128.0).round != ((x + distance) / 128.0).round
return true
end
return false
end
end

#==============================================================================
# Game_Character
#==============================================================================

class Game_Character
attr_accessor  :move_speed
#--------------------------------------------------------------------------
def update_move

distance = 2 ** @move_speed
if @x * 128 != @real_x and @y * 128 != @real_y and Game_Player::SLANT
distance /= Math.sqrt(2)
end
if @y * 128 > @real_y
@real_y = [@real_y + distance, @y * 128].min
end
if @x * 128 < @real_x
@real_x = [@real_x - distance, @x * 128].max
end
if @x * 128 > @real_x
@real_x = [@real_x + distance, @x * 128].min
end
if @y * 128 < @real_y
@real_y = [@real_y - distance, @y * 128].max
end
if @walk_anime
@anime_count += 1.5
elsif @step_anime
@anime_count += 1
end
end
end

#==============================================================================
# Game_Event
#==============================================================================

class Game_Event < Game_Character
#--------------------------------------------------------------------------
def start
if @list.size > 1
if $game_player.event != 0
   $game_player.move_speed = $game_player.event
end
@starting = true
end
end
end
Creditos: Cogwheel

Suerte

 
Mensajes
81
Reacciones
0
Puntos
0
Ubicación
EMD
Barras HP y SP animadas

Código:
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return (@exp_list[@level+1] > 0 ?
@exp_list[@level+1] - @exp_list[@level] : 0)
end
end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================

class Window_Base < Window
#--------------------------------------------------------------------------
# * Object Initialization
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
alias :initialize_gauge :initialize
def initialize(x, y, width, height)
initialize_gauge(x, y, width, height)
# Initialize HP and SP gauge values
@hp_gauge = {}
@sp_gauge = {}
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias :dispose_gauge :dispose
def dispose
# ƒQ[ƒW‚Ìíœ
gauge_delete
# ƒIƒŠƒWƒiƒ‹‚̉ð•úˆ—
dispose_gauge
end
#--------------------------------------------------------------------------
# * Gauge Delete
#--------------------------------------------------------------------------
def gauge_delete
# HP ƒQ[ƒW‚ÌÁ‹Ž
for gauge in @hp_gauge.values
gauge[0].bitmap.dispose
gauge[0].dispose
end
# SP ƒQ[ƒW‚ÌXV
for gauge in @sp_gauge.values
gauge[0].bitmap.dispose
gauge[0].dispose
end
@hp_gauge = {}
@sp_gauge = {}
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias :update_gauge :update
def update
update_gauge
# HP ƒQ[ƒW‚ÌXV
for gauge in @hp_gauge.values
gauge_refresh(gauge, 0)
end
# SP ƒQ[ƒW‚ÌXV
for gauge in @sp_gauge.values
gauge_refresh(gauge, 1)
end
end
#--------------------------------------------------------------------------
# * Draw HP Gauge
#--------------------------------------------------------------------------
# Modification of the original Draw HP process
alias :draw_actor_hp_hpsp :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
# ‰•`‰æ‚Ìê‡
if @hp_gauge[actor] == nil
# ƒQ[ƒW‚
height = 10
# FÝ’èBcolor1:ŠO˜gCcolor2:’†˜g
# color3:‹óƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor4:‹óƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(64, 0, 0, 192)
color4 = Color.new(0, 0, 0, 192)
# ‹óƒQ[ƒW‚Ì•`‰æ
@hp_frame = gauge_rect(width, height, color1, color2, color3, color4)
sprite = Sprite.new
sprite.bitmap = Bitmap.new(width, height)
sprite.x = self.x + x + 16
sprite.y = self.y + y + 42 - height
sprite.z = self.z + 1
count = rand(400)
# •Ï”rate‚É Œ»Ý‚ÌHP/MHP‚ð‘ã“ü
if actor.maxhp != 0
rate = ((width - 4) * actor.hp.to_f / actor.maxhp).ceil
else
rate = width - 4
end
# ˆÊ’u“™î•ñ‚Ì‹L‰¯
@hp_gauge[actor] = [sprite, actor, rate, count, x, y - height]
# ƒQ[ƒW•`‰æ
gauge_refresh(@hp_gauge[actor], 0)
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚Ìê‡A‰Šúó‘Ô‚Í”ñ•\Ž¦
@hp_gauge[actor][0].visible = false if self.is_a?(Window_Target)
end
# •Ï”rate‚É Œ»Ý‚ÌHP/MHP‚ð‘ã“ü
if actor.maxhp != 0
rate = ((width - 4) * actor.hp.to_f / actor.maxhp).ceil
else
rate = width - 4
end
@hp_gauge[actor][2] = rate
# ƒIƒŠƒWƒiƒ‹‚ÌHP•`‰æˆ—‚ðŒÄ‚Ño‚µ
draw_actor_hp_hpsp(actor, x, y, width)
end
#--------------------------------------------------------------------------
# * Draw SP Gauge
#--------------------------------------------------------------------------
# Modification of the original Draw SP process
alias :draw_actor_sp_hpsp :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
# ‰•`‰æ‚Ìê‡
if @sp_gauge[actor] == nil
# ƒQ[ƒW‚
height = 10
# FÝ’èBcolor1:ŠO˜gCcolor2:’†˜g
# color3:‹óƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor4:‹óƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 64, 64, 192)
color4 = Color.new(0, 0, 0, 192)
# ‹óƒQ[ƒW‚Ì•`‰æ
@sp_frame = gauge_rect(width, height, color1, color2, color3, color4)
sprite = Sprite.new
sprite.bitmap = Bitmap.new(width, height)
sprite.x = self.x + x + 16
sprite.y = self.y + y + 42 - height
sprite.z = self.z + 1
count = rand(400)
# •Ï”rate‚É Œ»Ý‚ÌHP/MHP‚ð‘ã“ü
if actor.maxsp != 0
rate = ((width - 4) * actor.sp.to_f / actor.maxsp).ceil
else
rate = width - 4
end
# ˆÊ’u“™î•ñ‚Ì‹L‰¯
@sp_gauge[actor] = [sprite, actor, rate, count, x, y - height]
# ƒQ[ƒW•`‰æ
gauge_refresh(@sp_gauge[actor], 1)
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚Ìê‡A‰Šúó‘Ô‚Í”ñ•\Ž¦
@sp_gauge[actor][0].visible = false if self.is_a?(Window_Target)
end
# •Ï”rate‚É Œ»Ý‚ÌHP/MHP‚ð‘ã“ü
if actor.maxsp != 0
rate = ((width - 4) * actor.sp.to_f / actor.maxsp).ceil
else
rate = width - 4
end
@sp_gauge[actor][2] = rate
# ƒIƒŠƒWƒiƒ‹‚ÌHP•`‰æˆ—‚ðŒÄ‚Ño‚µ
draw_actor_sp_hpsp(actor, x, y, width)
end
#--------------------------------------------------------------------------
# * Drawing of gauge
#--------------------------------------------------------------------------
def gauge_rect(width, height, color1, color2, color3, color4)
bitmap = Bitmap.new(width, height)
# ˜g•`‰æ
bitmap.fill_rect(0, 0, width, height, color1)
bitmap.fill_rect(1, 1, width - 2, height - 2, color2)
# ‹óƒQ[ƒW‚Ì•`‰æ
bitmap.gradation_rect(2, 2, width-4, height-4, color3, color4, 1)
return bitmap
end
#--------------------------------------------------------------------------
# œ ŽÀƒQ[ƒW‚ÌXV
#--------------------------------------------------------------------------
def gauge_refresh(gauge, type)
# ƒ^ƒCƒv‚É‚æ‚蕪Šò
case type
when 0 # HPƒQ[ƒW‚Ìê‡
graphic = RPG::Cache.system("Gauge_HP")
rate = gauge[2] * 100 / (gauge[0].bitmap.width - 4)
point = (rate < 50 ? 8 : 0) + (rate < 25 ? 8 : 0)
frame = @hp_frame
when 1 # SPƒQ[ƒW‚Ìê‡
graphic = RPG::Cache.system("Gauge_SP")
rate = gauge[2] * 100 / (gauge[0].bitmap.width - 4)
point = (rate < 50 ? 8 : 0) + (rate < 25 ? 8 : 0)
frame = @sp_frame
end
# ƒJƒEƒ“ƒg‚ÌXV
gauge[3] = (gauge[3] - 2) % 400
# ‹óƒQ[ƒW‚Ì‚Ì•`‰æ
gauge[0].bitmap.fill_rect(0, 0, gauge[0].bitmap.width,
gauge[0].bitmap.height, Color.new(0, 0, 0, 0))
gauge[0].bitmap.blt(0, 0, frame, frame.rect)
# ƒQ[ƒW‚Ì’†g‚ð•`‰æ‰Â”\‚Èê‡
if gauge[2] > 0
# ŽÀƒQ[ƒW‚Ì•`‰æ
gauge[0].bitmap.blt(2, 2, graphic,
Rect.new(gauge[3], point, gauge[2], gauge[0].bitmap.height - 4), 192)
gauge[0].bitmap.fill_rect(3, 3, gauge[2] - 2,
gauge[0].bitmap.height - 6,Color.new(0, 0, 0, 0))
gauge[0].bitmap.blt(3, 3, graphic,
Rect.new(gauge[3]+1,point+1,gauge[2]-2,gauge[0].bitmap.height- 6), 128)
end
# ƒQ[ƒWÀ•W‚ÌXV
gauge[0].x = [self.x - self.ox + gauge[4] + 16, self.x + 16].max
gauge[0].y = [self.y - self.oy + gauge[5] + 42, self.y + 16].max
gauge[0].src_rect = Rect.new([self.ox - gauge[4], 0].max,
[self.oy - gauge[5] - 26, 0].max,
[self.ox + self.width - gauge[4] - 32, gauge[0].bitmap.width].min,
[self.oy + self.height - gauge[5] - 32, gauge[0].bitmap.height].min)
gauge[0].visible = self.visible
end
#--------------------------------------------------------------------------
# Set X-position for gauge
#--------------------------------------------------------------------------
def x=(new_x)
super(new_x)
if @hp_gauge != nil
# HP ƒQ[ƒW‚ÌXV
for gauge in @hp_gauge.values + @sp_gauge.values
gauge[0].x = self.x + gauge[4] + 16
end
end
end
#--------------------------------------------------------------------------
# Set Y-position for gauge
#--------------------------------------------------------------------------
def y=(new_y)
super(new_y)
if @hp_gauge != nil
# HP ƒQ[ƒW‚ÌXV
for gauge in @hp_gauge.values + @sp_gauge.values
gauge[0].y = self.y + gauge[5] + 42
end
end
end
#--------------------------------------------------------------------------
# Set Z-depth for gauge
#--------------------------------------------------------------------------
def z=(new_z)
super(new_z)
if @hp_gauge != nil
# HP ƒQ[ƒW‚ÌXV
for gauge in @hp_gauge.values + @sp_gauge.values
gauge[0].z = self.z + 1
end
end
end
end


#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================

class Window_Help < Window_Base
#--------------------------------------------------------------------------
# * Set Text
# text : text string displayed in window
# align : alignment (0..flush left, 1..center, 2..flush right)
#--------------------------------------------------------------------------
alias :gauge_set_text :set_text
def set_text(text, align = 0)
# ƒeƒLƒXƒg‚ƃAƒ‰ƒCƒ“ƒƒ“ƒg‚Ì‚È‚‚Æ‚àˆê�
�û‚ª‘O‰ñ‚ƈá‚Á‚Ä‚¢‚éê‡
if text != @text or align != @align
# ƒQ[ƒW‚Ìíœ
gauge_delete
# ƒIƒŠƒWƒiƒ‹‚̈—
gauge_set_text(text, align)
end
end
#--------------------------------------------------------------------------
# * Set Actor
# actor : status displaying actor
#--------------------------------------------------------------------------
alias :gauge_set_actor :set_actor
def set_actor(actor)
if actor != @actor
# ƒQ[ƒW‚Ìíœ
gauge_delete
# ƒIƒŠƒWƒiƒ‹‚̈—
gauge_set_actor(actor)
end
end
#--------------------------------------------------------------------------
# * Set Enemy
# enemy : name and status displaying enemy
#--------------------------------------------------------------------------
alias :gauge_set_enemy :set_enemy
def set_enemy(enemy)
# ƒQ[ƒW‚Ìíœ
gauge_delete
# ƒIƒŠƒWƒiƒ‹‚̈—
gauge_set_enemy(enemy)
end
end


#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# This class brings together battle screen sprites. It's used within
# the Scene_Battle class.
#==============================================================================

class Spriteset_Battle
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias :initialize_gauge :initialize
def initialize
initialize_gauge
@viewport2.z = 100
end
end

#==============================================================================
# ** Bitmap
#------------------------------------------------------------------------------
# New routine added to the Bitmap class.
#==============================================================================

class Bitmap
#--------------------------------------------------------------------------
# * Rectangle Gradation Indicator
# color1: Start color
# color2: Ending color
# align: 0: On side gradation
# 1: Vertically gradation
# 2: The gradation (intense concerning slantedly heavily note)
#--------------------------------------------------------------------------
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green +
(color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
elsif align == 2
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
elsif align == 3
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end

#==============================================================================
# ** Sprite
#------------------------------------------------------------------------------
# Class for sprites added to various effect handling used within RPGXP
#==============================================================================

module RPG
class Sprite < ::Sprite
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Arial Black"
bitmap.font.size = 32
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
if value.is_a?(Numeric) and value < 0
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if critical
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
end
@_damage_sprite = ::Sprite.new
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80 + self.viewport.ox
@_damage_sprite.oy = 20 + self.viewport.oy
@_damage_sprite.x = self.x + self.viewport.rect.x
@_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
@_damage_sprite.z = 3000
@_damage_duration = 40
end
def animation(animation, hit)
dispose_animation
@_animation = animation
return if @_animation == nil
@_animation_hit = hit
@_animation_duration = @_animation.frame_max
animation_name = @_animation.animation_name
animation_hue = @_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation)
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_animation_sprites.push(sprite)
end
unless @@_animations.include?(animation)
@@_animations.push(animation)
end
end
update_animation
end
def loop_animation(animation)
return if animation == @_loop_animation
dispose_loop_animation
@_loop_animation = animation
return if @_loop_animation == nil
@_loop_animation_index = 0
animation_name = @_loop_animation.animation_name
animation_hue = @_loop_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_loop_animation_sprites = []
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_loop_animation_sprites.push(sprite)
end
update_loop_animation
end
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites[i]
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3
if self.viewport != nil
sprite.x = self.viewport.rect.width / 2
sprite.y = self.viewport.rect.height - 160
else
sprite.x = 320
sprite.y = 240
end
else
sprite.x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2
sprite.y = self.y + self.viewport.rect.y -
self.oy + self.src_rect.height / 2
sprite.y -= self.src_rect.height / 4 if position == 0
sprite.y += self.src_rect.height / 4 if position == 2
end
sprite.x += cell_data[i, 1]
sprite.y += cell_data[i, 2]
sprite.z = 2000
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_y = cell_data[i, 3] / 100.0
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
end
end


#==============================================================================
# ** RPG
#------------------------------------------------------------------------------
# A module containing RPGXP's data structures and more.
#==============================================================================

module RPG
#==========================================================================
# ** Cache
#----------------------------------------------------------------------------
# A module that loads each of RPGXP's graphic formats, creates a Bitmap
# object, and retains it.
#==========================================================================
module Cache
def self.system(filename)
self.load_bitmap("Graphics/Pictures/", filename)
end
end
end

Deben poner estas 4 imagenes en pictures.

String02.png

gauge_hp.png

gauge_sp.png

gauge_ssp.png


Salu2:icon_mrorange:
 
Mensajes
131
Reacciones
0
Puntos
0
Si alguin me puede enseñar scripting o ayudarme a modificar algunos scripts, os ruego que me envies un MP
estaria muy agradecido, asi podria ayudar a mas gente que quiera aprender =
 

Gabylf

Elite Member
Mensajes
288
Reacciones
1
Puntos
640
Barras HP y SP animadas

Código:
#==============================================================================
# ** Game_Actor
#------------------------------------------------------------------------------
# This class handles the actor. It's used within the Game_Actors class
# ($game_actors) and refers to the Game_Party class ($game_party).
#==============================================================================

class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return (@exp_list[@level+1] > 0 ?
@exp_list[@level+1] - @exp_list[@level] : 0)
end
end

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This class is for all in-game windows.
#==============================================================================

class Window_Base < Window
#--------------------------------------------------------------------------
# * Object Initialization
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
alias :initialize_gauge :initialize
def initialize(x, y, width, height)
initialize_gauge(x, y, width, height)
# Initialize HP and SP gauge values
@hp_gauge = {}
@sp_gauge = {}
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
alias :dispose_gauge :dispose
def dispose
# ƒQ[ƒW‚Ìíœ
gauge_delete
# ƒIƒŠƒWƒiƒ‹‚̉ð•úˆ—
dispose_gauge
end
#--------------------------------------------------------------------------
# * Gauge Delete
#--------------------------------------------------------------------------
def gauge_delete
# HP ƒQ[ƒW‚ÌÁ‹Ž
for gauge in @hp_gauge.values
gauge[0].bitmap.dispose
gauge[0].dispose
end
# SP ƒQ[ƒW‚ÌXV
for gauge in @sp_gauge.values
gauge[0].bitmap.dispose
gauge[0].dispose
end
@hp_gauge = {}
@sp_gauge = {}
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias :update_gauge :update
def update
update_gauge
# HP ƒQ[ƒW‚ÌXV
for gauge in @hp_gauge.values
gauge_refresh(gauge, 0)
end
# SP ƒQ[ƒW‚ÌXV
for gauge in @sp_gauge.values
gauge_refresh(gauge, 1)
end
end
#--------------------------------------------------------------------------
# * Draw HP Gauge
#--------------------------------------------------------------------------
# Modification of the original Draw HP process
alias :draw_actor_hp_hpsp :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
# ‰•`‰æ‚Ìê‡
if @hp_gauge[actor] == nil
# ƒQ[ƒW‚
height = 10
# FÝ’èBcolor1:ŠO˜gCcolor2:’†˜g
# color3:‹óƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor4:‹óƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(64, 0, 0, 192)
color4 = Color.new(0, 0, 0, 192)
# ‹óƒQ[ƒW‚Ì•`‰æ
@hp_frame = gauge_rect(width, height, color1, color2, color3, color4)
sprite = Sprite.new
sprite.bitmap = Bitmap.new(width, height)
sprite.x = self.x + x + 16
sprite.y = self.y + y + 42 - height
sprite.z = self.z + 1
count = rand(400)
# •Ï”rate‚É Œ»Ý‚ÌHP/MHP‚ð‘ã“ü
if actor.maxhp != 0
rate = ((width - 4) * actor.hp.to_f / actor.maxhp).ceil
else
rate = width - 4
end
# ˆÊ’u“™î•ñ‚Ì‹L‰¯
@hp_gauge[actor] = [sprite, actor, rate, count, x, y - height]
# ƒQ[ƒW•`‰æ
gauge_refresh(@hp_gauge[actor], 0)
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚Ìê‡A‰Šúó‘Ô‚Í”ñ•\Ž¦
@hp_gauge[actor][0].visible = false if self.is_a?(Window_Target)
end
# •Ï”rate‚É Œ»Ý‚ÌHP/MHP‚ð‘ã“ü
if actor.maxhp != 0
rate = ((width - 4) * actor.hp.to_f / actor.maxhp).ceil
else
rate = width - 4
end
@hp_gauge[actor][2] = rate
# ƒIƒŠƒWƒiƒ‹‚ÌHP•`‰æˆ—‚ðŒÄ‚Ño‚µ
draw_actor_hp_hpsp(actor, x, y, width)
end
#--------------------------------------------------------------------------
# * Draw SP Gauge
#--------------------------------------------------------------------------
# Modification of the original Draw SP process
alias :draw_actor_sp_hpsp :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)
# ‰•`‰æ‚Ìê‡
if @sp_gauge[actor] == nil
# ƒQ[ƒW‚
height = 10
# FÝ’èBcolor1:ŠO˜gCcolor2:’†˜g
# color3:‹óƒQ[ƒWƒ_[ƒNƒJƒ‰[Ccolor4:‹óƒQ[ƒWƒ‰ƒCƒgƒJƒ‰[
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 64, 64, 192)
color4 = Color.new(0, 0, 0, 192)
# ‹óƒQ[ƒW‚Ì•`‰æ
@sp_frame = gauge_rect(width, height, color1, color2, color3, color4)
sprite = Sprite.new
sprite.bitmap = Bitmap.new(width, height)
sprite.x = self.x + x + 16
sprite.y = self.y + y + 42 - height
sprite.z = self.z + 1
count = rand(400)
# •Ï”rate‚É Œ»Ý‚ÌHP/MHP‚ð‘ã“ü
if actor.maxsp != 0
rate = ((width - 4) * actor.sp.to_f / actor.maxsp).ceil
else
rate = width - 4
end
# ˆÊ’u“™î•ñ‚Ì‹L‰¯
@sp_gauge[actor] = [sprite, actor, rate, count, x, y - height]
# ƒQ[ƒW•`‰æ
gauge_refresh(@sp_gauge[actor], 1)
# ƒ^[ƒQƒbƒgƒEƒBƒ“ƒhƒE‚Ìê‡A‰Šúó‘Ô‚Í”ñ•\Ž¦
@sp_gauge[actor][0].visible = false if self.is_a?(Window_Target)
end
# •Ï”rate‚É Œ»Ý‚ÌHP/MHP‚ð‘ã“ü
if actor.maxsp != 0
rate = ((width - 4) * actor.sp.to_f / actor.maxsp).ceil
else
rate = width - 4
end
@sp_gauge[actor][2] = rate
# ƒIƒŠƒWƒiƒ‹‚ÌHP•`‰æˆ—‚ðŒÄ‚Ño‚µ
draw_actor_sp_hpsp(actor, x, y, width)
end
#--------------------------------------------------------------------------
# * Drawing of gauge
#--------------------------------------------------------------------------
def gauge_rect(width, height, color1, color2, color3, color4)
bitmap = Bitmap.new(width, height)
# ˜g•`‰æ
bitmap.fill_rect(0, 0, width, height, color1)
bitmap.fill_rect(1, 1, width - 2, height - 2, color2)
# ‹óƒQ[ƒW‚Ì•`‰æ
bitmap.gradation_rect(2, 2, width-4, height-4, color3, color4, 1)
return bitmap
end
#--------------------------------------------------------------------------
# œ ŽÀƒQ[ƒW‚ÌXV
#--------------------------------------------------------------------------
def gauge_refresh(gauge, type)
# ƒ^ƒCƒv‚É‚æ‚蕪Šò
case type
when 0 # HPƒQ[ƒW‚Ìê‡
graphic = RPG::Cache.system("Gauge_HP")
rate = gauge[2] * 100 / (gauge[0].bitmap.width - 4)
point = (rate < 50 ? 8 : 0) + (rate < 25 ? 8 : 0)
frame = @hp_frame
when 1 # SPƒQ[ƒW‚Ìê‡
graphic = RPG::Cache.system("Gauge_SP")
rate = gauge[2] * 100 / (gauge[0].bitmap.width - 4)
point = (rate < 50 ? 8 : 0) + (rate < 25 ? 8 : 0)
frame = @sp_frame
end
# ƒJƒEƒ“ƒg‚ÌXV
gauge[3] = (gauge[3] - 2) % 400
# ‹óƒQ[ƒW‚Ì‚Ì•`‰æ
gauge[0].bitmap.fill_rect(0, 0, gauge[0].bitmap.width,
gauge[0].bitmap.height, Color.new(0, 0, 0, 0))
gauge[0].bitmap.blt(0, 0, frame, frame.rect)
# ƒQ[ƒW‚Ì’†g‚ð•`‰æ‰Â”\‚Èê‡
if gauge[2] > 0
# ŽÀƒQ[ƒW‚Ì•`‰æ
gauge[0].bitmap.blt(2, 2, graphic,
Rect.new(gauge[3], point, gauge[2], gauge[0].bitmap.height - 4), 192)
gauge[0].bitmap.fill_rect(3, 3, gauge[2] - 2,
gauge[0].bitmap.height - 6,Color.new(0, 0, 0, 0))
gauge[0].bitmap.blt(3, 3, graphic,
Rect.new(gauge[3]+1,point+1,gauge[2]-2,gauge[0].bitmap.height- 6), 128)
end
# ƒQ[ƒWÀ•W‚ÌXV
gauge[0].x = [self.x - self.ox + gauge[4] + 16, self.x + 16].max
gauge[0].y = [self.y - self.oy + gauge[5] + 42, self.y + 16].max
gauge[0].src_rect = Rect.new([self.ox - gauge[4], 0].max,
[self.oy - gauge[5] - 26, 0].max,
[self.ox + self.width - gauge[4] - 32, gauge[0].bitmap.width].min,
[self.oy + self.height - gauge[5] - 32, gauge[0].bitmap.height].min)
gauge[0].visible = self.visible
end
#--------------------------------------------------------------------------
# Set X-position for gauge
#--------------------------------------------------------------------------
def x=(new_x)
super(new_x)
if @hp_gauge != nil
# HP ƒQ[ƒW‚ÌXV
for gauge in @hp_gauge.values + @sp_gauge.values
gauge[0].x = self.x + gauge[4] + 16
end
end
end
#--------------------------------------------------------------------------
# Set Y-position for gauge
#--------------------------------------------------------------------------
def y=(new_y)
super(new_y)
if @hp_gauge != nil
# HP ƒQ[ƒW‚ÌXV
for gauge in @hp_gauge.values + @sp_gauge.values
gauge[0].y = self.y + gauge[5] + 42
end
end
end
#--------------------------------------------------------------------------
# Set Z-depth for gauge
#--------------------------------------------------------------------------
def z=(new_z)
super(new_z)
if @hp_gauge != nil
# HP ƒQ[ƒW‚ÌXV
for gauge in @hp_gauge.values + @sp_gauge.values
gauge[0].z = self.z + 1
end
end
end
end


#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================

class Window_Help < Window_Base
#--------------------------------------------------------------------------
# * Set Text
# text : text string displayed in window
# align : alignment (0..flush left, 1..center, 2..flush right)
#--------------------------------------------------------------------------
alias :gauge_set_text :set_text
def set_text(text, align = 0)
# ƒeƒLƒXƒg‚ƃAƒ‰ƒCƒ“ƒƒ“ƒg‚Ì‚È‚‚Æ‚àˆê�
�û‚ª‘O‰ñ‚ƈá‚Á‚Ä‚¢‚éê‡
if text != @text or align != @align
# ƒQ[ƒW‚Ìíœ
gauge_delete
# ƒIƒŠƒWƒiƒ‹‚̈—
gauge_set_text(text, align)
end
end
#--------------------------------------------------------------------------
# * Set Actor
# actor : status displaying actor
#--------------------------------------------------------------------------
alias :gauge_set_actor :set_actor
def set_actor(actor)
if actor != @actor
# ƒQ[ƒW‚Ìíœ
gauge_delete
# ƒIƒŠƒWƒiƒ‹‚̈—
gauge_set_actor(actor)
end
end
#--------------------------------------------------------------------------
# * Set Enemy
# enemy : name and status displaying enemy
#--------------------------------------------------------------------------
alias :gauge_set_enemy :set_enemy
def set_enemy(enemy)
# ƒQ[ƒW‚Ìíœ
gauge_delete
# ƒIƒŠƒWƒiƒ‹‚̈—
gauge_set_enemy(enemy)
end
end


#==============================================================================
# ** Spriteset_Battle
#------------------------------------------------------------------------------
# This class brings together battle screen sprites. It's used within
# the Scene_Battle class.
#==============================================================================

class Spriteset_Battle
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias :initialize_gauge :initialize
def initialize
initialize_gauge
@viewport2.z = 100
end
end

#==============================================================================
# ** Bitmap
#------------------------------------------------------------------------------
# New routine added to the Bitmap class.
#==============================================================================

class Bitmap
#--------------------------------------------------------------------------
# * Rectangle Gradation Indicator
# color1: Start color
# color2: Ending color
# align: 0: On side gradation
# 1: Vertically gradation
# 2: The gradation (intense concerning slantedly heavily note)
#--------------------------------------------------------------------------
def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green +
(color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end
elsif align == 2
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
elsif align == 3
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end

#==============================================================================
# ** Sprite
#------------------------------------------------------------------------------
# Class for sprites added to various effect handling used within RPGXP
#==============================================================================

module RPG
class Sprite < ::Sprite
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end
bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Arial Black"
bitmap.font.size = 32
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)
if value.is_a?(Numeric) and value < 0
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if critical
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
end
@_damage_sprite = ::Sprite.new
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80 + self.viewport.ox
@_damage_sprite.oy = 20 + self.viewport.oy
@_damage_sprite.x = self.x + self.viewport.rect.x
@_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
@_damage_sprite.z = 3000
@_damage_duration = 40
end
def animation(animation, hit)
dispose_animation
@_animation = animation
return if @_animation == nil
@_animation_hit = hit
@_animation_duration = @_animation.frame_max
animation_name = @_animation.animation_name
animation_hue = @_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation)
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_animation_sprites.push(sprite)
end
unless @@_animations.include?(animation)
@@_animations.push(animation)
end
end
update_animation
end
def loop_animation(animation)
return if animation == @_loop_animation
dispose_loop_animation
@_loop_animation = animation
return if @_loop_animation == nil
@_loop_animation_index = 0
animation_name = @_loop_animation.animation_name
animation_hue = @_loop_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_loop_animation_sprites = []
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_loop_animation_sprites.push(sprite)
end
update_loop_animation
end
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites[i]
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end
sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3
if self.viewport != nil
sprite.x = self.viewport.rect.width / 2
sprite.y = self.viewport.rect.height - 160
else
sprite.x = 320
sprite.y = 240
end
else
sprite.x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2
sprite.y = self.y + self.viewport.rect.y -
self.oy + self.src_rect.height / 2
sprite.y -= self.src_rect.height / 4 if position == 0
sprite.y += self.src_rect.height / 4 if position == 2
end
sprite.x += cell_data[i, 1]
sprite.y += cell_data[i, 2]
sprite.z = 2000
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_y = cell_data[i, 3] / 100.0
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
end
end


#==============================================================================
# ** RPG
#------------------------------------------------------------------------------
# A module containing RPGXP's data structures and more.
#==============================================================================

module RPG
#==========================================================================
# ** Cache
#----------------------------------------------------------------------------
# A module that loads each of RPGXP's graphic formats, creates a Bitmap
# object, and retains it.
#==========================================================================
module Cache
def self.system(filename)
self.load_bitmap("Graphics/Pictures/", filename)
end
end
end

Deben poner estas 4 imagenes en pictures.

String02.png

gauge_hp.png

gauge_sp.png

gauge_ssp.png


Salu2:icon_mrorange:


:S
Me dice esto:

eerrrojm2.jpg
 
Mensajes
11
Reacciones
0
Puntos
0
¿Sabéis si existe algún script para XP que evite que en un determinado momento la música siga sonando al comenzar una batalla sin empezar de nuevo?
 
Mensajes
12
Reacciones
0
Puntos
0
Ubicación
Askabantz
MINI MAP Plug&Play (RMVX)

Este Script Va A Hacer De Mucha Utilidad Al Que Use El RPG Maker VX

No Necesita Ningun Material (plug&play):icon_mrorange:

Aqui Les Dejo El Script:
Creditos a Woratana(creador)
Código:
#===============================================================
# ● [VX] ◦ MiniMap ◦ □
# * Plug N Play Minimap (Don't need image~) *
#--------------------------------------------------------------
# ◦ by Woratana [[email protected]]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 09/06/2008
# ◦ Version: 1.0 Beta
#--------------------------------------------------------------
# ◦ Credit: KGC for XP MiniMap Script,
# this script can't be done without his MiniMap.
#--------------------------------------------------------------

module MiniMap
  #===========================================================================
  # [START] MINIMAP SCRIPT SETUP PART
  #---------------------------------------------------------------------------
  SWITCH_NO_MINIMAP = 0 # Turn ON this switch to NOT SHOW minimap
    
  MAP_RECT = [410, 20, 100, 100] # Minimap size and position
  # [X, Y, Width, Height]
  # You can change it in game, by call script:
  # $game_system.minimap = [X, Y, Width, Height]

  MAP_Z = 0 # Minimap's Z-coordinate
  # Increase this number if there is problem that minimap show below some objects.

  GRID_SIZE = 5 # Minimap's grid size. Recommend to use more than 3.
  
  MINIMAP_BORDER_COLOR = Color.new(0, 0, 255, 160) # Minimap's border color
  # Color.new(Red, Green, Blue, Opacity)
  MINIMAP_BORDER_SIZE = 2 # Minimap's border size
  
  FOREGROUND_COLOR = Color.new(224, 224, 255, 160) # Passable tile color
  BACKGROUND_COLOR = Color.new(0, 0, 0, 160) # Unpassable tile color

  USE_OUTLINE_PLAYER = true # Draw outline around player in minimap?
  PLAYER_OUTLINE_COLOR = Color.new(0, 0, 0, 192) # Player Outline color
  USE_OUTLINE_EVENT = true # Draw outline around events in minimap?
  EVENT_OUTLINE_COLOR = Color.new(255, 255, 255, 192) # Player Outline color
  
  PLAYER_COLOR = Color.new(255, 0, 0, 192) # Player color
  #---------------------------------------------------------------------------

  OBJECT_COLOR = {} # Don't change or delete this line!
  #===============================================================
  # * SETUP EVENT KEYWORD & COLOR
  #---------------------------------------------------------------
  # ** Template:
  # OBJECT_COLOR['keyword'] = Color.new(Red, Green, Blue, Opacity)
  #-------------------------------------------------------------
  # * 'keyword': Word you want to put in event's comment to show this color
  # ** Note: 'keyword' is CASE SENSITIVE!
  # * Color.new(...): Color you want
  # You can put between 0 - 255 in each argument (Red, Green, Blue, Opacity)
  #-------------------------------------------------------------
  OBJECT_COLOR['npc'] = Color.new(30,144,255,160)
  OBJECT_COLOR['treasure'] = Color.new(0,255,255,160)
  OBJECT_COLOR['enemy'] = Color.new(139,35,35,160)
  OBJECT_COLOR['merchant'] = Color.new(255,255,0,160)
  
  #===========================================================================
  # * [OPTIONAL] TAGS:
  #---------------------------------------------------------------------------
  # Change keyword for disable minimap & keyword for show event on minimap~
  #-----------------------------------------------------------------------
  TAG_NO_MINIMAP = '[NOMAP]'
  TAG_EVENT = 'MMEV'
  #---------------------------------------------------------------------------

  #---------------------------------------------------------------------------
  # [END] MINIMAP SCRIPT SETUP PART
  #===========================================================================
  
  def self.refresh
    if $scene.is_a?(Scene_Map)
      $scene.spriteset.minimap.refresh
    end
  end
  
  def self.update_object
    if $scene.is_a?(Scene_Map)
      $scene.spriteset.minimap.update_object_list
    end
  end
end

#==============================================================================
# ■ RPG::MapInfo
#==============================================================================
class RPG::MapInfo
  def name
    return @name.gsub(/\[.*\]/) { }
  end

  def original_name
    return @name
  end

  def show_minimap?
    return [email protected]?(MiniMap::TAG_NO_MINIMAP)
  end
end
#==============================================================================
# ■ Game_System
#==============================================================================
class Game_System
  attr_accessor :minimap
  alias wora_minimap_gamsys_ini initialize
  
  def initialize
    wora_minimap_gamsys_ini
    @minimap = MiniMap::MAP_RECT
  end
  
  def show_minimap
    return !$game_switches[MiniMap::SWITCH_NO_MINIMAP]
  end
end
#==============================================================================
# ■ Game_Map
#==============================================================================
class Game_Map
  alias wora_minimap_gammap_setup setup
  def setup(map_id)
    wora_minimap_gammap_setup(map_id)
    @db_info = load_data('Data/MapInfos.rvdata') if @db_info.nil?
    @map_info = @db_info[map_id]
  end
  
  def show_minimap?
    return @map_info.show_minimap?
  end
end
#==============================================================================
# ■ Game_Event
#==============================================================================
class Game_Event < Game_Character
  def mm_comment?(comment, return_comment = false )
    if [email protected]?
      for i in [email protected] - 1
        next if @list[i].code != 108
        if @list[i].parameters[0].include?(comment)
          return @list[i].parameters[0] if return_comment
          return true
        end
      end
    end
    return '' if return_comment
    return false
  end
end
#==============================================================================
# ■ Game_MiniMap
#------------------------------------------------------------------------------
class Game_MiniMap
  def initialize(tilemap)
    @tilemap = tilemap
    refresh
  end

  def dispose
    @border.bitmap.dispose
    @border.dispose
    @map_sprite.bitmap.dispose
    @map_sprite.dispose
    @object_sprite.bitmap.dispose
    @object_sprite.dispose
    @position_sprite.bitmap.dispose
    @position_sprite.dispose
  end

  def visible
    return @map_sprite.visible
  end

  def visible=(value)
    @map_sprite.visible = value
    @object_sprite.visible = value
    @position_sprite.visible = value
    @border.visible = value
  end

  def refresh
    @mmr = $game_system.minimap
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max

    @x = 0
    @y = 0
    @size = [map_rect.width / grid_size, map_rect.height / grid_size]

    @border = Sprite.new
    @border.x = map_rect.x - MiniMap::MINIMAP_BORDER_SIZE
    @border.y = map_rect.y - MiniMap::MINIMAP_BORDER_SIZE
    b_width = map_rect.width + (MiniMap::MINIMAP_BORDER_SIZE * 2)
    b_height = map_rect.height + (MiniMap::MINIMAP_BORDER_SIZE * 2)
    @border.bitmap = Bitmap.new(b_width, b_height)
    @border.bitmap.fill_rect(@border.bitmap.rect, MiniMap::MINIMAP_BORDER_COLOR)
    @border.bitmap.clear_rect(MiniMap::MINIMAP_BORDER_SIZE, MiniMap::MINIMAP_BORDER_SIZE,
    @border.bitmap.width - (MiniMap::MINIMAP_BORDER_SIZE * 2),
    @border.bitmap.height - (MiniMap::MINIMAP_BORDER_SIZE * 2))
    
    @map_sprite = Sprite.new
    @map_sprite.x = map_rect.x
    @map_sprite.y = map_rect.y
    @map_sprite.z = MiniMap::MAP_Z
    bitmap_width = $game_map.width * grid_size + map_rect.width
    bitmap_height = $game_map.height * grid_size + map_rect.height
    @map_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
    @map_sprite.src_rect = map_rect

    @object_sprite = Sprite.new
    @object_sprite.x = map_rect.x
    @object_sprite.y = map_rect.y
    @object_sprite.z = MiniMap::MAP_Z + 1
    @object_sprite.bitmap = Bitmap.new(bitmap_width, bitmap_height)
    @object_sprite.src_rect = map_rect

    @position_sprite = Sprite_Base.new
    @position_sprite.x = map_rect.x + @size[0] / 2 * grid_size
    @position_sprite.y = map_rect.y + @size[1] / 2 * grid_size
    @position_sprite.z = MiniMap::MAP_Z + 2
    
    bitmap = Bitmap.new(grid_size, grid_size)
    # Player's Outline
    if MiniMap::USE_OUTLINE_PLAYER and MiniMap::GRID_SIZE >= 3
      bitmap.fill_rect(bitmap.rect, MiniMap::PLAYER_OUTLINE_COLOR)
      brect = Rect.new(bitmap.rect.x + 1, bitmap.rect.y + 1, bitmap.rect.width - 2,
        bitmap.rect.height - 2)
      bitmap.clear_rect(brect)
    else
      brect = bitmap.rect
    end
    
    bitmap.fill_rect(brect, MiniMap::PLAYER_COLOR)
    @position_sprite.bitmap = bitmap

    draw_map
    update_object_list
    draw_object
    update_position
  end

  def draw_map
    bitmap = @map_sprite.bitmap
    bitmap.fill_rect(bitmap.rect, MiniMap::BACKGROUND_COLOR)
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max
    
    $game_map.width.times do |i|
      $game_map.height.times do |j|
        if !$game_map.passable?(i, j)
          next
        end
        rect = Rect.new(map_rect.width / 2 + grid_size * i,
          map_rect.height / 2 + grid_size * j,
          grid_size, grid_size)
        if grid_size >= 3
          if !$game_map.passable?(i, j)
            rect.height -= 1
            rect.x += 1
            rect.width -= 1
            rect.width -= 1
            rect.y += 1
            rect.height -= 1
          end
        end
        bitmap.fill_rect(rect, MiniMap::FOREGROUND_COLOR)
      end
    end
  end

  def update_object_list
    @object_list = {}
    $game_map.events.values.each do |e|
      comment = e.mm_comment?(MiniMap::TAG_EVENT, true)
      if comment != ''
        type = comment.gsub(/#{MiniMap::TAG_EVENT}/){}.gsub(/\s+/){}
        @object_list[type] = [] if @object_list[type].nil?
        @object_list[type] << e
      end
    end
  end

  def draw_object
    bitmap = @object_sprite.bitmap
    bitmap.clear
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max
    rect = Rect.new(0, 0, grid_size, grid_size)
    mw = map_rect.width / 2
    mh = map_rect.height / 2

    @object_list.each do |key, events|
      color = MiniMap::OBJECT_COLOR[key]
      next if events.nil? or color.nil?
      events.each do |obj|
        if !obj.character_name.empty?
          rect.x = mw + obj.real_x * grid_size / 256
          rect.y = mh + obj.real_y * grid_size / 256
          # Event's Outline
          if MiniMap::USE_OUTLINE_EVENT and MiniMap::GRID_SIZE >= 3
            bitmap.fill_rect(rect, MiniMap::EVENT_OUTLINE_COLOR)
            brect = Rect.new(rect.x + 1, rect.y + 1, rect.width - 2,
            rect.height - 2)
            bitmap.clear_rect(brect)
          else
            brect = bitmap.rect
          end
          bitmap.fill_rect(brect, color)
        end
      end
    end
  end

  def update
    if @mmr != $game_system.minimap
      dispose
      refresh 
    end
    draw_object
    update_position
    if @map_sprite.visible
      @map_sprite.update
      @object_sprite.update
      @position_sprite.update
    end
  end

  def update_position
    map_rect = Rect.new(@mmr[0], @mmr[1], @mmr[2], @mmr[3])
    grid_size = [MiniMap::GRID_SIZE, 1].max
    sx = $game_player.real_x * grid_size / 256
    sy = $game_player.real_y * grid_size / 256
    @map_sprite.src_rect.x = sx
    @map_sprite.src_rect.y = sy
    @object_sprite.src_rect.x = sx
    @object_sprite.src_rect.y = sy
  end
end
#==============================================================================
# ■ Spriteset_Map
#------------------------------------------------------------------------------
class Spriteset_Map
  attr_reader :minimap
  alias wora_minimap_sprsetmap_ini initialize
  alias wora_minimap_sprsetmap_dis dispose
  alias wora_minimap_sprsetmap_upd update
  
  def initialize
    wora_minimap_sprsetmap_ini
    if $game_map.show_minimap?
      @minimap = Game_MiniMap.new(@tilemap)
      $game_system.show_minimap = true if $game_system.show_minimap.nil?
      @minimap.visible = $game_system.show_minimap
    end
  end
  
  def dispose
    @minimap.dispose if [email protected]?
    wora_minimap_sprsetmap_dis
  end

  def update
    if [email protected]?
      if $game_system.show_minimap
        @minimap.visible = true
        @minimap.update
      else
        @minimap.visible = false
      end
    end
    wora_minimap_sprsetmap_upd
  end
end
#==============================================================================
# ■ Scene_Map
#------------------------------------------------------------------------------
class Scene_Map < Scene_Base
  attr_reader :spriteset
end

Copien, Peguen y Listo
 
Mensajes
12
Reacciones
0
Puntos
0
Ubicación
Askabantz
SISTEMA DE NOCHE Y DIA (RMVX)

Este Script Que é De Encontrar En Mi Busqueda En La Red Me Ha Sido Muy Util
y Tambien Intentare Que Sea Utiles Para Ustedes:icon_biggrin:

Este Script Sirve Para Crear Un Sistema De Dia y Noche Sin La Necesidad De Enredarte Con Switch ni Variable
La Desgracia Es Que Esta En Portugues Pero Es Facil De Entender El Script

Agradecimientos Al Creador Del Script(Kylock)

Código:
#
# Sistema de Tempo Kylock para VX v1.3
#	 10.5.2008
# traduzido pela Equipe Gemstone
#
#  Script por: Kylock
#            Praticamente todo reescrito desde a versão para XP. Códigos mais limpos
# e compatíveis. Esse é o meu sistema de dia e noite. Ele adiciona uma nova janela
# ao menu, então, se você usa um CMS, cole este script acima dele.
#            Eu tentei fazer esse o mais customizável possível, as configurações
# são encontrada logo em baixo. Embora as variáveis sejam opcionais, eu
# sugiro que as usem, pois poderão construtir eventos baseados nesse script
# mais facilmente.
#
# Histórico
#  1.0 - Lançamento.
#  1.1 - Corrigido a mudança de tonalidade nas batalhas.  Coloque este script
#		abaixo de scripts de batalha caso você note alguma erro na mesma.
#  1.2 - Corrigida a precisão de $kts.stop e $kts.go
#  1.3 - $kts.stop realmente para tudo agora.  Adicionadas switches para eventos.
#
# Instruções de Mudança de Tonalidade
#
#            Mapas designados como "fora" são os únicos que devem ser afetados pela
# tonalidade. Coloque um [KTS] antes do nome do mapa para criar este efeito.
#
# Chamar Funções do Script
#
#            Use o comando "Chamar Script".
#	$kts.stop			- parar o tempo
#	$kts.go			  - continuar o tempo
#	$kts.sec(n)		  - avança (n) segundos
#	$kts.min(n)		  - avança (n) minutos
#	$kts.hours(n)		- avança (n) horas
#	$kts.days(n)		 - avança (n) dias.
#	$kts.jump_to_hour(n) - Muda o tempo para a hora (n).
#
# Configurações do Dabatase do Jogo
#
#	Esse script, por padrão, usa as seguintes variáveis e switches:
#  Variáveis:
#	[1] O tempio atual              	  [4] Horas Atual
#	[2] Segundo atual		  [5] Dia Atual
#	[3] Minuto atual 		  [6] Nome do dia atual
#  Switches:
#	[23] ON durante a noite  		(2200-0400)(10pm-4am)
#	[24] ON durante a madrugada		(0500-0800)( 5am-8am)
#	[25] ON durante o amanhecer		(0900-1800)( 9am-6pm)
#	[26] ON durante o anoitecer		(1900-2100)( 7pm-9pm)
#
#

# Guarda as configurações definidas.
#
module KTS
  #-
  # Define as configurações do relógio
  #-
  # Define a velocidade do relógio.
  #   1 é o tempo real. O padrão é 100 (cem vezes mais rápido do que o tempo real)
  SPEED	  = 100
  #AM-PM? (True: relógio de 12 horas AM e 12 horas PM, False: relógio de 24 horas)
  AMPM	   = false
  # Define o horário inicial do jogo.
  START_HOUR = 13
  START_DAY  = 5
  #-
  # Nomes dos dias
  #-
  DAY_NAMES = ["Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sábado"]
  #-
  # Períodos
  #-
  T1 = [ 0,5 ] # Noite		 # Arruma os períodos para a tonalidade.
  T2 = [ 6,8 ] # Madrugada		  # [Hora Inicial, Hora Final]
  T3 = [ 9,18] # Manhã		   # Use termos de um relógio de 24 horas.
  T4 = [19,21] # Tarde
  T5 = [22,24] # Noite		 # <- Ex: Noite é entre 22:00 e 24:00
  #-
  # Configurações para as variáveis em jogo
  #-
  # True para colocar o tempo nas variáveis e switches definidas
  DATABASE_OUTPUT = false
	# Variável a ser usada
	TIME	= 1 #(É nesse formato: "2:48 AM" ou "02:48")
	SECONDS = 2 
	MINUTES = 3 
	HOURS   = 4 
	DAYS	= 5 
	DAYNAME = 6
	# Switches
	NIGHT   = 23 #    Estará on nas horas definidas
	DAWN	= 24 #  Estará on nas horas definidas
	DAY	 = 25 # Estará on nas horas definidas
	SUNSET  = 26 #   Estará on nas horas definidas
  #-
  # Configurações para a tonalidade da tela
  #-
  # True para habilitar essa função; false para desabilitar essa função.
  USE_TONE = true
  # Duração da mudança de tonalidade (em frames)
  FADE_LENGTH = 120
  # Definir Tonalidades para cada período
  #			  Vermelho, Verde, Azul, Cinza
  C1 = Tone.new(-187,  -119,  -17,  68)
  C2 = Tone.new(  17,   -51, -102,   0)
  C3 = Tone.new(   0,	 0,	0,   0)
  C4 = Tone.new( -68,  -136,  -34,   0)
  C5 = Tone.new(-187,  -119,  -17,  68)
end

#
# Engine do Sistema de Tempo
#
class Kylock_Time_System
  # arrumas as variáveis
  def initialize
	$kts_map_data = load_data("Data/MapInfos.rvdata")
	@event_offset = (KTS::START_HOUR * 3600) + (KTS::START_DAY * 86400)
	@kts_stop = false
	$kts_event_tone = false
	$kts_battle_tone = true
  end
  
  # Guarda o tempo e atualiza
  def update
	if !@kts_stop
	  @total_seconds = (Graphics.frame_count * KTS::SPEED / 60) + @event_offset
	  @seconds = (@total_seconds) % 60
	  @minutes = (@total_seconds / 60) % 60
	  @hours   = (@total_seconds / 3600) % 24
	  @days	= (@total_seconds / 86400)
	  update_tint
	  if KTS::DATABASE_OUTPUT
		update_variables
		update_switches
	  end
	end
  end

  def update_variables
	$game_variables[KTS::TIME]	= getTime
	$game_variables[KTS::SECONDS] = @seconds
	$game_variables[KTS::MINUTES] = @minutes
	$game_variables[KTS::HOURS]   = @hours
	$game_variables[KTS::DAYS]	= @days
	$game_variables[KTS::DAYNAME] = getDayName
  end

  def update_switches
	if @period == 1 || @period == 5
	  $game_switches[KTS::NIGHT] = true
	else
	  $game_switches[KTS::NIGHT] = false
	end
	if @period == 2
	  $game_switches[KTS::DAWN] = true
	else
	  $game_switches[KTS::DAWN] = false
	end
	if @period == 3
	  $game_switches[KTS::DAY] = true
	else
	  $game_switches[KTS::DAY] = false
	end
	if @period == 4
	  $game_switches[KTS::SUNSET] = true
	else
	  $game_switches[KTS::SUNSET] = false
	end
  end

  def getTime
	if KTS::AMPM
	  # Formats a 12-Hour Clock
	  if @hours > 12
		hours1 = @hours - 12
		if hours1 > 9
		  time = sprintf("%02d:%02d" + " PM", hours1, @minutes)
		else
		  time = sprintf("%01d:%02d" + " PM", hours1, @minutes)
		end
	  else
		if @hours > 9
		  time = sprintf("%02d:%02d" + " AM", @hours, @minutes)
		else
		  time = sprintf("%01d:%02d" + " AM", @hours, @minutes)
		end
	  end
	  return time
	else
	  # Formats a 24-Hour Clock
	  time = sprintf("%02d:%02d", @hours, @minutes)
	  return time
	end
  end
  #-
  # Comandos para as Funções do Script
  #-
  def stop
	@time_stopped = @total_seconds
	@kts_stop = true
  end
  def go
	total_seconds = (Graphics.frame_count * KTS::SPEED / 60) + @event_offset
	@event_offset -= (total_seconds - @time_stopped)
	@kts_stop = false
  end
  def sec(sec = 0)
	@event_offset += sec
  end
  def min(min = 0)
	@event_offset += min * 60
  end
  def hours(hours = 0)
	@event_offset += hours * 3600
  end
  def days(days = 0)
	@event_offset += days * 86400
  end
  def jump_to_hour(jhour = 0)
	while @hours != jhour
	  @event_offset += 1
	  $kts.update
	end
  end
  #-
  # Outras funções
  #-
  def getDayName
	weekday = (@days % KTS::DAY_NAMES.length)
	return KTS::DAY_NAMES[weekday]
  end

  #-
  # Tonalidade de Tela
  #-
  def update_tint(duration = KTS::FADE_LENGTH)
	if KTS::USE_TONE && !$kts_event_tone && $kts_map_data[$game_map.map_id].outside_tint?
	  if @hours >= KTS::T1[0] and @hours <= KTS::T1[1]
		@period = 1
		screen.start_tone_change(KTS::C1,duration)
	  elsif @hours >= KTS::T2[0] and @hours <= KTS::T2[1]
		@period = 2
		screen.start_tone_change(KTS::C2,duration)
	  elsif @hours >= KTS::T3[0] and @hours <= KTS::T3[1]
		@period = 3
		screen.start_tone_change(KTS::C3,duration)
	  elsif @hours >= KTS::T4[0] and @hours <= KTS::T4[1]
		@period = 4
		screen.start_tone_change(KTS::C4,duration)
	  elsif @hours >= KTS::T5[0] and @hours <= KTS::T5[1]
		@period = 5
		screen.start_tone_change(KTS::C5,duration)
	  end
	else
	  # sem mundaça nos mapas "dentro"
	  if !$kts_map_data[$game_map.map_id].outside_tint?
		screen.start_tone_change(Tone.new(0,0,0,0),duration)
	  end
	end
  end
  def screen
	if $game_temp.in_battle
	  return $game_troop.screen
	else
	  return $game_map.screen
	end
  end
end

#
# Atualiza instantaneamente quando se teletransporta
#
class Game_Map
  alias kts_setup setup
  def setup(map_id)
	kts_setup(map_id)
	$kts_event_tone = false
	$kts.update
	$kts.update_tint(0)
  end
end

#
# Atualiza instantaneamente quando entra na batalha
#
class Spriteset_Battle
  alias kts_create_battleback create_battleback
  def create_battleback
	$kts.update_tint(0)
	kts_create_battleback
  end
end

#
# Desabilita temporariamente quando um evento muda a tonalidade
#
class Game_Interpreter
  alias kts_Interpreter_command_223 command_223
  def command_223
	$kts_event_tone = true
	kts_Interpreter_command_223
  end
end

#
# Integra o sistema ao Game System
#
class Game_System
  # inits a KTS object
  alias kts_initialize initialize
  def initialize
	$kts=Kylock_Time_System.new
	kts_initialize
  end
  # Updates kts every game frame
  alias kts_update update
  def update
	$kts.update
	kts_update
  end
end

#
# Scaneia mapas para o nome
#
class RPG::MapInfo
  def name # Impede que sistemas de localização leiam o [KTS]
	return @name.gsub(/\[.*\]/) {""} # colchetes e os inclusos
  end
  def original_name
	return @name
  end
  def outside_tint?
	return @name.scan(/[\KTS]/).size > 0
  end
end

#
# Configura a janela de tempo
#
class Window_KTS < Window_Base
  def initialize(x, y)
	super(x, y, 160, WLH + 32)
	refresh
  end
  def refresh
	self.contents.clear
	self.contents.draw_text(4, -6, 120, 32, $kts.getTime, 2)
  end
  def update
	super
	$kts.update
	self.contents.clear
	self.contents.draw_text(4, -6, 120, 32, $kts.getTime, 2)
  end
end

#
# Adiciona a janela ao menu
#
class Scene_Menu < Scene_Base
  alias kts_start start
  def start
	kts_start
	@kts_window = Window_KTS.new(0,305)
  end
  alias kts_terminate terminate
  def terminate
	kts_terminate
	@kts_window.dispose
  end
  alias kts_update update
  def update
	kts_update
	@kts_window.update
  end
end

#
# Para as tela de Load/Save
#
class Scene_File
  alias kts_write_save_data write_save_data
  def write_save_data(file)
	kts_write_save_data(file)
	Marshal.dump($kts, file)
  end
  alias kts_read_save_data read_save_data
  def read_save_data(file)
	kts_read_save_data(file)
	$kts = Marshal.load(file)
  end
end

Les Deseo Mucha Suerte En Su Proyecto.........................:difus_3:
 
Última edición:
Mensajes
12
Reacciones
0
Puntos
0
Ubicación
Askabantz
Rth Abs V2.5

RTH ABS v2.5 (RMXP)
:icon_mrorange:
de RTH

Introducción:
Es uno de los mejores ABS para XP que existe con la posibilidad de que las tropas y varias cosas


Características:

Los enemigos - de Trabajo
sistema Hit Combo (Mostrar Cuantos Hit Le Has Dado Al Enemigo) - funcional
sistema de Destreza - funcional
sistema de Toque - funcional
Animaciones de char en la habilidad - Funcional
Animaciones de char en Hit - Funcional
Animaciones de char en Combo - Funcional (1 para cada uno)
Tiros con Arco - Grupo de trabajo (hasta activa cisas)
Sistema de Tropa - funcional

Screenshot:

ss1te7.png

Sistema De Tropa:
yhyt2.png


Script:
Tengo Para Puro Bajarse El Demo

DEMO:
http://www.4shared.com/file/37822937...H-ABS.html?s=1

PD: lion_hart intentare buscarte ese script o si no tendre que kreartelo​
:difus_3:
 
Mensajes
1.557
Reacciones
0
Puntos
0
Ubicación
I don't live in this world...
Descripción:
El sistema de batalla lateral de RPG Tankentai, pero funcionando como ATB (Batalla en Tiempo Activo). Esto le da un aire a Final Fantasy a las batallas.

Screens:
atbsblut0.jpg

atb.png

Vídeo:

Demo:
Descargar Demo (SkyDrive)
Descargar Demo (FileFront)
Descargar Demo (MegaUpload)

Instrucciones:
Lee los comentarios en los scripts, porque más o menos viene todo lo necesario para hacerlo funcionar. Está complicado, eh, así que tómatelo con calma.

Yo no hice este script. Eso significa que no esperes que te resuelva todas las dudas derivadas del él, aunque pueda intentarlo.

Compatibilidad:
Es un milagro si no da problemas con algo. Suerte a la hora de usarlo.

Créditos:
Script creado por RPG Tankentai (SBL) y Star (ATB).
Traducción al Inglés por Mr. Bubble.
Traducción al Español por Fegarur.
Sacado de VoidZone​


Descripción:
No sabía si ponerlo como actualización del ABS de Vlad o como nuevo. Al final me decidií por esta última opción. Eso lo describe bastante bien. Ahora se pueden usar armas de largo alcance, como arcos, además de asociar habilidades y objetos a teclas (que aparecerán en el HUD). La demo incluye un pequeño script para aumentar la prioridad, con la esperanza de evitar un posible lag.

Screens:
fireat6.jpg

flechalp8.jpg

Demo:
Descargar Demo (SkyDrive)
Descargar Demo (MegaUpload)
Descargar Demo (FileFront)
Descargar Demo (Fortaleza Friki)

Instrucciones:
Es muy similar al ABS de Vlad. Como en ese script, está todo en el script y la demo. :y:

Créditos:
Script creado por Vlad, Chronos y Drod.



Sacado de VoidZone​
 
Última edición por un moderador:
Mensajes
271
Reacciones
0
Puntos
0
Descripción:
El sistema de batalla lateral de RPG Tankentai, pero funcionando como ATB (Batalla en Tiempo Activo). Esto le da un aire a Final Fantasy a las batallas.

Screens:
atbsblut0.jpg

atb.png

Vídeo:

Demo:
Descargar Demo (SkyDrive)
Descargar Demo (FileFront)
Descargar Demo (MegaUpload)

Instrucciones:
Lee los comentarios en los scripts, porque más o menos viene todo lo necesario para hacerlo funcionar. Está complicado, eh, así que tómatelo con calma.

Yo no hice este script. Eso significa que no esperes que te resuelva todas las dudas derivadas del él, aunque pueda intentarlo.

Compatibilidad:
Es un milagro si no da problemas con algo. Suerte a la hora de usarlo.

Créditos:
Script creado por RPG Tankentai (SBL) y Star (ATB).
Traducción al Inglés por Mr. Bubble.
Traducción al Español por Fegarur.
Sacado de VoidZone​


Descripción:
No sabía si ponerlo como actualización del ABS de Vlad o como nuevo. Al final me decidií por esta última opción. Eso lo describe bastante bien. Ahora se pueden usar armas de largo alcance, como arcos, además de asociar habilidades y objetos a teclas (que aparecerán en el HUD). La demo incluye un pequeño script para aumentar la prioridad, con la esperanza de evitar un posible lag.

Screens:
fireat6.jpg

flechalp8.jpg

Demo:
Descargar Demo (SkyDrive)
Descargar Demo (MegaUpload)
Descargar Demo (FileFront)
Descargar Demo (Fortaleza Friki)

Instrucciones:
Es muy similar al ABS de Vlad. Como en ese script, está todo en el script y la demo. :y:

Créditos:
Script creado por Vlad, Chronos y Drod.



Sacado de VoidZone​


oye ese scrip no lo hay para rpg maker xp me vendria bn tenerlo
 
Última edición por un moderador:
Estado
Cerrado para nuevas respuestas
Arriba Pie