Jump to content
Rpg²S Forum

dreamless89

Utenti
  • Posts

    16
  • Joined

  • Last visited

Posts posted by dreamless89

  1. Continua a non andare... T_T

    Purtroppo io non capendo tutti i codici dello scritp mi incasino facilmente... Piano piano migliorerò..

    Se puoi correggere dove ho sbagliato facendomi notare i punti in cui è avvenuto te ne sarei grato!

     

    Ecco la Scene_Menu

     

     

    # _____ _ _ _ _ _

    # | ____|__| (_) |_ ___ __| | | |__ _ _

    # | _| / _` | | __/ _ \/ _` | | '_ \| | | |

    # | |__| (_| | | || __/ (_| | | |_) | |_| |

    # |_____\__,_|_|\__\___|\__,_| |_.__/ \__, |

    # |___/

    # ____ _

    # | _ \ _ __ ___ __ _ _ __ ___ | | ___ ___ ___

    # | | | | '__/ _ \/ _` | '_ ` _ \| |/ _ \/ __/ __|

    # | |_| | | | __/ (_| | | | | | | | __/\__ \__ \

    # |____/|_| \___|\__,_|_| |_| |_|_|\___||___/___/

     

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

    # ■ Scene_Menu

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

    #  メニュー画面の処理を行うクラスです。

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

     

    class Scene_Menu

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

    # ● オブジェクト初期化

    # menu_index : コマンドのカーソル初期位置

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

    def initialize(menu_index = 0)

    @menu_index = menu_index

    end

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

    # ● メイン処理

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

    def main

     

    #@spriteset = Spriteset_Map.new

    @background = Sprite.new

    @background.bitmap = RPG::Cache.picture("prova_menu")

    @background.x = 0

    @background.y = 0

    @background.z = -100

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

    @icona1 = Sprite.new

    @icona1.bitmap = RPG::Cache.icon("Money")

    @icona1.x = 75

    @icona1.opacity = 255

    @icona1.y = 437

    @icona1.z = 200

    #Stop icone

    s1 = $data_system.words.item

    s2 = $data_system.words.skill

    s3 = $data_system.words.equip

    s4 = "Status"

    s5 = "Salva"

    s6 = "Esci"

    s7 = "Prova"

    s8 = "Prova2"

    s9 = "Prova3"

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

    @command_window.index = @menu_index

    # パーティ人数が 0 人の場合

    if $game_party.actors.size == 0

    # アイテム、スキル、装備、ステータスを無効化

    @command_window.disable_item(0)

    @command_window.disable_item(1)

    @command_window.disable_item(2)

    @command_window.disable_item(3)

    end

    # セーブ禁止の場合

    if $game_system.save_disabled

    # セーブを無効にする

    @command_window.disable_item(4)

    end

    # プレイ時間ウィンドウを作成

    @playtime_window = Window_PlayTime.new

    @playtime_window.x = 224

    @playtime_window.y = 224

    # 歩数ウィンドウを作成

    @steps_window = Window_Steps.new

    @steps_window.x = 0

    @steps_window.y = 320

    # ゴールドウィンドウを作成

    @gold_window = Window_Gold.new

    @gold_window.x = 0

    @gold_window.y = 416

    # ステータスウィンドウを作成

    @status_window = Window_MenuStatus.new

    @status_window.x = 160

    @status_window.y = 0

    # トランジション実行

    Graphics.transition

    # メインループ

    loop do

    # ゲーム画面を更新

    Graphics.update

    # 入力情報を更新

    Input.update

    # フレーム更新

    update

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

    if $scene != self

    break

    end

    end

    # トランジション準備

    Graphics.freeze

    # ウィンドウを解放

    @background.dispose

    @command_window.dispose

    @playtime_window.dispose

    @steps_window.dispose

    @gold_window.dispose

    @status_window.dispose

    if @prova != nil

    @prova.dispose

    end

    @icona1.dispose

    end

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

    # ● フレーム更新

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

    def update

    # ウィンドウを更新

    @command_window.update

    @playtime_window.update

    @steps_window.update

    @gold_window.update

    @status_window.update

    @icona1.update

    # コマンドウィンドウがアクティブの場合: update_command を呼ぶ

    if @command_window.active

    update_command

    return

    end

    # ステータスウィンドウがアクティブの場合: update_status を呼ぶ

    if @status_window.active

    update_status

    return

    end

    end

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

    # ● フレーム更新 (コマンドウィンドウがアクティブの場合)

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

    def update_prova

    # If B button was pressed

    if Input.trigger?(Input::B)

    # Play cancel SE

    $game_system.se_play($data_system.cancel_se)

    # Make command window active

    @command_window.active = true

    @prova.active = false

    @prova.dispose

    return

    end

    # If C button was pressed

    if Input.trigger?(Input::C)

    # Branch cursor position

    case @prova.index

    when 0 # item

    # Play decision SE

    $game_system.se_play($data_system.decision_se)

    # Switch to item screen

    $scene = Scene_Item.new

    when 1 # rarity

    # Play decision SE

    $game_system.se_play($data_system.decision_se)

    # Switch to equipment screen

    $scene = Scene_Rarity.new

    when 2 # card

    # Play decision SE

    $game_system.se_play($data_system.decision_se)

    # Switch to status screen

    $scene = Scene_Card.new

    end

    return

    end

    end

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

    # ● フレーム更新 (コマンドウィンドウがアクティブの場合)

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

    def update_command

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

    if Input.trigger?(Input::B)

    $game_system.se_play($data_system.cancel_se)

    $scene = Scene_Map.new

    return

    end

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

    if Input.trigger?(Input::C)

    # パーティ人数が 0 人で、セーブ、ゲーム終了以外のコマンドの場合

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

    # ブザー SE を演奏

    $game_system.se_play($data_system.buzzer_se)

    return

    end

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

    case @command_window.index

    when 0 # アイテム

    $game_system.se_play($data_system.decision_se)

    # Chiama Item

    @command_window.active = true

    s1 = "Oggetti"

    s2 = "Rarità"

    s3 = "Carte"

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

    @prova.back_opacity = 160

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

    @prova.y = 288

    @prova.active = true

    @prova.index = 0

    when 1 # スキル

    $game_system.se_play($data_system.decision_se)

    $scene = Scene_Skill.new

    when 2 # 装備

    $game_system.se_play($data_system.decision_se)

    $scene = Scene_Equip.new

    when 3 # ステータス

    $game_system.se_play($data_system.decision_se)

    $scene = Scene_Status.new

    when 4 # セーブ

    # セーブ禁止の場合

    if $game_system.save_disabled

    # ブザー SE を演奏

    $game_system.se_play($data_system.buzzer_se)

    return

    end

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    # セーブ画面に切り替え

    $scene = Scene_Save.new

    when 5 # ゲーム終了

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    # ゲーム終了画面に切り替え

    $scene = Scene_End.new

    when 6 # ゲーム終了

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    # ゲーム終了画面に切り替え

    $scene = Scene_End.new

    when 7 # ゲーム終了

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    # ゲーム終了画面に切り替え

    $scene = Scene_Save.new

    when 8 # ゲーム終了

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    # ゲーム終了画面に切り替え

    $scene = Scene_End.new

    end

    return

    end

    end

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

    # ● フレーム更新 (ステータスウィンドウがアクティブの場合)

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

    def update_status

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

    if Input.trigger?(Input::B)

    # キャンセル SE を演奏

    $game_system.se_play($data_system.cancel_se)

    # コマンドウィンドウをアクティブにする

    @command_window.active = true

    @status_window.active = false

    @status_window.index = -1

    return

    end

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

    if Input.trigger?(Input::C)

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

    case @command_window.index

    when 1 # スキル

    # このアクターの行動制限が 2 以上の場合

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

    # ブザー SE を演奏

    $game_system.se_play($data_system.buzzer_se)

    return

    end

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    # スキル画面に切り替え

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

    when 2 # 装備

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    # 装備画面に切り替え

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

    when 3 # ステータス

    # 決定 SE を演奏

    $game_system.se_play($data_system.decision_se)

    # ステータス画面に切り替え

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

    end

    return

    end

    end

    end

     

     

     

  2. Mi servirebbe una mano per capire come modificare in un certo modo la Scene_Menu:

     

    Vorrei che premendo invio su la funzione Oggetti si aprisse una window_command con la scelta delle sottocategorie...

     

    Sto impostando lo script in questo modo:

     

    case @command_window.index

    when 0

    $game_system.se_play($data_system.decision_se)

    # Chiama Item

    @command_window.active = false

    s1 = "Oggetti"

    s2 = "Rarità"

    s3 = "Carte"

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

    @Prova.back_opacity = 160

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

    @Prova.y = 288

    @Prova.active = true

     

    Cosa c'e' di sbagliato? Il risultato ottenuto è che.. appare la finestra ma sia quella del menu che quest'ultima rimangono bloccate...

     

    Sono un po niubbo.. Grazie per chi mi dovesse aiutare! :ph34r:

  3. Grazieee! Ascolta.. Siccome mi sento una merda a copiare e incollare i codici creati dagli altri... Mi piacerebbe imparare a scriptare in Ruby ma sono fermo ai primi passi (concetti e applicazioni di variabili.. costanti if, while, classi, metodi ecc...)

    Mi potresti consigliare una guida completa sullo scripting RGSS??

  4. Ragazzi, esiste un commando richiamabile da script che crea un file di salvataggio evitando di aprire la Scene_Save!?

    Così da poter creare un menu di salvataggio totalmente personalizato (in programmazione a eventi)!

  5. Si ti sei spiegato bene! Ho risolto in questo modo!

    Un evento in processo parallelo chiama la switch del calcolo [ON] aspetta 0.1 frames e cambia switch stop calcolo nella quale la switch calcolo è settata [OFF] !

    Ogni qual volta ci sarà una modifica agli hp settero Stop calcolo [OFF] e in 0,1 frames (tempo minimo ma sufficiente a far aggiornare le picture) vedrò sempre gli HP aggiornati !

     

    Ti ringrazio molto! Sei stato veramente disponibile!

  6. In che senso aggiornare le picture in continuazione? Tu come faresti? Se per un motivo o per un'altro nel gioco tu dovessi perdere hp l'evento deve essere sempre attivo e quindi disponibile a visualizzare il cambiamento!
  7. Ciao a tutti! Inizio col presentarmi:

    Mi chiamo Enrico, sono una new entry in questo forum, ma è da un po che seguo le discussioni!

    Ho usato tutte le versioni di rpgmaker, dal 95 all'xp! (Escluso il VX che non ho mai provato..)

    Da poco ho iniziato a smanettare Rpg Maker XP e ho riscontrato un problema (In fase di programmazione) che potrebbe costarmi la creazione di un gioco!

     

    Vorrei creare un menu come da esempio (In basso):

     

    http://spettron.altervista.org/Esempio_Menu.PNG

     

    So programmare ad eventi un menu del genere se non fosse che i calcoli (visualizzazione HP, SP, Money) fanno laggare terribilmente il gioco..

    Posto il metodo ad eventi con cui creo il calcolo:

     

     

    >Variabile Hp unità = Eroe HP

    >Variabile Hp decine = Eroe HP

    >Variabile Hp centinaia = Eroe HP

    >Variabile Hp migliaia = Eroe HP

    >variabile HP decine /=10

    >variabile HP centinaia/=100

    >variabile HP migliaia/=1000

    >Variabile Hp unità %= 10

    >variabile HP decine %=10

    >variabile HP centinaia %=10

    >variabile HP migliaia %=10

     

    Conditional Branch:variabile Hp unità = 0

    @show picture "0.png"

    {Ripeti questa condizione fino al caso in cui la variabile è == 9 (cambiando le picture ovviamente)}

     

    Conditional Branch:variabile Hp decie = 0

    @show picture "0.png"

    {Ripeti questa condizione fino al caso in cui la variabile è == 9 (cambiando le picture ovviamente)}

     

    Conditional Branch:variabile Hp centinaia = 0

    @show picture "0.png"

    {Ripeti questa condizione fino al caso in cui la variabile è == 9 (cambiando le picture ovviamente)}

     

    Conditional Branch:variabile Hp migliaia = 0

    @show picture "0.png"

    {Ripeti questa condizione fino al caso in cui la variabile è == 9 (cambiando le picture ovviamente)}

     

     

     

     

    Arriviamo al dunque.. Non ho trovato nessuna soluzione per questo problema.. Ho provato diversi script anti Lag che non hanno risolto proprio nulla..

     

    Mi chiedevo:

    E' possibile creare questo tipo di calcolo (da script anzi che da Eventi), in maniera tale da poterlo semplificare e quindi evitare il lag?

     

    Un grazie in anticipo per tutti quelli che mi daranno supporto! :Ok:

×
×
  • Create New...