Jump to content
Rpg²S Forum

athreus

Utenti
  • Posts

    37
  • Joined

  • Last visited

Posts posted by athreus

  1. Ciao a tutti, volevo utilizzare nel mio progetto lo XAS come bs, ma inizialmente non supportava un party. Ho trovato questo Ally system di Hekels <http://adf.ly/246619/http://www.4shared.com/file/iSks5PRA/Xas_PArty_Add_on_By_heckels-Tr.html>

    che mi ha permesso di avere un gruppo (Composto di base dall'eroe più un compagno).

    Aggiungendo un secondo compagno, solo la barra hp del primo appare sullo schermo. Come posso far si che le barre appaiano per tutti i componenti del party? Ho provato a cambiare qualcosa nello script, ma ho solo ottenuto la duplicazione della stessa barra hp.

    Grazie dell'aiuto.

  2. Chiedo aiuto per un problema abbastanza assurdo. La scene End non funziona più, nel senso che appare si la finestra, ma i pulsanti non funzionano. Premendo enter su qualsiasi comando questo non parte! La Scene_end che posto è un po modificata, alcuni piccoli esperimenti che sto facendo, ma non mi pare che le mie modifiche ne compromettano il funzionamento... o si? Mi affido alla vostra sapienza! XD

    Grazie in anticipo.

     

    Scene_End:

     

    #======================================================================

    ========

    # ■ Scene_End

    #------------------------------------------------------------------------------

    #  ゲーム終了画面の処理を行うクラスです。

    #==============================================================================

     

    class Scene_End

    #--------------------------------------------------------------------------

    # ● メイン処理

    #--------------------------------------------------------------------------

    def main

    # コマンドウィンドウを作成

    s1 = "Menù Principale"

    s2 = "Esci"

    s3 = "Indietro"

    @command_window = Window_Command.new(192, [s1, s2, s3])

    @command_window.x = 320 - @command_window.width / 2

    @command_window.y = 240 - @command_window.height / 2

    # トランジション実行

    Graphics.transition

    # メインループ

    loop do

    # ゲーム画面を更新

    Graphics.update

    # 入力情報を更新

    Input.update

    # フレーム更新

    update

    # 画面が切り替わったらループを中断

    if $scene != self

    break

    end

    end

    # トランジション準備

    Graphics.freeze

    # ウィンドウを解放

    @command_window.dispose

    # タイトル画面に切り替え中の場合

    if $scene.is_a?(Scene_Title)

    # 画面をフェードアウト

    Graphics.transition

    Graphics.freeze

    end

    end

    #--------------------------------------------------------------------------

    # ● フレーム更新

    #--------------------------------------------------------------------------

    def update

    # コマンドウィンドウを更新

    @command_window.update

    # B ボタンが押された場合

    if Input.trigger?(Input::B)

    # キャンセル SE を演奏

    $game_system.se_play($data_system.cancel_se)

    # メニュー画面に切り替え

    if $game_switches[11] == false

    $scene = Scene_MenuA.new

    elsif $game_switches[11] == true

    $scene = Scene_Menu.new

    return

    end

    # C ボタンが押された場合

    if Input.trigger?(Input::C)

    # コマンドウィンドウのカーソル位置で分岐

    case @command_window.index

    when 0 # タイトルへ

    command_to_title

    when 1 # シャットダウン

    command_shutdown

    when 2 # やめる

    command_cancel

    end

    return

    end

    end

    #--------------------------------------------------------------------------

    # ● コマンド [タイトルへ] 選択時の処理

    #--------------------------------------------------------------------------

    def command_to_title

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    # BGM、BGS、ME をフェードアウト

    Audio.bgm_fade(800)

    Audio.bgs_fade(800)

    Audio.me_fade(800)

    # タイトル画面に切り替え

    $scene = Scene_Title.new

    end

    #--------------------------------------------------------------------------

    # ● コマンド [シャットダウン] 選択時の処理

    #--------------------------------------------------------------------------

    def command_shutdown

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    # BGM、BGS、ME をフェードアウト

    Audio.bgm_fade(800)

    Audio.bgs_fade(800)

    Audio.me_fade(800)

    # シャットダウン

    $scene = nil

    end

    #--------------------------------------------------------------------------

    # ● コマンド [やめる] 選択時の処理

    #--------------------------------------------------------------------------

    def command_cancel

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    $game_system.bgm_stop

    # メニュー画面に切り替え

    if $game_switches[11] == false

    $scene = Scene_MenuA.new

    elsif $game_switches[11] == true

    $scene = Scene_Menu.new

    end

    end

    end

    end

     

  3. Scusate il necropost, ma qualcuno potrebbe darmi una mano perchè non mi funziona l'opzione del BGM. Quelle per i SE e le windowskins funzionano, ma quella no. E' un po strano, no? Grazie in anticipo!

     

    Lascio lo script nel caso ci fosse qualche errore...

     

     

    #======================================================================

    ========

    # ■ Window_Base

    #==============================================================================

     

    class Window_Base

    #--------------------------------------------------------------------------

    def draw_meter(now, max, x, y, width, height, start_color, end_color=start_color )

    self.contents.fill_rect(x, y, width, height, Color.new(0,0,0,255))

    now = now > max ? max : now

    percentage = max != 0 ? (width) * now / max.to_f : 0

    if start_color == end_color

    self.contents.fill_rect(x, y, percentage, height, start_color)

    else

    for i in 0..percentage-1

    r = start_color.red + (end_color.red - start_color.red) / percentage * i

    g = start_color.green + (end_color.green - start_color.green) / percentage * i

    b = start_color.blue + (end_color.blue - start_color.blue) / percentage * i

    a = start_color.alpha + (end_color.alpha - start_color.alpha) / percentage * i

    self.contents.fill_rect(x+i, y, 1, height, Color.new(r, g, b, a))

    end

    end

    end

    #--------------------------------------------------------------------------

    end

     

     

    #==============================================================================

    # ■ Window_Option

    #==============================================================================

     

    class Window_Option < Window_Base

    #--------------------------------------------------------------------------

    def initialize

    super(6*32, 128, 13*32+16, 2*24+32)

    self.contents = Bitmap.new(width - 32, height - 32)

    self.contents.font.name = $fontface

    self.contents.font.size = $fontsize

    refresh

    end

    #--------------------------------------------------------------------------

    def refresh

    self.contents.clear

     

    self.contents.fill_rect(20, 0+10, 200, 6, Color.new(0, 0, 0, 255))

    self.contents.fill_rect(20, 24+10, 200, 6, Color.new(0, 0, 0, 255))

     

    draw_meter($game_system.se_volume, 100, 21, 1+10, 198, 4, Color.new(255, 255, 255, 255))

    draw_meter($game_system.me_volume, 100, 21, 25+10, 198, 4, Color.new(255, 255, 255, 255))

     

    self.contents.font.color = normal_color

    self.contents.draw_text(0, 0, width-32, 24, "0")

    self.contents.draw_text(224, 0, 32, 24, "100")

    self.contents.draw_text(0, 0, width-32-2, 24, $game_system.se_volume.to_s + "/ 100", 2)

     

    self.contents.draw_text(0, 24, width-32, 24, "0")

    self.contents.draw_text(224, 24, 32, 24, "100")

    self.contents.draw_text(0, 24, width-32-2, 24, $game_system.me_volume.to_s + "/ 100", 2)

    end

    #--------------------------------------------------------------------------

    end

     

     

    #==============================================================================

    # ■ Window_OptionCommand

    #==============================================================================

     

    class Window_OptionCommand < Window_Selectable

    #--------------------------------------------------------------------------

    def initialize

    super(16, 160, 5*32, 4*24+32)

    @commands = ["Suoni", "Musica", "Finestre", "Predefinito"]

    @description = ["Modifica il volume dei suoni",

    "Modifica il volume della musica",

    "Cambia la grafica corrente delle finestre",

    "Applica le impostazioni predefinite"]

    @item_max = 4

    @column_max = 1

    self.contents = Bitmap.new(width - 32, height-32)

    self.contents.font.name = $fontface

    self.contents.font.size = $fontsize

    for i in 0..(@item_max-1)

    draw_item(i, normal_color)

    end

    self.z = 200

    self.index = 0

    end

    #--------------------------------------------------------------------------

    def draw_item(index, color)

    self.contents.font.color = color

    rect = Rect.new(0, 24*index, width-32, 24)

    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))

    self.contents.draw_text(rect, @commands[index], 1)

    end

    #--------------------------------------------------------------------------

    def update_help

    @help_window.set_text(@description[index], 1)

    end

    #--------------------------------------------------------------------------

    def update_cursor_rect

    self.cursor_rect.set(0, 24*index, width-32, 24)

    end

    #--------------------------------------------------------------------------

    end

     

     

    #==============================================================================

    # ■ Window_Windowskin

    #==============================================================================

     

    class Window_Windowskin < Window_Selectable

    #--------------------------------------------------------------------------

    def initialize

    super(6*32, 128+3*24+8, 13*32+16, 32+64)

    self.contents = Bitmap.new(width - 32, height - 32)

    self.index = -1

    self.active = false

    @column_max = @item_max = 3#ZVB# Inserisci il numero di windowskin presenti nell'omonima cartella

    refresh

    end

    #--------------------------------------------------------------------------

    def refresh

    self.contents.clear

    for i in 0..@item_max-1

    x = i % @column_max * (width-32)/@column_max

    y = i / @column_max * 64

    bitmap = RPG::Cache.windowskin("Windowskin#{i + 1}")

    self.contents.blt(x, y, bitmap, Rect.new(64, 0, 128, 64), 255)

    end

    end

    #--------------------------------------------------------------------------

    def update_cursor_rect

    x = index % @column_max * (width-32)/@column_max

    y = index / @column_max * 64

    if @index < 0

    self.cursor_rect.empty

    else

    self.cursor_rect.set(x, y, 128, 64)

    end

    end

    #--------------------------------------------------------------------------

    end

     

     

    #==============================================================================

    # ■ Scene_Option

    #==============================================================================

     

    class Scene_Option

    #--------------------------------------------------------------------------

    def initialize(index=0)

    @index = index

    end

    #--------------------------------------------------------------------------

    def main

    @command_window = Window_OptionCommand.new

    @help_window = Window_Help.new

    @command_window.help_window = @help_window

    @option_window = Window_Option.new

    @windowskin_window = Window_Windowskin.new

    @se_regulation = false

    @me_regulation = false

    Graphics.transition

    loop do

    Graphics.update

    Input.update

    update

    if $scene != self

    break

    end

    end

    Graphics.freeze

    @help_window.dispose

    @command_window.dispose

    @option_window.dispose

    @windowskin_window.dispose

    end

    #--------------------------------------------------------------------------

    def update

    @help_window.update

    @command_window.update

    @option_window.update

    @windowskin_window.update

    if @command_window.active

    @command_window.help_window = @help_window

    update_command

    return

    end

    if @windowskin_window.active

    @help_window.set_text("Seleziona la grafica delle finestre")

    update_windowskin

    return

    end

    if @se_regulation == true

    update_se_regulation

    end

    if @me_regulation == true

    update_me_regulation

    end

    end

    #--------------------------------------------------------------------------

    def update_command

    if Input.trigger?(Input::B)

    $game_system.se_play($data_system.cancel_se)

    $scene = Scene_Menu.new(4)

    return

    end

    if Input.trigger?(Input::C)

    case @command_window.index

    when 0

    $game_system.se_play($data_system.decision_se)

    @command_window.active = false

    @se_regulation = true

    when 1

    $game_system.se_play($data_system.decision_se)

    @command_window.active = false

    @me_regulation = true

    when 2

    $game_system.se_play($data_system.decision_se)

    @command_window.active = false

    @windowskin_window.index = 0

    @windowskin_window.active = true

    when 3

    $game_system.se_play($data_system.decision_se)

    $game_system.se_volume = 100#ZVB#cambia il valore 100 per settare il volume di default per i SE

    $game_system.me_volume = 80#ZVB#cambia il valore 80 per settare il volume di default per i ME,BGM,BGS

    $game_system.windowskin_name = $data_system.windowskin_name = "windowskin2"#ZVB#la windowskin1 è la windowskin di default

    @option_window.refresh

    end

    return

    end

    end

    #--------------------------------------------------------------------------

    def update_se_regulation

    if Input.trigger?(Input::B)

    $game_system.se_play($data_system.cancel_se)

    @se_regulation = false

    @command_window.active = true

    return

    end

    if Input.trigger?(Input::C)

    $game_system.se_play($data_system.decision_se)

    @se_regulation = false

    @command_window.active = true

    return

    end

    if Input.repeat?(Input::RIGHT) and $game_system.se_volume < 100

    $game_system.se_play($data_system.cursor_se)

    $game_system.se_volume += 1

    @option_window.refresh

    end

    if Input.repeat?(Input::LEFT) and $game_system.se_volume > 0

    $game_system.se_play($data_system.cursor_se)

    $game_system.se_volume -= 1

    @option_window.refresh

    end

    end

    #--------------------------------------------------------------------------

    def update_me_regulation

    if Input.trigger?(Input::B)

    $game_system.se_play($data_system.cancel_se)

    @me_regulation = true

    @command_window.active = true

    return

    end

    if Input.trigger?(Input::C)

    $game_system.se_play($data_system.decision_se)

    @me_regulation = true

    @command_window.active = true

    return

    end

    if Input.repeat?(Input::RIGHT) and $game_system.me_volume < 100

    $game_system.me_volume += 1

    @option_window.refresh

    end

    if Input.repeat?(Input::LEFT) and $game_system.me_volume > 0

    $game_system.me_volume -= 1

    @option_window.refresh

    end

    end

    #--------------------------------------------------------------------------

    def update_windowskin

    if Input.trigger?(Input::B)

    $game_system.se_play($data_system.cancel_se)

    @windowskin_window.active = false

    @command_window.active = true

    @windowskin_window.index = -1

    return

    end

    if Input.trigger?(Input::C)

    $game_system.se_play($data_system.decision_se)

    $data_system.windowskin_name = $game_system.windowskin_name = "Windowskin#{@windowskin_window.index + 1}"

    return

    end

    end

    #--------------------------------------------------------------------------

    end

     

  4. Scusate se ancora chiedo aiuto per questo script, ma mi è stato molto utile, in effetti forse più di tutti gli altri, e intendevo riciclarlo nuovamente. Però stavolta mi servirebbe che il numero di pagina non fosse mostrato. E' possibile? Grazie in anticipo per la pazienza! XD

     

    E ancora grazie e complimenti a Sylaer!

  5. Spero che qualcuno conosca questo codice,perchè avrei bisogno di una mano...XD

    Vorrei fare in modo che l'ombra proiettata cambi direzione e opacità seguendo il ciclo giorno e notte che sto creando ad eventi. Per farlo, ho provato di tutto, ma non funziona. Se metto un evento sulla mappa e vi inserisco il commento begin Sun, l'ombra viene mostrata (con l'angolazione che dico io). Per il ciclo giorno e notte, ho creato altre pagine nell'evento in cui inserivo le angolazioni desiderate, attivando tali pagine con switch diversi a seconda dell'ora del giorno. Tuttavia in questo modo lo script non parte proprio, e l'ombra scompare. Ho scoperto, quindi, che se un evento viene attivato da uno switch o da una variabile lo script non funziona. Togliendo il trigger, infatti, funziona benissimo. E' normale? Qualcuno ci è riuscito? Grazie a chiunque mi aiuterà ^^

     

    Allego lo script comunque, se dovesse servire.

     

     

    #======================================================================

    ========

    # ** Sprite Sun

    #------------------------------------------------------------------------------

    # Based on Sprite Shadow

    # modified by Rataime

    # New Edits by DerVVulfman

    # February 12, 2008

    #------------------------------------------------------------------------------

    #

    # Introduction:

    #

    # This system allows you and all 'prepared' events to generate shadows while

    # on the field map. The player can move around while a programmed 'sun' will

    # display a shadow. Likewise, events with a special comment within their

    # event list can also generate shadows.

    #

    #------------------------------------------------------------------------------

    #

    # Instructions:

    #

    # -- The Sun

    # To create a sun effect, you'll need to create a map event that's to be

    # used 'as' the sun itself. Under most circumstances, this will be an

    # event without a characterset graphic. You don't want to 'SEE' the sun,

    # do you?

    #

    # To make one of these events a 'sun, you'll need to insert a couple of

    # things into that event's "List of Event Commands". These things are

    # nothing more than comments.

    #

    # The first comment to add is "begin Sun" (without quotes). It informs

    # the system that this map has a sun effect in use. The remaining two

    # values are optional and have default values in the configuration

    # section (only just added into the script). They too are added as

    # comments.

    #

    # self_angle 'number' --- How much of an angle each shadow will have.

    # self_opacity 'number' --- How dark the shadow will be.

    #

    # After that, your characters can now move about and generate shadows.

    #

    # -- Other Events

    # Events do not know that they can generate shadows. To let them gene-

    # rate a shadow, all you need to do is add a special comment into their

    # "List of Event Commands". This comment needed is merely the phrase

    # 'begin Shadow' (again, without quotes).

    #

    #

    #------------------------------------------------------------------------------

    #

    # Revisions to note:

    #

    # 1) Added formatted headers and comments throughout the script.

    # 2) Encapsulated a comment/parameter code in an XPML module.

    # 3) Set the sun shadow array into an instance value to lower resource costs.

    # 4) Compatability with Near Fantastica's Squad Movement systems.

    # 5) Compatability with Ccoa's Caterpillar system.

    # 6) Compatability with Trickster's Caterpillar system.

    # 7) Added default shadow settings into the configuration section.

    #

    #==============================================================================

     

     

     

    #========================================================================

    # ** C O N F I G U R A T I O N S Y S T E M ** #

    #========================================================================

    # Caterpillar Systems

    CATERPILLAR_COMPATIBLE = true # Toggle for Fukuyama's original

    SQUAD_MOVE_COMPATIBLE = false # Toggle for Near Fantastica's SBABS

    CCOA_CATER_COMPATIBLE = false # Toggle for Ccoa's Caterpillar

    TRICKSTER_CATER_COMPATIBLE = false # Toggle for Trickster's Caterpillar

     

    # Sun Specific Systems

    SUN_WARN = false # Checks for older sun systems

    SUN_ANGLE = 225 # Angle for sun-generated shadow

    SUN_OPACITY = 128 # Darkness setting for sun shadow

     

     

    #========================================================================

    # **** E N D O F C O N F I G U R A T I O N S Y S T E M **** #

    #========================================================================

     

     

     

    #==============================================================================

    # ** Game_Temp

    #------------------------------------------------------------------------------

    # This class handles temporary data that is not included with save data.

    # Refer to "$game_temp" for the instance of this class.

    #==============================================================================

     

    class Game_Temp

    #--------------------------------------------------------------------------

    # * Public Instance Variables

    #--------------------------------------------------------------------------

    attr_accessor :sun_spriteset # holds spritesets for 'sun' shadows

    end

     

     

     

    #==============================================================================

    # ** Game_Party

    #------------------------------------------------------------------------------

    # This class handles the party. It includes information on amount of gold

    # and items. Refer to "$game_party" for the instance of this class.

    #==============================================================================

     

    class Game_Party

    #--------------------------------------------------------------------------

    # * Public Instance Variables

    #--------------------------------------------------------------------------

    attr_reader :characters

    end

     

     

     

    #==============================================================================

    # ** Sprite_Sun

    #------------------------------------------------------------------------------

    # This sprite is used to position character shadows relative to map position.

    # It observes the Game_Character class and automatically changes sprite

    # conditions.

    #==============================================================================

     

    class Sprite_Sun < RPG::Sprite

    #--------------------------------------------------------------------------

    # * Public Instance Variables

    #--------------------------------------------------------------------------

    attr_accessor :character

    #--------------------------------------------------------------------------

    # * Object Initialization

    # viewport : viewport

    # character : character (Game_Character)

    # id : id

    #--------------------------------------------------------------------------

    def initialize(viewport, character = nil, id=0)

    super(viewport)

    @character = character

    params=$game_temp.sun_spriteset.sun[id]

    self_angle = SUN_ANGLE

    self_opacity = SUN_OPACITY

    self_angle = params[0] if params.size > 0

    self_opacity = params[1] if params.size > 1

    @self_angle = self_angle

    @self_opacity = self_opacity

    update

    end

    #--------------------------------------------------------------------------

    # * Frame Update

    #--------------------------------------------------------------------------

    def update

    super

    # If tile ID, file name, or hue are different from current ones

    if @tile_id != @character.tile_id or

    @character_name != @character.character_name or

    @character_hue != @character.character_hue

    # Remember tile ID, file name, and hue

    @tile_id = @character.tile_id

    @character_name = @character.character_name

    @character_hue = @character.character_hue

    # If tile ID value is valid

    if @tile_id >= 384

    self.bitmap = RPG::Cache.tile($game_map.tileset_name,

    @tile_id, @character.character_hue)

    self.src_rect.set(0, 0, 32, 32)

    self.ox = 16

    self.oy = 32

    # If tile ID value is invalid

    else

    self.bitmap = RPG::Cache.character(@character.character_name,

    @character.character_hue)

    @cw = bitmap.width / 4

    @ch = bitmap.height / 4

    self.ox = @cw / 2

    self.oy = @ch

    end

    end

    # Set visible situation

    self.visible = (not @character.transparent)

    # If graphic is character

    if @tile_id == 0

    # Set rectangular transfer

    sx = @character.pattern * @cw

    @direct = @character.direction

    if self.angle > 90 or angle < -90

    sy = ( 4 - 2) / 2 * @ch if @direct == 6

    sy = ( 6 - 2) / 2 * @ch if @direct == 4

    sy = (@character.direction - 2) / 2 * @ch if @direct != 4 and @direct != 6

    else

    sy = (@character.direction - 2) / 2 * @ch

    end

    self.src_rect.set(sx, sy, @cw, @ch)

    end

    # Set sprite coordinates

    self.x = @character.screen_x

    self.y = @character.screen_y-5

    self.z = @character.screen_z(@ch) - 1

    # Set opacity level, blend method, and bush depth

    self.opacity = @self_opacity

    self.blend_type = @character.blend_type

    self.bush_depth = @character.bush_depth

    # Animation

    if @character.animation_id != 0

    animation = $data_animations[@character.animation_id]

    animation(animation, true)

    @character.animation_id = 0

    end

    self.angle = @self_angle.to_i - 90

    self.color = Color.new(0, 0, 0)

    end

    end

     

     

     

    #==============================================================================

    # ** Sprite_Character

    #------------------------------------------------------------------------------

    # This sprite is used to display the character.It observes the Game_Character

    # class and automatically changes sprite conditions.

    #==============================================================================

     

    class Sprite_Character < RPG::Sprite

    #--------------------------------------------------------------------------

    # * Alias Listings

    #--------------------------------------------------------------------------

    alias sun_initialize initialize

    alias sun_update update

    #--------------------------------------------------------------------------

    # * Object Initialization

    # viewport : viewport

    # character : character (Game_Character)

    #--------------------------------------------------------------------------

    def initialize(viewport, character = nil)

    @character = character

    super(viewport)

    @sunlist=[]

    if character.is_a?(Game_Event) and $game_temp.sun_spriteset.sun != []

    params = XPML.XPML_read("Shadow", @character.id, 2)

    if params != nil

    for i in 0...$game_temp.sun_spriteset.sun.size

    @sunlist.push(Sprite_Sun.new(viewport, @character, i))

    end

    end

    end

    if character.is_a?(Game_Player) and $game_temp.sun_spriteset.sun != []

    for i in 0...$game_temp.sun_spriteset.sun.size

    @sunlist.push(Sprite_Sun.new(viewport, $game_player, i))

    end

    #===================================================

    # * Compatibility with Caterpillar Functions

    #===================================================

    if CATERPILLAR_COMPATIBLE and $game_party.characters != nil

    for member in $game_party.characters

    for i in 0...$game_temp.sun_spriteset.sun.size

    @sunlist.push(Sprite_Sun.new(viewport, member, i))

    end

    end

    end

    if SQUAD_MOVE_COMPATIBLE and $game_allies.values != nil

    for member in $game_allies.values

    for i in 0...$game_temp.sun_spriteset.sun.size

    @sunlist.push(Sprite_Sun.new(viewport, member, i))

    end

    end

    end

    if CCOA_CATER_COMPATIBLE and $game_train.actors != nil

    for member in $game_train.actors

    for i in 0...$game_temp.sun_spriteset.sun.size

    @sunlist.push(Sprite_Sun.new(viewport, member, i))

    end

    end

    end

    if TRICKSTER_CATER_COMPATIBLE and $game_party.followers != nil

    for member in $game_party.followers

    for i in 0...$game_temp.sun_spriteset.sun.size

    @sunlist.push(Sprite_Sun.new(viewport, member, i))

    end

    end

    end

    #===================================================

    # ** End of the compatibility

    #===================================================

    end

    # Perform the original call

    sun_initialize(viewport, @character)

    end

    #--------------------------------------------------------------------------

    # * Frame Update

    #--------------------------------------------------------------------------

    def update

    sun_update

    if @sunlist != []

    for i in 0...@sunlist.size

    @sunlist.update

    end

    end

    end

    end

     

     

     

    #==============================================================================

    # ** Game_Event

    #------------------------------------------------------------------------------

    # This class deals with events. It handles functions including event page

    # switching via condition determinants, and running parallel process events.

    # It's used within the Game_Map class.

    #==============================================================================

     

    class Game_Event < Game_Character

    #--------------------------------------------------------------------------

    # * Public Instance Variables

    #--------------------------------------------------------------------------

    attr_accessor :id

    end

     

     

     

    #==============================================================================

    # ** Spriteset_Map

    #------------------------------------------------------------------------------

    # This class brings together map screen sprites, tilemaps, etc.

    # It's used within the Scene_Map class.

    #==============================================================================

     

    class Spriteset_Map

    #--------------------------------------------------------------------------

    # * Public Instance Variables

    #--------------------------------------------------------------------------

    attr_accessor :sun

    #--------------------------------------------------------------------------

    # * Alias Listings

    #--------------------------------------------------------------------------

    alias sun_initialize initialize

    #--------------------------------------------------------------------------

    # * Object Initialization

    #--------------------------------------------------------------------------

    def initialize

    @sun = []

    $game_temp.sun_spriteset = self

    warn = false

    for k in $game_map.events.keys.sort

    if ($game_map.events[k].list != nil and

    $game_map.events[k].list[0].code == 108 and

    ($game_map.events[k].list[0].parameters == ["sun"] or

    $game_map.events[k].list[0].parameters == ["o"]))

    warn = true

    end

    params = XPML.XPML_read("Sun", k, 2)

    $game_temp.sun_spriteset.sun.push(params) if params != nil

    end

    if warn == true and SUN_WARN

    p "Warning : At least one event on this map uses an obsolete way to add a sun effect"

    end

    # Perform the original call

    sun_initialize

    end

    end

     

     

    #==============================================================================

    # ** module XPML

    #------------------------------------------------------------------------------

    # This module handles the reading and passing of 'comment' parameters

    #

    # The main XPML method is used to check and read event comments.

    # * It returns 'nil' if the markup 'check' text isn't even present.

    # * It returns [] if no parameters are passed

    # * It returns a parameter list with "int" converted as int.

    # eg :

    # begin first

    # begin second

    # param1 1

    # param2 two

    # begin third

    # anything 3

    #

    # p XPML_read("first", event_id) -> []

    # p XPML_read("second", event_id) -> [1,"two"]

    # p XPML_read("third", event_id) -> [3]

    # p XPML_read("forth", event_id) -> nil

    #===================================================

     

    module XPML

    module_function

    #--------------------------------------------------------------------------

    # * XPML_read

    # markup : text in event comment to check

    # event_id : event ID

    # max_param_number : maximum number of parameter/comments to load

    #--------------------------------------------------------------------------

    def XPML_read(markup, event_id, max_param_number = 0)

    parameter_list = nil

    event = $game_map.events[event_id]

    return if event.list == nil

    for i in 0...event.list.size

    if event.list.code == 108 and

    event.list.parameters[0].downcase == "begin " + markup.downcase

    parameter_list = [] if parameter_list == nil

    for j in i + 1...event.list.size

    if event.list[j].code == 108

    parts = event.list[j].parameters[0].split

    if parts.size != 1 and parts[0].downcase != "begin"

    if parts[1].to_i != 0 or parts[1] == "0"

    parameter_list.push(parts[1].to_i)

    else

    parameter_list.push(parts[1])

    end

    else

    return parameter_list

    end

    else

    return parameter_list

    end

    if max_param_number != 0 and j == i + max_param_number

    return parameter_list

    end

    end

    end

    end

    return parameter_list

    end

    end

     

  6. Se scorrete il topic, troverete altre due o tre persone che hanno avuto lo stesso problema... mi sembra strano che sia dovuto sempre a modifiche delle classi di base... comunque proverò a sostituire la classe Game_Enemy con quella di un progetto vergine e vedo se risolvo qualcosa. Grazie a tutti cmq.
  7. Appena sblocco il primo nemico abbattendolo, aprendo la voce di quest'ultimo nel bestiario il gioco da errore e crasha...

    Lo script l'ho copiato così com' è, senza modificarlo. E l'errore non è nello script del bestiario, ma nella classe Game_Enemy...

  8. A me lo script va benissimo così, anzi è perfetto. Il problema è che mi da errore alla linea 19, come ad altri prima di me.

     

    C'è qualcosa che non va con il enemy_id. Qualcuno saprebbe darmi una mano?

  9. Il problema, invece, è proprio quel '>', altrimenti perchè cancellando completamente lo script e rimettendolo copiato dal forum mi da lo stesso errore? Conflitto con altri script? Inoltre, che metodo sarebbe '>'? Non è un operatore? E' come se a un certo punto mi dicesse

    "undefined method '+'. Non ha senso, secondo me, ma io ne so poco di script, a dire il vero, e ho capito che la logica centra poco... infatti mettendo l'uguale, la scharmata parte, invece di darmi subito errore, ma me lo da poco dopo quando seleziono pg da una lista vuota (cosa che già di per se è assurda) dicendo giustamente che ho eseguito una divisione per zero. Non ho ancora aggiunto le parti di codice postate da Macgiver stavolta, perciò il problema è tutto nella classe LittleArrow di Sylaer. Che fare? Sto decisamente impazzendo. E' assurdo che solo a me non funzioni, come posso trovare una soluzione se il problema non esiste? Se mi dici che a te quella riga non da errore, mi trovo completamente disarmato.

    Comunque grazie per tutti gli aiuti con le altre questioni da nabbo che ho postato in giro per il forum XD

  10. Scusate il doppio post ma ho un altro problema. Lo script mi da quest'errore alla riga 41:

     

    Script 'Cambio Party? line 41: NoMethodError occured

    undefined method '>' for nil:NilClass

     

    Lo script è quello di Sylaer con le aggiunte proposte da Makgiver. Siccome mi era sempre andato quando avevo tutti i pg disponibili, la cosa mi ha lasciato un po di stucco...ma forse non c'entra niente, non so. Sinceramente davanti a un errore del genere non so che fare. Grazie a chi mi darà una mano XD

  11. Vorrei chiedere una cosa... è possibile usare lo script due volte, cioè duplicandolo?

    Insomma, avevo in mente per il mio progetto di creare due diari: in ognuno deve esserci un testo diverso, quindi non devono attigere entrambi alla stessa cartella. Perciò ho creato una nuova classe e vi ho copiato un duplicato dello stesso script, ho modificato il percorso che dovrebbe usare per attingere alle pagine ma i due diari continuano a prendere entrambi il testo dalla cartella Diary (nonostante io abbia creato la cartella alternativa in data). Per far capire meglio, posto lo script che ho modificato:

     

     

    =begin

     

    --------------------------------------------------------------------------

    Scipt Diario

     

    ################################################

    ##Creato da Sylaer###### Modificato da Andre4e##

    ################################################

     

     

     

    Per richiamare il diario

    usare il chiama script tramite evento e inserire

    questo codice :

     

    $scene = Scene_Diary.new(true)

     

     

    --------------------------------------------------------------------------

     

    Instruzioni per inserire il diario nel menu:

    Per prima cosa bisogna modificare il menu in modo che visualizzi il diario:

     

    1)Aprire il Scene_Menu e trovare una serie sN = "Qualche cosa" es.

    s6 = "Esci dal Gioco" e mettere sotto questi elementi un'altro elemento

    con scritto s e accanto il numero successivo all'ultimo visulizzato es.

    nel mio caso sarà s7 = "Diario".

     

    2)Modificare la linea sottostante vale dire:

    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])

    con questa:

    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s7, s6])

    Cioè mettere il Diario al penultimo posto del menu.

     

    3)In fondo al Scene_Menu c'è il def update con una serie di when

    l'ultimo dovrebbe essere when 5, di solito è così, va sostituito con when 6

    sotto a questo mettete:

    when 5

    $game_system.se_play($data_system.decision_se)

    $scene = Scene_Diary.new

    e sotto a questo dovrebbe esserci un end.

     

    E' inoltre possibile impostare il gioco in modo che il diario sia chiamato da

    un evento comune basta inserire questo nel call script:

     

    $scene = Scene_Diary.new(true)

     

    In questo modo è possibile richiamare il diario anche da oggetto.

    --------------------------------------------------------------------------

    Ora veniamo a come funziona:

    In breve nel diario viene scritto tutto quello che si trova nei file delle

    pagine presenti nella cartella di gioco Data\Diary\. Questo significa che

    per funzionare il diario ha bisogno della cartella. Quindi creala.

    Per qunato riguarda le pagine basta specificare il numero di pagine

    che si vuole qui:

    =end

    NUM_DIARY_PAGES = 100

    =begin

    Ora avvia il gioco una volta e richiama il diario. Si può notare che è vuoto

    ma ha esattamente le pagine indicate(Per cambiare pagina i tasti sono

    ovviamente le frecce direzionali sinistra e destra).

    Adesso nella cartella Diary su Data ci saranno un numero di file pari al

    numero di pagine indicate.

    E' sufficente aprire questi file con un editor di testo e modificare il

    contenuto per osservare i risultati.

    Sul diario viene mostrato ciò che è scritto in questi file, lettera per

    lettara, tuttavia le lettere accentate non vengono riconosciute.

    --------------------------------------------------------------------------

    Ci sono poi una serie di funzioni che è possibile utilizzare.

    Funzioni del testo:

    1)/[N] Se inserite questo nel testo del Diary con N il numero di una switch

    la righa a cui è asseggnata non verrà visualizzata se la switch è impostata

    su off, IMPORTANTE: la / va PER FORZA messa come primo carattere della riga.

     

    2)/K[N] Come sopra solo che se mettete il valore K ad un numero maggiore di 1

    la condizione di visualizzazzione verrà estesa alle K-1 righe succssive.

     

    3)Se inserite [t] oppure [T] si inserirà nel testo una tabulazione " ".

    --------------------------------------------------------------------------

    Si può specificare il font e la grandezza di esso con queste righe:

    =end

    DIARY_FONT = "Monotype Corsiva"

    DIARY_FONT_SIZE = 22

    =begin

    Alcune funzioni sono le stesse dei messaggi:

    - \c[N] Imposta il colore della linea ad uno degli 8 colori

    predefiniti(1-7).

    - \v[N] Mostra il valore della variabile N nel punto in cui è inserita.

    - \n[N] Mostra il nome dell'eroe N.

     

    *************************************************

    Funzioni aggiunte da Andre4e:

    **************

    - \t Cambiare Font(Permanente)

    Se il carattere è formato da più di una parola scriverlo così:

    es: \t[Times New Roman] e non \t[TimesNewRoman]

    **************

    - \f[Nome grafica] Visualizzare un'immagine

    della cartella progetto/graphics/pictures

    La stringa corretta per visualizzare un'immagine è

    \x[X] \y[Y] \f[Nome grafica]

     

    X = coordinata x....se non viene inserito x

    default è 0

    Y = coordinata y....se non viene inserito x

    default è 0

    Nome grafica = nome dell'immagine da visualizzare

    Il file deve essere .png

    Le immagini posso avvere una dimensione massima

    di 96 x 96.. x modificare questo paramentro

    cercare la riga:

    self.contents.blt(@x, @y, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))

    e Modificare il due numeri in fondo

    *************************************************

     

    Se volete commentare qualcosa tutto quello dopo il carattere # non verrà

    visualizzato, almeno per quella linea.

     

    Infine se si esce e si rientra dalla finestra del diario le pagine visualizzate

    sono le stesse, cioè viene memorizzata la posizione nel diario.

     

    Questo è tutto. Spero che vi piaccia.

    =end

     

    # ---------------------------------

    # Little_Arrow class

    # ---------------------------------

    class Little_Arrow < Sprite

     

    def initialize(viewport,mirror = false)

    super(viewport)

    self.bitmap = RPG::Cache.picture("arrow1")

    self.ox = 0

    self.oy = 0

    self.z = 250

    self.mirror = mirror

    end

    end

     

    # ---------------------------------

    # Window_DiaryPage class

    # ---------------------------------

     

    class Window_DiaryPage < Window_Base

     

    def initialize(page)

     

    @page = page

     

    if @page % 2 == 1

    super(64,32,320-64,480-64)

    else

    super(320+16,32,320-64,480-64)

    end

    self.contents = Bitmap.new(width - 32, height - 32)

    self.opacity = 0

    self.contents.font.name = DIARY_FONT

    self.contents.font.size = DIARY_FONT_SIZE

    self.contents.font.color = Color.new(0,0,0)

     

     

    refresh unless @page == 0

    end

     

    def refresh

     

    file = File.open("Data/Registro/Page" + @page.to_s + ".rxdata","a")

    file.close

    file = File.open("Data/Registro/Page" + @page.to_s + ".rxdata")

    str = file.readlines

     

     

     

     

     

    y = 0

    k_lines = 0

    k_switch = 0

    pace = self.contents.font.size

    for i in 0..str.size-1

    color = 8

     

    str.gsub!(/\\[Cc]\[([0-9]+)\]/) do

    color = $1.to_i

    str.sub!(/\\[Cc]olor\[([0-9]+)\]/){ "" }

    end

     

     

    str.gsub!(/#/) do

    str.gsub!(/./m,"")

     

    end

     

     

     

    @x = 0

    str.gsub!(/\\[xX]\[([0-9]+)\]/)do

    @x = $1.to_i

    str.sub!(/\\[xX]co\[([0-9]+)\]/){ "" }

    end

     

    @y = 0

    str.gsub!(/\\[yY]\[([0-9]+)\]/)do

    @y = $1.to_i

    str.sub!(/\\[yY]co\[([0-9]+)\]/){ "" }

    end

     

     

    str.gsub!(/\\[Ff]\[(.+?)\]/)do

    @face_file = $1.to_s + ".png"

    # @x = @face_indent = 128

    if FileTest.exist?("Graphics/Pictures/" + $1.to_s + ".png")

     

    self.contents.blt(@x, @y, RPG::Cache.picture(@face_file), Rect.new(0, 0, 96, 96))

    end

    # @str.gsub!(/\\[Ff]\[(.*?)\]/) { "" }

    #end

    #end

    end

    str.gsub(/\\[Tt]\[(.*?)\]/) do

    font = $1.to_s

    self.contents.font.name = font

    str.sub!(/\\[Tt]\[(.*?)\]/) { "" }

    end

     

     

     

    str.gsub!(/\[[Tt]\]/) { " " }

    str.gsub!(/\\[Vv]\[([0-9]+)\]/) { $game_variables[$1.to_i] }

     

     

     

     

     

     

    str.gsub!(/\\[Nn]\[([0-9]+)\]/) do

    $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""

    end

    if k_lines > 1

    if $game_switches[k_switch]

    set_text(y,str,color)

    y+=pace

    end

    k_lines -=1

    elsif str.index("/")==0

    if str.index(/[0-9]/)==1

    str.sub!(/([0-9]+)/, "")

    k_lines = $1.to_i

    end

    str.sub!(/\[([0-9]+)\]/, "")

    str.slice!(0)

    switch = $1.to_i

    k_switch = switch if k_lines > 0

    if $game_switches[switch]

    set_text(y,str,color)

    y+=pace

    end

    else

    set_text(y,str,color)

    y+=pace

    end

    end

    file.close

    if @page % 2 == 1

    self.contents.font.color = Color.new(0,0,0)

    self.contents.draw_text(0,320+32, self.width-32, 32, @page.to_s,2)

    else

    self.contents.font.color = Color.new(0,0,0)

    self.contents.draw_text(0,320+32, self.width-32, 32, @page.to_s)

    end

    end

     

    def set_text(y,text,color)

    if color == 8

    self.contents.font.color = Color.new(0,0,0)

    else

    self.contents.font.color = text_color(color)

    end

     

    x = 0

    while ((c = text.slice!(/./)) != nil)#/./m

    if c == 97

    p "ciao"

    end

     

    self.contents.draw_text(4 + x, y, 40, 32, c)

    x += self.contents.text_size©.width

    end

    end

    end

     

    # ---------------------------------

    # Game_Temp class

    # ---------------------------------

    class Game_Temp

    attr_accessor :diary1_current_page

    alias sylaer_diary1_temp_initialize initialize

    def initialize

    @diary1_current_page = 1

    sylaer_diary1_temp_initialize

    end

    end

    # ---------------------------------

    # Scene_Diary class

    # ---------------------------------

    class Scene_Diary1

    def initialize(no_menu_call = false)

    @no_menu_call = no_menu_call

    @current_page = $game_temp.diary1_current_page

    end

    def main

    create_arrow

    @pages = []

    @pages[0] = Window_DiaryPage.new(@current_page)

    if @current_page + 1 > NUM_DIARY_PAGES

    @pages[1] = Window_DiaryPage.new(0)

    else

    @pages[1] = Window_DiaryPage.new(@current_page + 1)

    end

    Graphics.transition

    loop do

    Graphics.update

    Input.update

    update

    if $scene != self

    break

    end

    end

    Graphics.freeze

    @pages[0].dispose

    @pages[1].dispose

    @left_arrow.dispose

    @right_arrow.dispose

    @back_drop.dispose

    end

    def create_arrow

    viewport = Viewport.new(0, 0, 640, 480)

    viewport.z = 3000

    @left_arrow = Little_Arrow.new(viewport)

    @left_arrow.x = 64

    @left_arrow.y = 424

    @left_arrow.visible = false

    @right_arrow = Little_Arrow.new(viewport,true)

    @right_arrow.x = 640 - 100

    @right_arrow.y = 424

    @right_arrow.visible = false

    back_drop_viewport = Viewport.new(0, 0, 640, 480)

    back_drop_viewport.z = 1

    @back_drop = Sprite.new(back_drop_viewport)

    @back_drop.bitmap = RPG::Cache.picture("Backdrop")

    end

    def update

    $game_temp.diary1_current_page = @current_page

    if Input.trigger?(Input::B)

    $game_system.se_play($data_system.cancel_se)

    if @no_menu_call == false

    $scene = Scene_Menu.new(6)

    else

    $scene = Scene_Map.new

    end

    end

    if @current_page + 1 < NUM_DIARY_PAGES

    if Input.trigger?(Input::RIGHT)

    Audio.se_play("Audio/SE/046-Book01")

    @current_page += 2

    @pages[0].dispose

    @pages[1].dispose

    @pages[0] = Window_DiaryPage.new(@current_page)

    if @current_page + 1 > NUM_DIARY_PAGES

    @pages[1] = Window_DiaryPage.new(0)

    else

    @pages[1] = Window_DiaryPage.new(@current_page + 1)

    end

    end

    @right_arrow.visible = true

    else

    @right_arrow.visible = false

    end

    if @current_page > 1

    if Input.trigger?(Input::LEFT)

    Audio.se_play("Audio/SE/046-Book01")

    @current_page -= 2

    @pages[0].dispose

    @pages[1].dispose

    @pages[0] = Window_DiaryPage.new(@current_page)

    @pages[1] = Window_DiaryPage.new(@current_page + 1)

    end

    @left_arrow.visible = true

    else

    @left_arrow.visible = false

    end

    end

    end

     

     

     

     

    Come si vede, alla riga 167 il nome della cartella d'origine è modificato. Ho sbagliato tutto o è possibile salvare la situazione? XD

    Grazie a chi mi darà una mano.

  12. Chiedo aiuto XD Ho usato questo menu ad anello nel mio progetto, con l'intenzione di aggiungere dei comandi per degli script che volevo implementare.Ho dapprima aggiunto il bestiario, ed ha funzionato, ma poi aggiungendo il "diario di viaggio"

    di Sylaer modificato da Andre4e, ho riscontrato un errore credo a livello delle variabili. Il problema sta nel menù, non nello script. Questo è l'errore che mi da:

     

    Script 'Menu' line 353 TypeError Occured.

    cannot convert String into Integer

     

    Ho percorso lo script in lungo e in largo, ma le mie scarze competenza non mi hanno permesso di arrivarci per intuito, per quanto mi sia scervellato. Ho ripetuto gli stessi identici passaggi usati per aggiungere il comando del bestiario, che funzionava benissimo. Possibile?

    Ecco lo script:

     

     

    #===================================================

    # ¦ Ring Menu - Show Player Location - Release #1 (Enhanced By Dubealex)

    #===================================================

    # For more infos and update, visit:

    # asylum.dubealex.com

    #

    # Original Ring Menu by: ?? (From XRXS)

    # Original Edit and Fix by: Maki

    # Show Player Location Version by: Dubealex

    #

    # You can customize this script at line #35 - Have fun !!

    # If you want to show more stuff, its easy to do, you can try to ask in the forum.

    #

    # alex@dubealex.com

    #===================================================

     

     

    #===================================================

    # ? CLASS Scene_Menu Begins

    #===================================================

     

    class Scene_Menu

    #--------------------------------------------------------------------------

    # œ ƒIƒuƒWƒFƒNƒg‰Šú‰»

    # menu_index : ƒRƒ}ƒ“ƒh‚̃J[ƒ\ƒ‹‰ŠúˆÊ’u

    #--------------------------------------------------------------------------

    def initialize(menu_index = 0)

    @menu_index = menu_index

    $location_text=[]

    $window_size=[]

    $ring_menu_text=[]

    $chara_select=[]

    @window_opacity=[]

    @chara_select=[]

    @window_position=[]

     

    #--------------------------------------------------------------------------------------------------

    # ¦ Ring Menu Customization Section: (By Dubealex)

    #--------------------------------------------------------------------------------------------------

    # Those variables defines how the script will act.

    # Simply change the value by those you want.

    # Remember that changing the font size has its limitation due to text space allocation.

    #

    # ? TEXT SETTINGS FOR SHOW PLAYER LOCATION WINDOW:

    $location_text[0]="Arial" # Font Type

    $location_text[1]=25 # Font Size

    $location_text[2]=6 # Location Title Color

    $location_text[4]=0 # Map Name Color

    $location_text[3]="Locazione" # Customize the "Location" Title Text

     

    # ? SHOW LOCATION WINDOW SETTINS:

    @show_location_window=true #Set to false to not use it !

    @window_opacity[0]=255 # Border Opacity

    @window_opacity[1]=255 # Background Opacity

    $window_location_skin="brown" # Window Skin

    @window_position[0]=400 # X Axis Position

    @window_position[1]=20 # Y Axis Position

    $window_size[0]=250 # Lengh

    $window_size[1]=96 # Heigh

     

    # ? TEXT SETTINGS FOR INSIDE THE RING MENU:

    $ring_menu_text[0]="Papyrus" # Font Type

    $ring_menu_text[7]=0 # Font Color

    $ring_menu_text[8]=22 # Font Size

    $ring_menu_text[1]="Inventario" # Items Menu Text

    $ring_menu_text[2]="Abilità" # Skills Menu Text

    $ring_menu_text[3]="Equipaggia" # Equip Menu Text

    $ring_menu_text[4]="Caratteristiche"# Stats Menu Text

    $ring_menu_text[5]="Gruppo" # Save Menu Text

    $ring_menu_text[6]="Esci" # Quit Menu Text

    $ring_menu_text[7]="Carriera"

    $ring_menu_text[8]="Diario di Viaggio"

     

    # ? CHARACTER SELECTION WINDOW SETTINGS :

    @chara_select[0]=400 # X Axis Position

    @chara_select[1]=0 # Y Axis Position

    $chara_select[0]="Papyrus" # Font Type

    $chara_select[1]=0 # Font Color

    $chara_select[5]=22 # Font Size

    $chara_select[2]=255 # Window Border Opacity

    $chara_select[3]=255 # Window Background Opacity

    $chara_select[4]="brown" # Window Skin to use

    #--------------------------------------------------------------------------------------------------

     

    end

    #--------------------------------------------------------------------------

    # œ ƒƒCƒ“ˆ—

    #--------------------------------------------------------------------------

    def main

     

    # Show Player Location Feature:

    if @show_location_window==true

    @window_location = Window_Location.new

    @window_location.x = @window_position[0]

    @window_location.y = @window_position[1]

    @window_location.opacity = @window_opacity[0]

    @window_location.back_opacity = @window_opacity[1]

    end

    #End of Show Player Location

     

    # ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ðì¬

    @spriteset = Spriteset_Map.new

    # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðì¬

    px = $game_player.screen_x - 15

    py = $game_player.screen_y - 24

    @command_window = Window_RingMenu.new(px,py)

    @command_window.index = @menu_index

    # ƒp[ƒeƒBl”‚ª 0 l‚Ìê‡

    if $game_party.actors.size == 0

    # ƒAƒCƒeƒ€AƒXƒLƒ‹A‘•”õAƒXƒe[ƒ^ƒX‚𖳌ø‰»

    @command_window.disable_item(0)

    @command_window.disable_item(1)

    @command_window.disable_item(2)

    @command_window.disable_item(3)

    end

    @command_window.z = 100

    # ƒZ[ƒu‹ÖŽ~‚Ìê‡

    if $game_system.save_disabled

    # ƒZ[ƒu‚𖳌ø‚É‚·‚é

    @command_window.disable_item(4)

    end

    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðì¬

    @status_window = Window_RingMenuStatus.new

    @status_window.x = @chara_select[0]

    @status_window.y = @chara_select[1]

    @status_window.z = 200

    @status_window.opacity=$chara_select[2]

    @status_window.back_opacity=$chara_select[3]

    @status_window.visible = false

    # ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“ŽÀs

    Graphics.transition

    # ƒƒCƒ“ƒ‹[ƒv

    loop do

    # ƒQ[ƒ€‰æ–Ê‚ðXV

    Graphics.update

    # “ü—Íî•ñ‚ðXV

    Input.update

    # ƒtƒŒ[ƒ€XV

    update

    # ‰æ–Ê‚ªØ‚è‘Ö‚í‚Á‚½‚烋[ƒv‚ð’†’f

    if $scene != self

    break

    end

    end

    # ƒgƒ‰ƒ“ƒWƒVƒ‡ƒ“€”õ

    Graphics.freeze

    # ƒXƒvƒ‰ƒCƒgƒZƒbƒg‚ð‰ð•ú

    @spriteset.dispose

    # ƒEƒBƒ“ƒhƒE‚ð‰ð•ú

    if @show_location_window==true

    @window_location.dispose

    end

    @command_window.dispose

    @status_window.dispose

    end

    #--------------------------------------------------------------------------

    # œ ƒtƒŒ[ƒ€XV

    #--------------------------------------------------------------------------

    def update

    # ƒEƒBƒ“ƒhƒE‚ðXV

    if @show_location_window==true

    @window_location.update

    end

    @command_window.update

    @status_window.update

    # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_command ‚ðŒÄ‚Ô

    if @command_window.active

    update_command

    return

    end

    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡: update_status ‚ðŒÄ‚Ô

    if @status_window.active

    update_status

    return

    end

    end

    #--------------------------------------------------------------------------

    # œ ƒtƒŒ[ƒ€XV (ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)

    #--------------------------------------------------------------------------

    def update_command

    # B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡

    if Input.trigger?(Input::B)

    # ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t

    $game_system.se_play($data_system.cancel_se)

    # ƒ}ƒbƒv‰æ–Ê‚ÉØ‚è‘Ö‚¦

    $scene = Scene_Map.new

    return

    end

    # C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡

    if Input.trigger?(Input::C)

    # ƒp[ƒeƒBl”‚ª 0 l‚ÅAƒZ[ƒuAƒQ[ƒ€I—¹ˆÈŠO‚̃Rƒ}ƒ“ƒh‚Ìê‡

    if $game_party.actors.size == 0 and @command_window.index < 4

    # ƒuƒU[ SE ‚ð‰‰‘t

    $game_system.se_play($data_system.buzzer_se)

    return

    end

    # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò

    case @command_window.index

    when 0 # ƒAƒCƒeƒ€

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ƒAƒCƒeƒ€‰æ–Ê‚ÉØ‚è‘Ö‚¦

    $scene = Scene_Item.new

    when 1 # ƒXƒLƒ‹

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é

    @command_window.active = false

    @status_window.active = true

    @status_window.visible = true

    @status_window.index = 0

    when 2 # ‘•”õ

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é

    @command_window.active = false

    @status_window.active = true

    @status_window.visible = true

    @status_window.index = 0

    when 3 # ƒXƒe[ƒ^ƒX

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é

    @command_window.active = false

    @status_window.active = true

    @status_window.visible = true

    @status_window.index = 0

    when 4 # ƒZ[ƒu

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ƒZ[ƒu‰æ–Ê‚ÉØ‚è‘Ö‚¦

    $scene = Party_Switcher.new([1,2,3,4,5,6,7,8],[1])

    when 5 # ƒQ[ƒ€I—¹

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ƒQ[ƒ€I—¹‰æ–Ê‚ÉØ‚è‘Ö‚¦

    $scene = Scene_End.new

    when 6 # ƒQ[ƒ€I—¹

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ƒQ[ƒ€I—¹‰æ–Ê‚ÉØ‚è‘Ö‚¦

    $scene = Scene_MonsterBook.new

    when 7 # ƒQ[ƒ€I—¹

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ƒQ[ƒ€I—¹‰æ–Ê‚ÉØ‚è‘Ö‚¦

    $scene = Scene_Diary.new

    end

    return

    end

    # ƒAƒjƒ[ƒVƒ‡ƒ“’†‚È‚çƒJ[ƒ\ƒ‹‚̈—‚ðs‚í‚È‚¢

    return if @command_window.animation?

    # ªor© ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡

    if Input.press?(Input::UP) or Input.press?(Input::LEFT)

    $game_system.se_play($data_system.cursor_se)

    @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)

    return

    end

    # «or¨ ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡

    if Input.press?(Input::DOWN) or Input.press?(Input::RIGHT)

    $game_system.se_play($data_system.cursor_se)

    @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)

    return

    end

    end

    #--------------------------------------------------------------------------

    # œ ƒtƒŒ[ƒ€XV (ƒXƒe[ƒ^ƒXƒEƒBƒ“ƒhƒE‚ªƒAƒNƒeƒBƒu‚Ìê‡)

    #--------------------------------------------------------------------------

    def update_status

    # B ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡

    if Input.trigger?(Input::B)

    # ƒLƒƒƒ“ƒZƒ‹ SE ‚ð‰‰‘t

    $game_system.se_play($data_system.cancel_se)

    # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚ðƒAƒNƒeƒBƒu‚É‚·‚é

    @command_window.active = true

    @status_window.active = false

    @status_window.visible = false

    @status_window.index = -1

    return

    end

    # C ƒ{ƒ^ƒ“‚ª‰Ÿ‚³‚ꂽê‡

    if Input.trigger?(Input::C)

    # ƒRƒ}ƒ“ƒhƒEƒBƒ“ƒhƒE‚̃J[ƒ\ƒ‹ˆÊ’u‚Å•ªŠò

    case @command_window.index

    when 1 # ƒXƒLƒ‹

    # ‚±‚̃AƒNƒ^[‚Ìs“®§ŒÀ‚ª 2 ˆÈã‚Ìê‡

    if $game_party.actors[@status_window.index].restriction >= 2

    # ƒuƒU[ SE ‚ð‰‰‘t

    $game_system.se_play($data_system.buzzer_se)

    return

    end

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ƒXƒLƒ‹‰æ–Ê‚ÉØ‚è‘Ö‚¦

    $scene = Scene_Skill.new(@status_window.index)

    when 2 # ‘•”õ

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ‘•”õ‰æ–Ê‚ÉØ‚è‘Ö‚¦

    $scene = Scene_Equip.new(@status_window.index)

    when 3 # ƒXƒe[ƒ^ƒX

    # Œˆ’è SE ‚ð‰‰‘t

    $game_system.se_play($data_system.decision_se)

    # ƒXƒe[ƒ^ƒX‰æ–Ê‚ÉØ‚è‘Ö‚¦

    $scene = Scene_Status.new(@status_window.index)

    end

    return

    end

    end

    end

     

    #===================================================

    # ? CLASS Scene_Menu Ends

    #===================================================

     

     

    #===================================================

    # ? CLASS Window_RingMenu Begins

    #===================================================

    class Window_RingMenu < Window_Base

    #--------------------------------------------------------------------------

    # › ƒNƒ‰ƒX’è”

    #--------------------------------------------------------------------------

    STARTUP_FRAMES = 20

    MOVING_FRAMES = 2

    RING_R = 100

    ICON_ITEM = RPG::Cache.icon("034-Item03")

    ICON_SKILL = RPG::Cache.icon("044-Skill01")

    ICON_EQUIP = RPG::Cache.icon("001-Weapon01")

    ICON_STATUS = RPG::Cache.icon("050-Skill07")

    ICON_SAVE = RPG::Cache.icon("038-Item07")

    ICON_EXIT = RPG::Cache.icon("046-Skill03")

    ICON_BESTIA = RPG::Cache.icon("Techs")

    ICON_DIARIO = RPG::Cache.icon("Book-icon1")

    ICON_DISABLE= RPG::Cache.icon("")

    SE_STARTUP = "094-Attack06"

    MODE_START = 1

    MODE_WAIT = 2

    MODE_MOVER = 3

    MODE_MOVEL = 4

    #--------------------------------------------------------------------------

    # › ƒAƒNƒZƒT

    #--------------------------------------------------------------------------

    attr_accessor :index

    #--------------------------------------------------------------------------

    # œ ƒIƒuƒWƒFƒNƒg‰Šú‰»

    #--------------------------------------------------------------------------

    def initialize( center_x, center_y )

    super(0, 0, 640, 480)

    self.contents = Bitmap.new(width-32, height-32)

    self.contents.font.name = $ring_menu_text[0]

    self.contents.font.color = text_color($ring_menu_text[7])

    self.contents.font.size = $ring_menu_text[8]

    self.opacity = 0

    self.back_opacity = 0

    s1 = $ring_menu_text[1]

    s2 = $ring_menu_text[2]

    s3 = $ring_menu_text[3]

    s4 = $ring_menu_text[4]

    s5 = $ring_menu_text[5]

    s6 = $ring_menu_text[6]

    s7 = $ring_menu_text[7]

    s8 = $ring_menu_text[8]

    @commands = [ s1, s2, s3, s4, s5, s6, s7, s8 ]

    @item_max = 8

    @index = 0

    @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT, ICON_BESTIA, ICON_DIARIO]

    @disabled = [ false, false, false, false, false, false, false, false ]

    @cx = center_x - 16

    @cy = center_y - 16

    setup_move_start

    refresh

    end

    #--------------------------------------------------------------------------

    # œ ƒtƒŒ[ƒ€XV

    #--------------------------------------------------------------------------

    def update

    super

    refresh

    end

    #--------------------------------------------------------------------------

    # œ ‰æ–ÊÄ•`‰æ

    #--------------------------------------------------------------------------

    def refresh

    self.contents.clear

    # ƒAƒCƒRƒ“‚ð•`‰æ

    case @mode

    when MODE_START

    refresh_start

    when MODE_WAIT

    refresh_wait

    when MODE_MOVER

    refresh_move(1)

    when MODE_MOVEL

    refresh_move(0)

    end

    # ƒAƒNƒeƒBƒu‚ȃRƒ}ƒ“ƒh–¼•\ަ

    rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32)

    self.contents.draw_text(rect, @commands[@index],1)

    end

    #--------------------------------------------------------------------------

    # › ‰æ–ÊÄ•`‰æ(‰Šú‰»Žž)

    #--------------------------------------------------------------------------

    def refresh_start

    d1 = 2.0 * Math::PI / @item_max

    d2 = 1.0 * Math::PI / STARTUP_FRAMES

    r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES

    for i in 0...@item_max

    j = i - @index

    d = d1 * j + d2 * @steps

    x = @cx + ( r * Math.sin( d ) ).to_i

    y = @cy - ( r * Math.cos( d ) ).to_i

    draw_item(x, y, i)

    end

    @steps -= 1

    if @steps < 1

    @mode = MODE_WAIT

    end

    end

    #--------------------------------------------------------------------------

    # › ‰æ–ÊÄ•`‰æ(‘Ò‹@Žž)

    #--------------------------------------------------------------------------

    def refresh_wait

    d = 2.0 * Math::PI / @item_max

    for i in 0...@item_max

    j = i - @index

    x = @cx + ( RING_R * Math.sin( d * j ) ).to_i

    y = @cy - ( RING_R * Math.cos( d * j ) ).to_i

    draw_item(x, y, i)

    end

    end

    #--------------------------------------------------------------------------

    # › ‰æ–ÊÄ•`‰æ(‰ñ“]Žž)

    # mode : 0=”½ŽžŒv‰ñ‚è 1=ŽžŒv‰ñ‚è

    #--------------------------------------------------------------------------

    def refresh_move( mode )

    d1 = 2.0 * Math::PI / @item_max

    d2 = d1 / MOVING_FRAMES

    d2 *= -1 if mode != 0

    for i in 0...@item_max

    j = i - @index

    d = d1 * j + d2 * @steps

    x = @cx + ( RING_R * Math.sin( d ) ).to_i

    y = @cy - ( RING_R * Math.cos( d ) ).to_i

    draw_item(x, y, i)

    end

    @steps -= 1

    if @steps < 1

    @mode = MODE_WAIT

    end

    end

    #--------------------------------------------------------------------------

    # œ €–Ú‚Ì•`‰æ

    # x :

    # y :

    # i : €–Ú”Ô†

    #--------------------------------------------------------------------------

    def draw_item(x, y, i)

    #p "x=" + x.to_s + " y=" + y.to_s + " i=" + @items.to_s

    rect = Rect.new(0, 0, @items.width, @items.height)

    if @index == i

    self.contents.blt( x, y, @items, rect )

    if @disabled[@index]

    self.contents.blt( x, y, ICON_DISABLE, rect )

    end

    else

    self.contents.blt( x, y, @items, rect, 128 )

    if @disabled[@index]

    self.contents.blt( x, y, ICON_DISABLE, rect, 128 )

    end

    end

    end

    #--------------------------------------------------------------------------

    # œ €–ڂ𖳌ø‚É‚·‚é

    # index : €–Ú”Ô†

    #--------------------------------------------------------------------------

    def disable_item(index)

    @disabled[index] = true

    end

    #--------------------------------------------------------------------------

    # › ‰Šú‰»ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì€”õ

    #--------------------------------------------------------------------------

    def setup_move_start

    @mode = MODE_START

    @steps = STARTUP_FRAMES

    if SE_STARTUP != nil and SE_STARTUP != ""

    Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)

    end

    end

    #--------------------------------------------------------------------------

    # › ‰ñ“]ƒAƒjƒ[ƒVƒ‡ƒ“‚Ì€”õ

    #--------------------------------------------------------------------------

    def setup_move_move(mode)

    if mode == MODE_MOVER

    @index -= 1

    @index = @items.size - 1 if @index < 0

    elsif mode == MODE_MOVEL

    @index += 1

    @index = 0 if @index >= @items.size

    else

    return

    end

    @mode = mode

    @steps = MOVING_FRAMES

    end

    #--------------------------------------------------------------------------

    # › ƒAƒjƒ[ƒVƒ‡ƒ“’†‚©‚Ç‚¤‚©

    #--------------------------------------------------------------------------

    def animation?

    return @mode != MODE_WAIT

    end

    end

     

    #===================================================

    # ? CLASS Window_RingMenu Ends

    #===================================================

     

     

    #===================================================

    # ? CLASS Window_RingMenuStatus Begins

    #===================================================

     

    class Window_RingMenuStatus < Window_Selectable

    #--------------------------------------------------------------------------

    # œ ƒIƒuƒWƒFƒNƒg‰Šú‰»

    #--------------------------------------------------------------------------

    def initialize

    super(204, 64, 232, 352)

    self.contents = Bitmap.new(width - 32, height - 32)

    self.contents.font.size = $chara_select[5]

    refresh

    self.active = false

    self.index = -1

    end

    #--------------------------------------------------------------------------

    # œ ƒŠƒtƒŒƒbƒVƒ…

    #--------------------------------------------------------------------------

    def refresh

    self.contents.clear

    self.windowskin = RPG::Cache.windowskin($chara_select[4])

    self.contents.font.name = $chara_select[0]

    self.contents.font.color = text_color($chara_select[1])

    @item_max = $game_party.actors.size

    for i in 0...$game_party.actors.size

    x = 80

    y = 80 * i

    actor = $game_party.actors

    draw_actor_graphic(actor, x - 40, y + 80)

    draw_actor_name(actor, x, y + 24)

    end

    end

    #--------------------------------------------------------------------------

    # œ ƒJ[ƒ\ƒ‹‚Ì‹éŒ`XV

    #--------------------------------------------------------------------------

    def update_cursor_rect

    if @index < 0

    self.cursor_rect.empty

    else

    self.cursor_rect.set(0, @index * 80, self.width - 32, 80)

    end

    end

    end

    #===================================================

    # ? CLASS Window_RingMenuStatus Ends

    #===================================================

     

     

    #===================================================

    # ? CLASS Game_Map Additional Code Begins

    #===================================================

    class Game_Map

     

    #Dubealex Addition (from XRXS) to show Map Name on screen

    def name

    $map_infos[@map_id]

    end

    end

     

    #===================================================

    # ? CLASS Game_Map Additional Code Ends

    #===================================================

     

     

    #===================================================

    # ? CLASS Scene_Title Additional Code Begins

    #===================================================

    class Scene_Title

     

    #Dubealex Addition (from XRXS) to show Map Name on screen

    $map_infos = load_data("Data/MapInfos.rxdata")

    for key in $map_infos.keys

    $map_infos[key] = $map_infos[key].name

    end

    end

     

    #===================================================

    # ? CLASS Scene_Title Additional Code Ends

    #===================================================

     

     

    #===================================================

    # ? CLASS Window_Location Begins

    #===================================================

     

    class Window_Location < Window_Base

     

    def initialize

    super(0, 0, $window_size[0], $window_size[1])

    self.contents = Bitmap.new(width - 32, height - 32)

    self.contents.font.name = $location_text[0]

    self.contents.font.size = $location_text[1]

    refresh

    end

     

    def refresh

    self.contents.clear

    self.windowskin = RPG::Cache.windowskin($window_location_skin)

    self.contents.font.color = text_color($location_text[2])

    self.contents.draw_text(4, 0, 120, 32, $location_text[3])

    self.contents.font.color = text_color($location_text[4])

    self.contents.draw_text(4, 32, 120, 32, $game_map.name, 2)

    end

    end

    #===================================================

    # ? CLASS Window_Location Ends

    #===================================================

     

    #===================================================

    # ? Ring Menu - Show Player Location R1 - Ends

    #===================================================

     

     

    Come posso fare a risolvere? Aggiungo che la riga in questione non l'ho mai nemmeno sfiorata, ne mai notata, fino ad ora. Grazie a chi mi darà una mano! :D

  13. L'ho visto il post, ma se invece di chiamarlo da evento lo chiamo da script (quello del menu) dove non posso gestire gli switch, come faccio? Se nello script scrivo $scene = Party_Switcher.new([1,2,3]), per tutto il gioco sarà possibile solo selezionare quei tre pg, anche se nel gruppo ne entrano altri. Correggetemi se mi sbaglio, ma se dico giusto come potrei fare a risolvere? Se fosse da evento, mi basterebbe ogni volta aggiungere ID man mano che il gioco avanza, attivando uno switch per ogni pg che si unisce al gruppo. Si può fare lo stesso dal Ruby? Questa era la mia domanda.

     

    EDIT:

     

    @giver: Se faccio come dici tu, mi da questo errore alla riga 66. Qual è il problema?

    SCREEN:post-4650-1285456277_thumb.jpg

  14. Eccomi di nuovo XD volevo chiedere se esiste un modo per far si che i pg che si possono selezionare dalla schermata siano solo quelli che il protagonista ha già incontrato, non tutti quelli che sono contenuti nel database.
  15. Ho scaricato lo script e l'ho installato, funziona benissimo ma vorrei fare una domanda, se non chiedo troppo.

    Sarebb possibile mettere una picture al posto del battler per i pg? Io uso un bs laterale e potete immaginare che effetto fanno i miei battler... grazie :)

  16. Penso che tutto quello che dite sia giustissimo, è semplicemente un bug... perchè non esiste una spiegazione logica per questo problema... per quale motivo non mi mostra l'immagine? Ho provato a cambiare la picture da mostrare, in caso il problema fosse nella stessa, ma non è quello il problema. Tr l'altro questo evento l'ho già usato e ha sempre funzionato nelle altre mappe. Facendo test su progetti vuoti, sembra proprio che questo problema persita in mappe vuote. Proverò a mettere altri eventi prima di questo, un tentativo disperato... grazie comunque!
×
×
  • Create New...