| Objetos del inventario en el mapa (Rudi Guillan)Vie Feb 22, 2008 4:38 pm por Caistsa Descripción
Este script permite que cuando vallamos por el mapa en la esquina izquierda arriba aparecca una lista de nuestros objetos(si esque tenemos)
Script
- Spoiler:
- Código:
############################################################################
################# Objetos en mapa #########################
############################################################################
################# Creado por #########################
################# Rudy_Guillan #########################
################# 15-6-2007 #########################
############################################################################
$obj_index = 0
class Scene_Map
alias guil_main main
def main
@objects_window = Window_Objects.new
guil_main
@objects_window.dispose
end
alias guil_update update
def update
@objects_window.update
@data = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
end
end
if Input.trigger?(Input::L)
if @data.size != 0
if $obj_index == 0
$obj_index = @data.size - 1
$game_system.se_play($data_system.equip_se)
else
$obj_index -= 1
$game_system.se_play($data_system.equip_se)
end
end
end
if Input.trigger?(Input::X)
if @data.size != 0
if $obj_index == @data.size - 1
$game_system.se_play($data_system.equip_se)
$obj_index = 0
else
$game_system.se_play($data_system.equip_se)
$obj_index += 1
end
end
end
if Input.trigger?(Input::Y)
@item = @data[$obj_index]
$game_party.actors[0].item_effect(@item)
$game_temp.common_event_id = @item.common_event_id
$game_system.se_play(@item.menu_se)
if @item.consumable
$game_party.lose_item(@item.id, 1)
end
end
guil_update
end
end
class Window_Objects < Window_Base
def initialize
super(-16, -16, 147, 147)
self.contents = Bitmap.new(width - 32, height - 32)
self.opacity = 0
self.contents.font.size = 15
refresh
end
def refresh
self.contents.clear
@data = []
@number = []
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
@data.push($data_items[i])
@number.push($game_party.item_number(i))
end
end
if @data.size != 0
if $obj_index >= @data.size
$obj_index = @data.size - 1
end
@icon1 = Sprite.new
if $obj_index - 2 >= 0
@icon1.bitmap = RPG::Cache.icon(@data[$obj_index - 2].icon_name)
else
if $obj_index == 0
@icon1.bitmap = RPG::Cache.icon(@data[@data.size - 2].icon_name)
else
@icon1.bitmap = RPG::Cache.icon(@data[@data.size - 1].icon_name)
end
end
@icon1.zoom_x = 0.5
@icon1.zoom_y = 0.5
@icon1.x = 90
@icon1.y = 0
@icon2 = Sprite.new
if $obj_index - 1 >= 0
@icon2.bitmap = RPG::Cache.icon(@data[$obj_index - 1].icon_name)
else
if $obj_index == 1
@icon2.bitmap = RPG::Cache.icon(@data[0].icon_name)
else
@icon2.bitmap = RPG::Cache.icon(@data[@data.size - 1].icon_name)
end
end
@icon2.x = 70
@icon2.y = 25
@icon3 = Sprite.new
@icon3.bitmap = RPG::Cache.icon(@data[$obj_index].icon_name)
@icon3.zoom_x = 1.5
@icon3.zoom_y = 1.5
@icon3.x = 50
@icon3.y = 50
if @data[$obj_index].consumable
self.contents.draw_text(88, 65, 25, 32, "x" + "#{@number[$obj_index]}")
end
@icon4 = Sprite.new
if $obj_index + 1 < @data.size
@icon4.bitmap = RPG::Cache.icon(@data[$obj_index + 1].icon_name)
else
@icon4.bitmap = RPG::Cache.icon(@data[0].icon_name)
end
@icon4.x = 25
@icon4.y = 70
@icon5 = Sprite.new
if $obj_index + 2 < @data.size
@icon5.bitmap = RPG::Cache.icon(@data[$obj_index + 2].icon_name)
else
if $obj_index + 1 < @data.size
@icon5.bitmap = RPG::Cache.icon(@data[0].icon_name)
else
if @data[1]
@icon5.bitmap = RPG::Cache.icon(@data[1].icon_name)
else
@icon5.bitmap = RPG::Cache.icon(@data[0].icon_name)
end
end
end
@icon5.zoom_x = 0.5
@icon5.zoom_y = 0.5
@icon5.x = 0
@icon5.y = 90
end
end
def update
if @icon1 != nil
@icon1.dispose
@icon1.bitmap.dispose
end
if @icon2 != nil
@icon2.dispose
@icon2.bitmap.dispose
end
if @icon3 != nil
@icon3.dispose
@icon3.bitmap.dispose
end
if @icon4 != nil
@icon4.dispose
@icon4.bitmap.dispose
end
if @icon5 != nil
@icon5.dispose
@icon5.bitmap.dispose
end
refresh
end
end
Instrcciones
Coloca el script encima de main
Y llamalo como quieras^^
Para los controles son estos:
(S)Para utilizar el objeto.Este objeto usado solo tendra egfecto sobre el pj 1
(Q)Mover la lista de objetos
Créditos
Rudy Guillan
Demo
Aunque no sea necesaria yo la pongo^^
AQUÍ
Screens
Aquí van dos:
 Comentarios: 3 | ¿Quién está en línea ? En total hay 1 usuario en línea: 0 Registrados, 0 Ocultos y 1 Huésped Usuarios registrados: Ninguno [ Ver toda la lista ] La mayor cantidad de usuarios en línea fue 4 el Vie Mar 14, 2008 7:04 pm. Estadísticas Tenemos 23 usuarios registrados. El último usuario registrado es larita. Nuestros usuarios han publicado un total de 644 mensajes. en 182 argumentos. |