- DjidaneMembre
- Nombre de messages : 1444
Age : 30
Localisation : Paris
Distinction : Héritier d'Alexdream (mais on l'aime quand même).
Lèche cul professionnel
et il aime ça!!!
Date d'inscription : 30/12/2008
Ajout d'un petit SE . [résolu]
Mar 1 Nov 2011 - 17:12
Salut à tout les makers !
Voilà mon problème : J'utilise un script de quête bien sympatique qui fonctionne très bien et sans bug mais qui possède un tout petit défaut que j'aimerais corriger . Quand on quitte un sous menu (Item , statut , compétences ...) il se produit un petit SE (Par défaut c'est le SE Cancel ...) . Et bien le problème est là , en quittant le menu quête , il ne se produit aucun SE .
Je fais donc appel à vous pour m'aider à corriger ce petit truc , voici le script et merci d'avance :
- Spoiler:
- Code:
=============================================================================
# Omegas7's Ultimate Quest System Script.
# =============================================================================
# Author: Omegas7.
# Version: 3.0 (Final).
# My Site: baseomega.forumer.com
# =============================================================================
# This final version comes loaded with a better looking layout,
# a more customizable configuration area, etc...
# =============================================================================
# Features:
# > Easy to create quests in the script.
# > A quest works with a variable, no switches!
# > Unlimited tasks for each quest! (Scroll Function)
# > Incomplete and Complete icons.
# > Set Background and HUD graphics for your own menu style!
# > You can use pictures for each quest!
# > Descriptions of each quest.
# > Variable support! Display variables values for complex quests!
# > Categories for ALL, COMPLETE, and INCOMPLETE quests.
# > Automatically adds "Quest Completed" unlike older versions.
# > Change Font sizes.
# > Lots of customization options, check below.
# =============================================================================
# Instructions: (First time? Better read them)
#
# Thanks for using this script.
# It is quite an useful system, take your time reading the next:
#
# First of all, let's create a new quest for our game.
# Below, in the configurations area, you will find the
# [QUEST CREATION AREA]. To create your own quest, you will
# need to add some code. Here is the basic template:
#
# QUESTS[ID] = ['Name',VAR,IconA,IconB,'Image']
# TASKS[ID] = ['Do this','And this','And this']
# DESCRIPTIONS[ID] = ['This is an awesome','quest for noobs']
#
# ID will be your quest ID number.
# So if you got 20 quests, your new quest ID would be 21.
# 'Name' is... The name lol. Make sure it to be inside quotes ' '.
# VAR is the variable ID which controls this quest.
# IconA is the incomplete icon index number.
# IconB ia the complete one.
# 'Image' will be the picture displayed on top of your quest.
# You can disable it by putting 'nil' (no quotes).
#
# TASKS will be the array containing all the To-Do stuff of the
# quest. Each task is a string, inside quotes ' '.
# Each task, is separated by a comma.
# You can have unlimited tasks (the window will become scrollable).
# You can put \v[id] for showing variables in your tasks!
#
# DESCRIPTIONS is like TASKS. Just that it will be the description
# being shown in the main menu for the quest.
# Each element is a text line.
#
# Look at the demo if you need help.
# For further help, let me know. My site is:
# baseomega.forumer.com
# =============================================================================
module OMEGAS7
module QUEST
# =========================================================================
# Configuration Options.
# =========================================================================
# Exit returns to MAP or to MENU?
EXIT_TO = "MENU"
# If MENU, then, what slot will it appear on? (Counting from 0)
MENU_RETURN_SLOT = 6
# Background and HUD graphics, both in system folder.
BACKGROUND = 'QUEST BG'
HUD = 'QUEST HUD'
# Tasks prefix and icon spacing (spaces before the quest name for the icon).
TASKS_PREFIX = "> "
ICON_SPACING = " "
# Main menu quests and task lines font sizes:
QUESTS_FONT_SIZE = 13
TASKS_FONT_SIZE = 16
# Category Icon Indexes.
# [All,Completed,Incompleted]
CATEGORY_ICONS = [100,101,99]
# =========================================================================
QUESTS = [] # Don't edit.
TASKS = [] # Don't edit.
DESCRIPTIONS = [] # Don't edit.
# =========================================================================
QUESTS[0] = ['Test',1,99,101]
TASKS[0] = ['Faire un chargement débile',
'Faire le plein de XP',
'Parler à la fée pourrite',
'Parler au soldat de merde',
'Battez le monstre crasseux']
DESCRIPTIONS[0] = ['Quête de test ...']
end
end
class Omega_Quest < Scene_Base
include OMEGAS7::QUEST
def initialize
@index = 0
@mode = 0
@empty_list = false
create_background
create_quest_list
create_quest_commands
create_quest_description
create_category
create_information
end
def create_background
@background = Sprite_Base.new
@background.bitmap = Cache.system(BACKGROUND.to_s)
@background.z = 50
@hud = Sprite_Base.new
@hud.bitmap = Cache.system(HUD.to_s)
@hud.z = 60
end
def create_quest_list
@list = []
@list[0] = []
@list[1] = []
@list[2] = []
for i in 0...QUESTS.size
if $game_variables[QUESTS[i][1].to_i].to_i > TASKS[i].size
@list[0][i] = [QUESTS[i][0].to_s,true,i]
@list[1][i] = [QUESTS[i][0].to_s,true,i]
elsif $game_variables[QUESTS[i][1].to_i].to_i > 0
@list[0][i] = [QUESTS[i][0].to_s,false,i]
@list[2][i] = [QUESTS[i][0].to_s,false,i]
end
end
@list[0].compact!
@list[1].compact!
@list[2].compact!
@list.compact!
if @list[0].empty?
@empty_list = true
end
end
def create_quest_commands
create_quest_list
@command_window = Window_Quest_Command.new(250,@list[@mode])
@command_window.y = 90
@command_window.x = 12
@command_window.opacity = 0
@index = @command_window.index
end
def create_quest_description
@window_description = Window_Base.new(280,80,250,170)
@window_description.contents.font.size = QUESTS_FONT_SIZE
@window_description.opacity = 0
refresh_description
end
def refresh_description
@window_description.contents.clear
if @list[@mode][@command_window.index][2] != nil
for i in 0...DESCRIPTIONS[@list[@mode][@command_window.index][2]].size
txt = DESCRIPTIONS[@list[@mode][@command_window.index][2]][i].to_s
@window_description.contents.draw_text(0,18*i,260,18,txt.to_s)
end
end
end
def update
@command_window.update
@category.update
if @mode != @category.index
@mode = @category.index
@command_window.dispose
create_quest_commands
refresh_description
end
if @index != @command_window.index
@index = @command_window.index
refresh_description
end
if Input.trigger?(Input::C) && @list[@mode][@command_window.index][2] != nil
@background.dispose
@hud.dispose
@command_window.dispose
@window_description.dispose
@category.dispose
@information.dispose
$scene = Omega_Quest_View.new(@list[@mode][@command_window.index][2])
elsif Input.trigger?(Input::C) && @list[@mode][@command_window.index][2] == nil
Sound.play_buzzer
end
if Input.trigger?(Input::B)
finish
end
end
def create_category
@category = Window_Categories_Command.new(180)
@category.opacity = 0
@category.x = -6
@category.y = 40
end
def create_information
@information = Window_Base.new(544-250,416-120,250,120)
@information.opacity = 0
@information.contents.font.size = 16
if @empty_list == true
@information.contents.draw_text(0,0,250,24,"Total de quête: 0")
else
@information.contents.draw_text(0,0,250,24,"Total de quêtes: " + @list[0].size.to_s)
end
@information.contents.font.color = Color.new(0,255,0)
@information.contents.draw_text(0,24,250,24,"Quêtes terminées: " + @list[1].size.to_s)
@information.contents.font.color = Color.new(255,167,0)
@information.contents.draw_text(0,48,250,24,"Quêtes en cours: " + @list[2].size.to_s)
end
def finish
@background.dispose
@hud.dispose
@command_window.dispose
@window_description.dispose
@category.dispose
@information.dispose
case EXIT_TO
when "MENU"
$scene = Scene_Menu.new(MENU_RETURN_SLOT)
when "MAP"
$scene = Scene_Map.new
end
end
end
class Omega_Quest_View < Scene_Base
include OMEGAS7::QUEST
def initialize(id)
@font_size = 16
@line_height = 18
@id = id
@limit_y = 0
draw_picture if QUESTS[@id][4] != nil
set_tasks
create_window
refresh_window
end
def draw_picture
@picture = Sprite_Base.new
@picture.bitmap = Cache.system(QUESTS[@id][4].to_s)
@picture.x = (544/2) - (@picture.width/2)
@picture.z = 250
end
def set_tasks
@tasks = []
for i in 0...TASKS[@id].size
if $game_variables[QUESTS[@id][1]].to_i >= i + 1
@tasks[i] = TASKS[@id][i].to_s
end
end
if $game_variables[QUESTS[@id][1]].to_i > TASKS[@id].size
@tasks.push('Quête terminée !')
end
end
def create_window
height = @line_height * @tasks.size + 32
y = 0
if @picture != nil
y += @picture.height
@limit_y = @picture.height
end
@window = Window_Base.new(0,y,544,height)
end
def refresh_window
@window.contents.clear
@window.contents.font.size = @font_size
@display = []
for i in 0...@tasks.size
@display[i] = @tasks[i].clone
@display[i].to_s.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
@display[i].to_s.gsub!(/\\V\[([0-9]+)\]/i) { $game_variables[$1.to_i] }
@window.contents.draw_text(0,i * @line_height,500,@line_height,TASKS_PREFIX.to_s + @display[i].to_s)
end
end
def update
if Input.press?(Input::DOWN) && ((@window.y + @window.height) > 416)
@window.y -= 3
elsif Input.press?(Input::UP) && (@window.y < @limit_y)
@window.y += 3
end
if Input.trigger?(Input::B)
@picture.dispose if @picture != nil
@window.dispose
$scene = Omega_Quest.new
end
end
end
class Window_Quest_Command < Window_Selectable
include OMEGAS7::QUEST
attr_reader :commands
def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
@commands = commands
@empty = false
if @commands.empty?
@commands[0] = ["Aucune quête.",false]
@empty = true
end
if row_max == 0
row_max = (@commands.size + column_max - 1) / column_max
end
super(0, 0, width, row_max * WLH + 32, spacing)
@item_max = commands.size
@column_max = column_max
self.contents.font.size = TASKS_FONT_SIZE
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index, enabled = true)
spacing = ICON_SPACING.to_s
rect = item_rect(index)
rect.x += 4
rect.width -= 8
self.contents.clear_rect(rect)
self.contents.font.color = Color.new(255,0,0)
self.contents.font.color.alpha = enabled ? 255 : 128
if @empty == false
if @commands[index][1] == true
self.contents.font.color = Color.new(0,255,0)
draw_icon(QUESTS[@commands[index][2]][3].to_i,rect.x,rect.y)
else
self.contents.font.color = Color.new(255,0,0)
draw_icon(QUESTS[@commands[index][2]][2].to_i,rect.x,rect.y)
end
elsif @empty == true
spacing = ""
end
self.contents.draw_text(rect, spacing + @commands[index][0].to_s)
end
end
class Window_Categories_Command < Window_Selectable
include OMEGAS7::QUEST
attr_reader :commands
def initialize(width, column_max = 3, row_max = 1, spacing = 32)
super(0, 0, width, row_max * WLH + 32, spacing)
@commands = ['','','']
@item_max = commands.size
@column_max = column_max
@icons = CATEGORY_ICONS
refresh
self.index = 0
end
def refresh
self.contents.clear
for i in 0...@item_max
draw_item(i)
end
end
def draw_item(index, enabled = true)
rect = item_rect(index)
rect.x += 4
rect.width -= 8
self.contents.clear_rect(rect)
draw_icon(@icons[index],rect.x,rect.y)
end
end
- DjidaneMembre
- Nombre de messages : 1444
Age : 30
Localisation : Paris
Distinction : Héritier d'Alexdream (mais on l'aime quand même).
Lèche cul professionnel
et il aime ça!!!
Date d'inscription : 30/12/2008
Re: Ajout d'un petit SE . [résolu]
Mer 9 Nov 2011 - 14:14
Je sais , je sais : Vous êtes trop à fond dans vos cours d'histoire et de math' (Voir à fond dans des histoire de machine à laver ...). Mais qui ne tente rien n'a rien !
Puis si dans 2 semaines il y a toujours rien , je ferme le sujet
Merci d'avance quand même !
- LunriMembre
- Nombre de messages : 675
Age : 33
Distinction : aucune
Date d'inscription : 31/07/2011
Re: Ajout d'un petit SE . [résolu]
Mer 9 Nov 2011 - 16:12
Dans ton script ligne 193 tu as ça :
Tu remplace par ça:
Ca devrait marcher j'ai pas les images du script j'ai pas testé
- Code:
if Input.trigger?(Input::B)
finish
Tu remplace par ça:
- Code:
if Input.trigger?(Input::B)
Sound.play_cancel
finish
Ca devrait marcher j'ai pas les images du script j'ai pas testé
- DjidaneMembre
- Nombre de messages : 1444
Age : 30
Localisation : Paris
Distinction : Héritier d'Alexdream (mais on l'aime quand même).
Lèche cul professionnel
et il aime ça!!!
Date d'inscription : 30/12/2008
Re: Ajout d'un petit SE . [résolu]
Mar 15 Nov 2011 - 13:29
Parfait , tout fonctionne . Merci beaucoup Lunri !
Problème résolu !
Problème résolu !
- Elisa'Staffeux retraité
- Nombre de messages : 2924
Age : 26
Localisation : Par là-bas !
Distinction : Mon héritière que je chéris
[Coco' ]
Plus que 2 ans avant d'épouser Coco' ! Compte à rebours lancé !
[Auto-distinction]
Adepte du "Je le savais" alors qu'elle le savait pas.
Date d'inscription : 30/05/2009
Re: Ajout d'un petit SE . [résolu]
Ven 18 Nov 2011 - 20:51
Problème résolu donc je déplace
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|