Heures au format UTC + 1 heure [ Heure d’été ]


Règles du forum


Consultez la liste des Scripts : cliquez ici



Publier un nouveau sujet Répondre au sujet  [ 3 messages ] 
Auteur Message
 Sujet du message: Système PHS
MessagePublié: 21 Avr 2007, 15:07 
Ancien membre du staff
Ancien membre du staff
Avatar de l’utilisateur

Inscrit le: 13 Avr 2007, 00:00
Messages: 2027
Points d'aide: 0/60

Créations :

Voir ses créations

J'ai trouvé sur un site japonais un système PHS qui marche ^^

Auteur : momomomo? (japonais)

Traduction : Yue

Matériel : seulement des interrupteurs de libre.

Démo : http://www.megaupload.com/fr/?d=VTB6IZPS (tout est de moi sauf le script bien entendu)

Testé et fonctionnel.

Screen:
Image
Les instructions sont dans la démo et dans le script de la démo (pas dans le script original, il est donc conseillé de télécharger la démo).

_________________
(My Deviant)>( °3° )
Image
Ayez pitié d'un petit mélo en le nourrissant une fois par jour <3

"Si tu ne contrôles pas le nutella, tu ne contrôleras pas ta vie..."


Haut
 Profil  
 
 Sujet du message: Re: Système PHS
MessagePublié: 21 Avr 2007, 20:06 
Roi
Roi
Avatar de l’utilisateur

Inscrit le: 13 Aoû 2006, 00:00
Messages: 2414
Localisation: Montréal, QC
Logiciel(s) préféré(s): RMXP, VS2008
Point(s) Fort(s): Script
Points d'aide: Illimité

Créations :

- Séparation d'inventaire

- Sprite_Text


Voir ses créations

Script :

Code: Tout sélectionner
#Crée par momomomo? et traduit par Yue
#
#Pour que les héros soyent disponible il faut activer et désactiver des interrupteurs
#(voir ligne 82 a 99)
#Qui se trouve dans: class Window_Party_Select : party_in_menber
#
#●設定方法
#・最大パーティー加入人数
#  すぐ下の @party_max = 4 の部分を変更、通常は4。
#
#・最低パーティー加入人数(最低選択しなければならない人数)
# @party_min = 1 の部分を変更、初期ではとりあえず1に設定。
#
#
# Dans le PHS il est obligatoire d'avoir au moin 1 héro, pour changer
#le nombre d'héros il faut changer cette partie :
#  $game_party.must_actors = [1]
#  et mettre avec le 1 le nombre d'actors au minimum pour que le PHS marche.
#Par exemple si $game_party.must_actors = [1, 2, 3] alors il faudra au moin 3 membres dans
#l'équipe pour que le PHS fonctionne.
#
#
#  Il peut y avoir jusqu'a 8 héros pour le PHS, il est préfèrable de prévoir 1 à 7 voir 8
#interrupteurs de libres pour utiliser le PHS.
#  L'ID du héro dans menber.push($game_actors[ID]) doit correspondre a l'ID du héro voulu
#Par exemple si le héros Arshes a pour ID [1] alors menber.push($game_actors[1])
#
#Il est possible de voir les stats des héros lors du PHS grâce a la touche Z
#
#
#  Ce script a était crée le 24 septembre 2005 sous par momomomo? merci de bien faire crédit a cet jeune personne
#pour le travaille qu'elle a fournit.

class Game_Party
  attr_accessor :party_max
  attr_accessor :party_min
  attr_accessor :must_actors
  alias party_select_initialize initialize
  def initialize
    party_select_initialize
    @party_max = 4
    @party_min = 1
    @must_actors = [1]
  end
  def must_actor_include?(actor)
    return @must_actors.include?(actor.id)
  end
end

class Window_Party_Select < Window_Selectable
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 96, 640, 384)
    @party_in_ok_menber = party_in_menber
    @item_max = party_in_menber.size
    @column_max = 4
    self.contents = Bitmap.new(width - 32, row_max * 88)
    self.index = 0
    refresh
  end
  #--------------------------------------------------------------------------
  # ● アクターの取得
  #--------------------------------------------------------------------------
  def menber
    return @party_in_ok_menber[self.index]
  end
  #--------------------------------------------------------------------------
  # ● party_in_menber (héros pour  PHS)
  #--------------------------------------------------------------------------
  def party_in_menber
    menber = []
    menber.push($game_actors[1]) 
    menber.push($game_actors[2])  if $game_switches[1]
    menber.push($game_actors[3])  if $game_switches[2]
    menber.push($game_actors[4])  if $game_switches[3]
    menber.push($game_actors[5])  if $game_switches[4]
    menber.push($game_actors[6])  if $game_switches[5]
    menber.push($game_actors[7])  if $game_switches[6]
    menber.push($game_actors[8])  if $game_switches[7]
    return menber
  end
  #Pour que le héro[2] soit disponible pour le PHS il faut activer l'interrupteur [001]
  #Pour que le héro[2] ne soit plus disponible pour le PHS il faut désactiver l'interrupteur [001]
  #Pour qu'un héros ne soit pas disponible dès le départ il faut mettre :" if $game_switches[ID]"
  #a côté de:" menber.push($game_actors[ID]) " (sans prendre les guillemets)
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@party_in_ok_menber.size
      draw_menber(i)
    end
  end
  #--------------------------------------------------------------------------
  # ● アクター描画
  #--------------------------------------------------------------------------
  def draw_menber(index)
    actor = @party_in_ok_menber[index]
    x = 4 + index % @column_max * (640 / @column_max)
    y = index / @column_max * 88
    if $game_party.must_actor_include?(actor)
      color = text_color(3)
      opacity = 255
    elsif $game_party.actors.include?(actor)
      color = normal_color
      opacity = 255
    else
      color = disabled_color
      opacity = 128
    end
    self.contents.font.color = color
    self.contents.draw_text(x, y, 120, 32, actor.name)
    bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
    cw = bitmap.width / 4
    ch = bitmap.height / 4
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x+32 - cw / 2, y+64+16 - ch, bitmap, src_rect, opacity)
  end
  #--------------------------------------------------------------------------
  # ● 行数の取得
  #--------------------------------------------------------------------------
  def row_max
    # 項目数と列数から行数を算出
    return (@item_max + @column_max - 1) / @column_max
  end
  #--------------------------------------------------------------------------
  # ● 先頭の行の取得
  #--------------------------------------------------------------------------
  def top_row
    # ウィンドウ内容の転送元 Y 座標を、1 行の高さ 32 で割る
    return self.oy / 88
  end
  #--------------------------------------------------------------------------
  # ● 先頭の行の設定
  #     row : 先頭に表示する行
  #--------------------------------------------------------------------------
  def top_row=(row)
    # row が 0 未満の場合は 0 に修正
    if row < 0
      row = 0
    end
    # row が row_max - 1 超の場合は row_max - 1 に修正
    if row > row_max - 1
      row = row_max - 1
      if row < 0
        row = 0
      end
    end
    # row に 1 行の高さ 32 を掛け、ウィンドウ内容の転送元 Y 座標とする
    self.oy = row * 88
  end
  #--------------------------------------------------------------------------
  # ● 1 ページに表示できる行数の取得
  #--------------------------------------------------------------------------
  def page_row_max
    # ウィンドウの高さから、フレームの高さ 32 を引き、1 行の高さ 32 で割る
    return (self.height - 32) / 88
  end
  #--------------------------------------------------------------------------
  # ● カーソルの矩形更新
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # 現在の行を取得
    row = @index / @column_max
    # 現在の行が、表示されている先頭の行より前の場合
    if row < self.top_row
      # 現在の行が先頭になるようにスクロール
      self.top_row = row
    end
    # 現在の行が、表示されている最後尾の行より後ろの場合
    if row > self.top_row + (self.page_row_max - 1)
      # 現在の行が最後尾になるようにスクロール
      self.top_row = row - (self.page_row_max - 1)
    end
    # カーソルの幅を計算
    cursor_width = 512 / @column_max
    # カーソルの座標を計算
    x = @index % @column_max * (cursor_width + 32)#(640 / @column_max)
    y = @index / @column_max * 88 - self.oy
    # カーソルの矩形を更新
    self.cursor_rect.set(x, y, cursor_width, 32)
  end
end

class Window_Party_Select_Menber < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 640, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # ● リフレッシュ
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...$game_party.actors.size
      draw_menber(i)
    end
  end
  #--------------------------------------------------------------------------
  # ● アクター描画
  #--------------------------------------------------------------------------
  def draw_menber(index)
    actor = $game_party.actors[index]
    x = 4 + index * (640 / $game_party.party_max)
    y = 0
    draw_actor_graphic(actor, x+32, y+48+8)
  end
end

class Window_Party_Select_Menber_Status < Window_Base
  #--------------------------------------------------------------------------
  # ● オブジェクト初期化
  #--------------------------------------------------------------------------
  def initialize
    super(0, 288, 640, 192)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.visible = false
  end
  #--------------------------------------------------------------------------
  # ● stats des héros en appuyant sur Z
  #--------------------------------------------------------------------------
  def refresh(actor)
    self.contents.clear
    draw_actor_name(actor, 4, 0)
    draw_actor_class(actor, 4 + 144, 0)
    draw_actor_level(actor, 4, 32)
    draw_actor_state(actor, 4 + 72, 32)
    draw_actor_hp(actor, 4, 64, 172)
    draw_actor_sp(actor, 4, 96, 172)
    draw_actor_parameter(actor, 218, 32, 0)
    draw_actor_parameter(actor, 218, 64, 1)
    draw_actor_parameter(actor, 218, 96, 2)
    draw_actor_parameter(actor, 430, 32, 3)
    draw_actor_parameter(actor, 430, 64, 4)
    draw_actor_parameter(actor, 430, 96, 5)
    draw_actor_parameter(actor, 430, 128, 6)
   
  end
end


Haut
 Profil  
 
 Sujet du message: Re: Système PHS
MessagePublié: 28 Mai 2009, 15:34 
Roi
Roi
Avatar de l’utilisateur

Inscrit le: 13 Aoû 2006, 00:00
Messages: 2414
Localisation: Montréal, QC
Logiciel(s) préféré(s): RMXP, VS2008
Point(s) Fort(s): Script
Points d'aide: Illimité

Créations :

- Séparation d'inventaire

- Sprite_Text


Voir ses créations

Code: Tout sélectionner
class Scene_Party_in
  #--------------------------------------------------------------------------
  # ● メイン処理
  #--------------------------------------------------------------------------
  def main
    @main_window = Window_Party_Select.new
    @menber_window = Window_Party_Select_Menber.new
    @status_window = Window_Party_Select_Menber_Status.new
    @status_window.opacity = 192
    @status_window.z += 10
    @show_index = 0
    # トランジション実行
    Graphics.transition
    # メインループ
    loop do
      # ゲーム画面を更新
      Graphics.update
      # 入力情報を更新
      Input.update
      # フレーム更新
      update
      # 画面が切り替わったらループを中断
      if $scene != self
        break
      end
    end
    # トランジション準備
    Graphics.freeze
    # ウィンドウを解放
    @main_window.dispose
    @menber_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● フレーム更新
  #--------------------------------------------------------------------------
  def update
    # コマンドウィンドウを更新
    @main_window.update
    if @status_window.visible and @show_index != @main_window.index
      status_window_position
      @status_window.refresh(@main_window.menber)
      @show_index = @main_window.index
    end
    # B ボタンが押された場合
    if Input.trigger?(Input::B)
      if $game_party.actors.size < $game_party.party_min
        # ブザー SE を演奏
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # キャンセル SE を演奏
      $game_system.se_play($data_system.cancel_se)
      # メニュー画面に切り替え
      $scene = Scene_Map.new
      return
    end
    # C ボタンが押された場合
    if Input.trigger?(Input::C)
      # 選択したアクターが強制加入アクターの場合入れ替え不可
      if $game_party.must_actor_include?(@main_window.menber)
        # ブザー SE を演奏
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      if $game_party.actors.include?(@main_window.menber)
        $game_party.remove_actor(@main_window.menber.id)
      else
        if $game_party.actors.size == $game_party.party_max
          # ブザー SE を演奏
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_party.add_actor(@main_window.menber.id)
      end
      # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      @main_window.refresh
      @menber_window.refresh
      return
    end
    # A ボタンが押された場合
    if Input.trigger?(Input::A)
      # 決定 SE を演奏
      $game_system.se_play($data_system.decision_se)
      if @status_window.visible
        @status_window.visible = false
      else
        status_window_position
        @status_window.refresh(@main_window.menber)
        @status_window.visible = true
        @show_index = @main_window.index
      end
      return
    end
  end
  def status_window_position
    if @main_window.cursor_rect.y < 176
      @status_window.y = 288
    else
      @status_window.y = 96
    end
  end
end


Haut
 Profil  
 
Afficher les messages depuis:  Trier par  
Publier un nouveau sujet Répondre au sujet  [ 3 messages ] 

Heures au format UTC + 1 heure [ Heure d’été ]


Qui est en ligne ?

Utilisateurs parcourant actuellement ce forum : Aucun utilisateur inscrit et 3 invités


Vous ne pouvez pas publier de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas insérer de pièces jointes dans ce forum

Rechercher pour:
Sauter vers:  
cron
RPG Creative Forum version 5 ; Tous droits réservés
phpBB Group (Traduit par Xaphos)
Optimisé pour une résolution 1024*728