@wind = Windo.new @wind.z = 0 @wind.opacity = 255 end
def terminate dispose_menu_background @choix.dispose @win.dispose end
def update update_menu_background update_command_selection @wind.update @choix.update if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new end @win.set_action(@choix.index) end end
if Input.trigger?(Input::C) case @action when 0 $scene = Biw::Scene[@action] when 1 $scene = Biw::Scene[@action] when 2 $scene = Biw::Scene[@action] when 3 $scene = Biw::Scene[@action] when 4 $scene = Biw::Scene[@action] when 5 $scene = Biw::Scene[@action] when 6 $scene = Biw::Scene[@action] when 7 $scene = Biw::Scene[@action] end end end end
def terminate super dispose_menu_background @viewport.dispose @help_window.dispose @item_window.dispose @target_window.dispose end
def return_scene $scene = Scene_Menu.new(0) end
def update super update_menu_background @help_window.update @item_window.update @target_window.update if @item_window.active update_item_selection elsif @target_window.active update_target_selection end end
def update_item_selection if Input.trigger?(Input::B) Sound.play_cancel return_scene elsif Input.trigger?(Input::C) @item = @item_window.item if @item != nil $game_party.last_item_id = @item.id end if $game_party.item_can_use?(@item) Sound.play_decision determine_item else Sound.play_buzzer end end end
def determine_item if @item.for_friend? show_target_window(@item_window.index % 2 == 0) if @item.for_all? @target_window.index = 99 else if $game_party.last_target_index < @target_window.item_max @target_window.index = $game_party.last_target_index else @target_window.index = 0 end end else use_item_nontarget end end
def update_target_selection if Input.trigger?(Input::B) Sound.play_cancel if $game_party.item_number(@item) == 0 # If item is used up @item_window.refresh # Recreate the window contents end hide_target_window elsif Input.trigger?(Input::C) if not $game_party.item_can_use?(@item) Sound.play_buzzer else determine_target end end end
def determine_target used = false if @item.for_all? for target in $game_party.members target.item_effect(target, @item) used = true unless target.skipped end else $game_party.last_target_index = @target_window.index target = $game_party.members[@target_window.index] target.item_effect(target, @item) used = true unless target.skipped end if used use_item_nontarget else Sound.play_buzzer end end
def show_target_window(right) @item_window.active = false width_remain = 544 - @target_window.width @target_window.x = right ? width_remain : 0 @target_window.visible = true @target_window.active = true if right @viewport.rect.set(0, 0, width_remain, 416) @viewport.ox = 0 else @viewport.rect.set(@target_window.width, 0, width_remain, 416) @viewport.ox = @target_window.width end end
def update super update_menu_background @help_window.update update_equip_window update_status_window update_item_windows if Input.trigger?(Input::F5) next_actor end
if @equip_window.active update_equip_selection elsif @item_window.active update_item_selection end end
def dispose_item_windows for window in @item_windows window.dispose end end
def update_item_windows for i in 0...EQUIP_TYPE_MAX @item_windows[i].visible = (@equip_window.index == i) @item_windows[i].update end @item_window = @item_windows[@equip_window.index] end
def set_new_parameters(new_atk, new_def, new_spi, new_agi) if @new_atk != new_atk or @new_def != new_def or @new_spi != new_spi or @new_agi != new_agi @new_atk = new_atk @new_def = new_def @new_spi = new_spi @new_agi = new_agi refresh end end
def new_parameter_color(old_value, new_value) if new_value > old_value # Get stronger return power_up_color elsif new_value == old_value # No change return normal_color else # Get weaker return power_down_color end end
def draw_parameter(x, y, type) case type when 0 name = Vocab::atk value = @actor.atk new_value = @new_atk when 1 name = Vocab::def value = @actor.def new_value = @new_def when 2 name = Vocab::spi value = @actor.spi new_value = @new_spi when 3 name = Vocab::agi value = @actor.agi new_value = @new_agi end self.contents.font.color = system_color self.contents.draw_text(x + 4, y, 80, WLH, name) self.contents.font.color = normal_color self.contents.draw_text(x + 90, y, 30, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(x + 122, y, 20, WLH, ">", 1) if new_value != nil self.contents.font.color = new_parameter_color(value, new_value) self.contents.draw_text(x + 142, y, 30, WLH, new_value, 2) end end end
def update super update_menu_background @help_window.update @status_window.update @skill_window.update @target_window.update if Input.trigger?(Input::F5) next_actor end
if @skill_window.active update_skill_selection elsif @target_window.active update_target_selection end end
def update_skill_selection if Input.trigger?(Input::B) Sound.play_cancel return_scene elsif Input.trigger?(Input::R) Sound.play_cursor next_actor elsif Input.trigger?(Input::L) Sound.play_cursor prev_actor elsif Input.trigger?(Input::C) @skill = @skill_window.skill if @skill != nil @actor.last_skill_id = @skill.id end if @actor.skill_can_use?(@skill) Sound.play_decision determine_skill else Sound.play_buzzer end end end
def determine_skill if @skill.for_friend? show_target_window(@skill_window.index % 2 == 0) if @skill.for_all? @target_window.index = 99 elsif @skill.for_user? @target_window.index = @actor_index + 100 else if $game_party.last_target_index < @target_window.item_max @target_window.index = $game_party.last_target_index else @target_window.index = 0 end end else use_skill_nontarget end end
def update_target_selection if Input.trigger?(Input::B) Sound.play_cancel hide_target_window elsif Input.trigger?(Input::C) if not @actor.skill_can_use?(@skill) Sound.play_buzzer else determine_target end end end
def determine_target used = false if @skill.for_all? for target in $game_party.members target.skill_effect(@actor, @skill) used = true unless target.skipped end elsif @skill.for_user? target = $game_party.members[@target_window.index - 100] target.skill_effect(@actor, @skill) used = true unless target.skipped else $game_party.last_target_index = @target_window.index target = $game_party.members[@target_window.index] target.skill_effect(@actor, @skill) used = true unless target.skipped end if used use_skill_nontarget else Sound.play_buzzer end end
def show_target_window(right) @skill_window.active = false width_remain = 544 - @target_window.width @target_window.x = right ? width_remain : 0 @target_window.visible = true @target_window.active = true if right @viewport.rect.set(0, 0, width_remain, 416) @viewport.ox = 0 else @viewport.rect.set(@target_window.width, 0, width_remain, 416) @viewport.ox = @target_window.width end end
def draw_equipments(x, y) self.contents.font.color = system_color self.contents.draw_text(x, y, 120, WLH, Vocab::equip) for i in 0..4 draw_item_name(@actor.equips[i], x + 16, y + WLH * (i + 1)) end end end
update_menu_background @status_window.update if Input.trigger?(Input::B) Sound.play_cancel return_scene elsif Input.trigger?(Input::R) Sound.play_cursor next_actor elsif Input.trigger?(Input::L) Sound.play_cursor prev_actor end super end end
def refresh self.contents.clear self.contents.font.color = normal_color name = Vocab::File + " #{@file_index + 1}" self.contents.draw_text(4, 0, 200, WLH, name) @name_width = contents.text_size(name).width if @file_exist draw_party_characters(85, 49) draw_playtime(0, 12.5, contents.width - 4, 2) end end
def draw_party_characters(x, y) for i in 0...@characters.size name = @characters[i][0] index = @characters[i][1] draw_character(name, index, x + i * 35, y) end end
def draw_playtime(x, y, width, align) hour = @total_sec / 60 / 60 min = @total_sec / 60 % 60 sec = @total_sec % 60 time_string = sprintf("%02d:%02d:%02d", hour, min, sec) self.contents.font.color = normal_color self.contents.draw_text(x, y, width, WLH, time_string, 2) end
def selected=(selected) @selected = selected update_cursor end
def update_cursor if @selected self.cursor_rect.set(0, 0, @name_width + 8, WLH) else self.cursor_rect.empty end end end
def initialize(x, y, width, height, actor) super(x, y, width, height) @actor = actor @column_max = 1 self.index = 0 refresh end
def skill return @data[self.index] end
def refresh @data = [] for skill in @actor.skills @data.push(skill) if skill.id == @actor.last_skill_id self.index = @data.size - 1 end end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end
def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) skill = @data[index] if skill != nil rect.width -= 4 enabled = @actor.skill_can_use?(skill) draw_item_name(skill, rect.x, rect.y, enabled) self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2) end end
def update_help @help_window.set_text(skill == nil ? "" : skill.description) end end
def initialize(x, y, width, height) super(x, y, width, height) @column_max = 1 self.index = 0 refresh end
def item return @data[self.index] end
def include?(item) return false if item == nil if $game_temp.in_battle return false unless item.is_a?(RPG::Item) end return true end
def enable?(item) return $game_party.item_can_use?(item) end
def refresh @data = [] for item in $game_party.items next unless include?(item) @data.push(item) if item.is_a?(RPG::Item) and item.id == $game_party.last_item_id self.index = @data.size - 1 end end @data.push(nil) if include?(nil) @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end
def draw_item(index) rect = item_rect(index) self.contents.clear_rect(rect) item = @data[index] if item != nil number = $game_party.item_number(item) enabled = enable?(item) rect.width -= 4 draw_item_name(item, rect.x, rect.y, enabled) self.contents.draw_text(rect, sprintf(":%2d", number), 2) end end
def update_help @help_window.set_text(item == nil ? "" : item.description) end end
# Mettre les musiques de chaque radio Musique = { 1=> "Airship", 2=> "Battle3" }
#Texte des radios ! (Pas trop long si possible !) Texte = { 1=> "On se ballade dans les aires ! Si haut ! Si haut qu'on ne voit plus en bas !", 2=> "Attention ! Attention ! Un monstre vient desortir des hautes herbes ! Il nous attaque ! Qu'allons-nous faire ! Haaaa !" }
# Si vous rajoutez une Radio, mettez ceci en dessous du dernier when en dessous : #~ when ID # self.contents.clear # @musik = Radio::Musique[@action.to_i + 1] # Audio.bgm_play("Audio/BGM/" + @musik.to_s,100,100) # @chaine = Radio::Chaîne[@action.to_i + 1] # @text = Radio::Texte[@action.to_i + 1]
#Avec ID = N° du dernier when + 1
#Nom de l'image dans le dossier Pictures IMG = "Radio" end
C´est simpa comme script, j´aime bien cest simple. mais comme l´a dit Zang, 10 choix c´est tres peu, tu devrai expliquer comment en ajouter ou en supprimer en commentaires.
PS: desole des fautes de frappes, QWERTZ qu lieu de azerty spa top
Moui enfin faut toucher un peu a tout, pour les novices c est pas top.mais tu as deja expliquer donc c est bien. sinon la radio, pourquoi un fond ? et pas un sprite de la map du jeu ??
# Mettre les musiques de chaque radio Musique = { 1=> "Airship", 2=> "Battle3" }
#Texte des radios ! (Pas trop long si possible !) Texte = { 1=> "On se ballade dans les aires ! Si haut ! Si haut qu'on ne voit plus en bas !", 2=> "Attention ! Attention ! Un monstre vient desortir des hautes herbes ! Il nous attaque ! Qu'allons-nous faire ! Haaaa !" }
- Lettres V1 : Bon, ça...Je pense que vous avez tous compris !
- Tiroir V1 : Un système qui gère les tiroirs. Ex : Vous avez un tiroir, vous l'ouvrez et hop ! Vous obtenez un objet ! Bien sur, ce sera configurable !
1 boites pour recevoir les lettres 1 interrupteur = 1 lettre
Ainsi, le maker peut choisir quand dans le jeu il aura quel lettre. apres si c´est plus simple que sa en script (A programmer) sa peut etre interessant
bonjour Biward.est que tu pourrais rendre compatible les +- 50 script de rpg maker XP pour le systeme ADB Comme pour final fantasy XII Sur Rpg maker VX.Merci d'avance si tu veux bien y regarder
Plus besoin de toucher au script pour rajouter des musiques ! Il suffit juste de rajouter les Chaînes, les musiques, les textes, les HZ et les ondes de chaque Radio !
# Mettre les musiques de chaque radio Musique = { 1=> "Airship", 2=> "Battle3" }
#================================================ #Texte des radios #================================================
#Mettre les textes de chaque radio Texte = { 1=> "On se ballade dans les aires ! Si haut ! Si haut qu'on ne voit plus en bas !", 2=> "Attention ! Attention ! Un monstre vient desortir des hautes herbes ! Il nous attaque ! Qu'allons-nous faire ! Haaaa !" }
@win1 = HZ.new @win1.z = 0 @win1.opacity = 255 end
def terminate dispose_menu_background @choix.dispose @win.dipose @win1.dispose end
def update update_menu_background @choix.update if Input.trigger?(Input::B) $scene = Scene_Menu.new(0) end @win.set_action(@choix.index) @win1.set_action(@choix.index) end end
class WR < Window_Base
def initialize super (150,0, 394 , 85) refresh end def set_action(num) @action = num refresh end def refresh if Input.trigger?(Input::C) self.contents.clear for id in 0..Radio::Chaîne.size if @action == id @musik = Radio::Musique[id.to_i + 1] Audio.bgm_play("Audio/BGM/" + @musik.to_s,100,100) @chaine = Radio::Chaîne[id.to_i + 1] @text = Radio::Texte[id.to_i + 1] end end
self.contents.draw_text(0, -60, 150, 150, @chaine, 0) self.contents.draw_text(10, -90, 350, 250, @text, 0) end end end
class HZ < Window_Base
def initialize super (0, 340, 200, 75) refresh end
def set_action(num) @action = num refresh end
def refresh if Input.trigger?(Input::C) self.contents.clear for id in 0..Radio::Chaîne.size if @action == id @hz = Radio::TexteHZ.to_s + Radio::HZ[id.to_i + 1] @onde = Radio::TexteONDE.to_s + Radio::Onde[id.to_i + 1] end end
self.contents.draw_text(0, -65, 150, 150, @hz, 0) self.contents.draw_text(0, -95, 350, 250, @onde, 0) end end end
# Mettre les musiques de chaque radio Musique = { 1=> "Airship", 2=> "Battle3" }
#================================================ #Texte des radios #================================================
#Mettre les textes de chaque radio Texte = { 1=> "On se ballade dans les aires ! Si haut ! Si haut qu'on ne voit plus en bas !", 2=> "Attention ! Attention ! Un monstre vient desortir des hautes herbes ! Il nous attaque ! Qu'allons-nous faire ! Haaaa !" }
@win1 = HZ.new @win1.z = 0 @win1.opacity = 255 end
def terminate dispose_menu_background @choix.dispose @win.dipose @win1.dispose end
def update update_menu_background @choix.update if Input.trigger?(Input::B) $scene = Scene_Menu.new(0) end @win.set_action(@choix.index) @win1.set_action(@choix.index) end end
class WR < Window_Base
def initialize super (150,0, 394 , 85) refresh end def set_action(num) @action = num refresh end def refresh if Input.trigger?(Input::C) self.contents.clear for id in 0..Radio::Chaîne.size if @action == id @musik = Radio::Musique[id.to_i + 1] Audio.bgm_play("Audio/BGM/" + @musik.to_s,100,100) @chaine = Radio::Chaîne[id.to_i + 1] @text = Radio::Texte[id.to_i + 1] end end
self.contents.draw_text(0, -60, 150, 150, @chaine, 0) self.contents.draw_text(10, -90, 350, 250, @text, 0) end end end
class HZ < Window_Base
def initialize super (0, 340, 200, 75) refresh end
def set_action(num) @action = num refresh end
def refresh if Input.trigger?(Input::C) self.contents.clear for id in 0..Radio::Chaîne.size if @action == id @hz = Radio::TexteHZ.to_s + Radio::HZ[id.to_i + 1] @onde = Radio::TexteONDE.to_s + Radio::Onde[id.to_i + 1] end end
self.contents.draw_text(0, -65, 150, 150, @hz, 0) self.contents.draw_text(0, -95, 350, 250, @onde, 0) end end end
Biward
nuparu1997
Habitant Lv.6
Age : 26 Avertissements : 3Inscrit le : 08/12/2008 Messages : 135
# NB = Nombre d\'arme que vous voulez. # # #----------------FIN DES EXPLICATIONS----------------#
module Biblio2 Int = 0 # ID de l\'interrupteur
Nbarme = 30 # Nombre d\'arme Image = \"Fond\" TEXT_MENU = \"BiblioArmures\" end
class Scene_BiblioArmures < Scene_Base
def start
@interrupteur = Biblio2::Int #################Modifiable 1 Fois ICI et une fois dans Scene_Map ! ################ Si vous voulez de 4000 Ã 4030, mettez 3999 ! toujours un de moins !!!
create_menu_background # ----- Image de Fond -----# @fond = Sprite.new @fond.bitmap = Bitmap.new(Biblio2::Image) ## Nom de L\\\'image dans le dossier Pictures ! @fond.x = 0 @fond.y = 0 @fond.opacity = 125 # ----- Choix de l\\\'arme ----- # @choix =[] commands= []
for id in 1..Biblio2::Nbarme #Modifer ici le nombre d\\\'arme que vous voulez qu\\\'il s\\\'affiche (le 30) commands.push($data_armors[id].name) end
for id in 0..Biblio2::Nbarme if @action1 == id if $game_switches[@cond] == true @name = $data_armors[id.to_i + 1].name end end end
self.contents.clear self.contents.draw_text(100, 0, 100, 50, @name, 0) end
end end
class Window2 < Window_Base#WEAPON DESCRIPTION
def initialize super (200, 75, 344, 340) refresh end
def set_action(numd) @action2 = numd refresh end
def refresh
if Input.trigger?(Input::C) self.contents.clear @cond = (@interrupteur.to_i + @action2.to_i) + 1
for id in 0..Biblio2::Nbarme if @action2 == id if $game_switches[@cond] == true @att = $data_armors[id.to_i + 1].atk @def = $data_armors[id.to_i + 1].def @int = $data_armors[id.to_i + 1].spi @agi = $data_armors[id.to_i + 1].agi @hit = $data_armors[id.to_i + 1].eva @pro = $data_armors[id.to_i + 1].prevent_critical @prix = $data_armors[id.to_i + 1].price @sort = $data_armors[id.to_i + 1].kind @pv = $data_armors[id.to_i + 1].auto_hp_recover @des = $data_armors[id.to_i + 1].description icon = $data_armors[id.to_i + 1].icon_index else Sound.play_buzzer zero end end end
if @pro == true @pro = \"Oui\" else @pro = \"Non\" end
if @pv == true @pv = \"Oui\" else @pv = \"Non\" end
if @sort == 0 @sort = \"Bouclier\" end if @sort == 1 @sort = \"Chapeau\" end if @sort == 2 @sort = \"Armure\" end if @sort == 3 @sort = \"Acessoire\" end
def start new_start for nb in 0..Biblio2::Nbarme number = $game_party.has_item?($data_armors[nb], true) if number == true @interrupteur = 0 # A modifier !!!!! $game_switches[nb.to_i + @interrupteur.to_i] = true end end end end