Krótki opis:
Dziennik zadań zawierający funkcje:
~ Podział na niezakończone i zakończone.
~ Ustalenie kilku celów w jednej misji.
(nie wiem czy jest ich więcej, to najbardziej potrzebne)
Jeśli ktoś zrobi własne grafiki, to naprawdę ładny quest log mu wyjdzie.
Autor:
Jaberwocky (edit FGSDF)
Skrypt:
Spoiler:
Kod:
#-------------------------------------------------------------------------------
# Jaberwocky's Quest Log
#
#
# FGSDF
#-------------------------------------------------------------------------------
class Bitmap
# Draws an outline around the text,
# both the outline color and the color of the
# text inside can be anything.
def draw_text_outline_custom(x, y, wid, hei, text, align, outlinecolor, insidecolor)
if $qdata.useoutlines == true
self.font.color = outlinecolor
draw_text(x + 1,y + 1,wid,hei,text, align)
draw_text(x + 1,y - 1,wid,hei,text, align)
draw_text(x - 1,y - 1,wid,hei,text, align)
draw_text(x - 1,y + 1,wid,hei,text, align)
end
self.font.color = insidecolor
draw_text(x,y,wid,hei,text, align)
end
end
class Scene_Quests
attr_accessor :questids
attr_accessor :command_window
attr_accessor :questswitches
# QSETUP This is the initialize method.
# It's where you set up which list will load:
def initialize(list = 1)
@quest_index = 0
@currentlist = list
# Right here. The format is:
# when A
# $qdata = B.new
# @questswitches = $game_temp.C
#
# A is the number called in $scene = Scene_Quests.new(Number)
# B is the class name for the list.
# C is the variable name for the quest list. Don't put the @ part with it here.
case list
when 1
$qdata = Quest_Data.new
@questswitches = $game_temp.qupdate
when 2
$qdata = Quest_Data2.new
@questswitches = $game_temp.qupdate2
end
end
def main
# Displays the background pictures:
@backpic = Sprite.new
@backpic.bitmap = RPG::Cache.picture("Menuback")
@backpic.z = 990
@questback = Sprite.new
@questback.bitmap = RPG::Cache.picture($qdata.backpicture)
@questback.z = 991
# Creates the quest list based on how many quests are active on that list:
questwin = []
@questids = []
# QSETUP This is one of the for branches that will need changing once your game is complete.
# More about that later.
for i in 1...10000
if @questswitches[i][0] == true
questwin.push($qdata.questname[i])
@questids.push(i)
end
end
if questwin.size == 0
questwin.push($qdata.questname[0])
@questids.push(0)
end
@command_window = Window_Qmand.new(182, questwin)
@command_window.index = @quest_index
@command_window.opacity = 0
@command_window.z = 1100
# This makes the window for the description text and objectives:
@status_window = Quest.new
@status_window.x = 160
@status_window.y = 75
@status_window.z = 1100
@status_window.opacity = 0
Graphics.transition
loop do
Graphics.update
Input.update
update_command
if $scene != self
break
end
end
Graphics.freeze
@command_window.contents.clear
@command_window.dispose
@status_window.contents.clear
@status_window.dispose
@backpic.dispose
@questback.dispose
end
end
#-------------------------------------------------------------------------------
# Updates the quest data, and switches between lists:
#-------------------------------------------------------------------------------
def update_command
if Input.repeat?(Input::UP)
if @command_window.index == 0
@command_window.index = @questids.size - 1
else
@command_window.index -= 1
end
unless @questids.size == 1
$game_system.se_play($data_system.cursor_se) unless @questids.size == 1
@status_window.refresh
end
end
if Input.repeat?(Input::DOWN)
if @command_window.index == @questids.size - 1
@command_window.index = 0
else
@command_window.index += 1
end
unless @questids.size == 1
$game_system.se_play($data_system.cursor_se)
@status_window.refresh
end
end
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
# QSETUP This is where you set up how it switches between lists.
# If you want to have say, 2 parties, each with different lists,
# this is where you would set up how it switches between lists.
# The format is simple:
# when listnumber
# $scene = Scene_Quests.new(list number to switch to)
#
# So if lists 1/2 are for the first party, and you want lists 3/4 to be for the second party,
# You'd just set up list 3 to switch to list 4 and list 4 to switch to list 3.
if Input.trigger?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
case @currentlist
when 1
$scene = Scene_Quests.new(2)
when 2
$scene = Scene_Quests.new(1)
end
end
if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
case @currentlist
when 1
$scene = Scene_Quests.new(2)
when 2
$scene = Scene_Quests.new(1)
end
end
end
#-------------------------------------------------------------------------------
# This creates the description text and the objectives
# for the the quests in progress. Objectives change colors
# and have an icon next to them.
#-------------------------------------------------------------------------------
class Quest < Window_Base
def initialize
super(0, 0, 480, 480)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end
def refresh
self.contents.clear
y = 0
for i in 0...$qdata.description[$scene.questids[$scene.command_window.index]].size
self.contents.draw_text_outline_custom(2, 24 * y, 480, 32, $qdata.description[$scene.questids[$scene.command_window.index]][i],0, $qdata.descoutline, $qdata.desctext)
y += 1
end
for i in 0...$qdata.objectives[$scene.questids[$scene.command_window.index]].size
y += 1
if $scene.questswitches[$scene.questids[$scene.command_window.index]][i + 1] == true
bitmap = RPG::Cache.icon("CompletedIcon")
self.contents.blt(0, 4 + ( y * 24) , bitmap, Rect.new(0, 0, 18, 18))
self.contents.draw_text_outline_custom(24, 0 + (y * 24), 456, 24, $qdata.objectives[$scene.questids[$scene.command_window.index]][i], 0, $qdata.compoutline, $qdata.comptext)
else
bitmap = RPG::Cache.icon("InProgressIcon")
self.contents.blt(0, 4 + ( y * 24) , bitmap, Rect.new(0, 0, 18, 18))
self.contents.draw_text_outline_custom(24, 0 + (y * 24), 456, 24, $qdata.objectives[$scene.questids[$scene.command_window.index]][i], 0, $qdata.incompoutline, $qdata.incomptext)
end
end
end
end
#-------------------------------------------------------------------------------
# This is for the list of quests on the left:
#-------------------------------------------------------------------------------
class Window_Qmand < Window_Selectable
def initialize(width, commands)
super(-10, 50, width, 380)
self.contents = Bitmap.new(width - 32, commands.size * 32)
@commands = commands
@item_max = @commands.size
self.index = 0
refresh
end
def refresh
self.contents.clear
for i in 0...@commands.size
self.contents.draw_text_outline_custom(0, 32 * i, self.contents.width, 32,@commands[i],1, $qdata.menuoutline, $qdata.menutext)
end
end
end
class Game_Temp
# QSETUP This is where you add the variables that control the quests on the lists.
attr_accessor :qupdate
attr_accessor :qupdate2
# You'll need one of these for every list. The script is setup by default to
# use qupdate for the first list and qupdate2 for the second.
#You can change these if you want.
alias asdfghjkl initialize
def initialize
asdfghjkl
# You'll need to add any new quest variables here, like this:
@qupdate = []
@qupdate2 = []
for i in 0...10000
# And here, too, like this:
@qupdate[i] = []
@qupdate2[i] = []
end
# That 10000 there is the maximum number of quests per list.
# Once your game is completely finished, count the number of quests on each list.
# There'll be a for loop like this in each of the quest lists.
# Replace the 10000 there with the number of quests on the list.
# This will lower the amount of time it takes to read the list.
# Do the same to the 10000 both here and in the main method up at the top,
# with the highest number of quests your lists have.
end
end
class Scene_Save < Scene_File
alias qwertyuiop write_save_data
def write_save_data(file)
qwertyuiop(file)
# QSETUP You'll need to add any new quest variables here, too, like this:
Marshal.dump($game_temp.qupdate, file)
Marshal.dump($game_temp.qupdate2, file)
end
end
class Scene_Load < Scene_File
alias zxcvbnm read_save_data
def read_save_data(file)
zxcvbnm(file)
# QSETUP Also need to add any new quest variable here, like this:
$game_temp.qupdate = Marshal.load(file)
$game_temp.qupdate2 = Marshal.load(file)
end
end
#-------------------------------------------------------------------------------
# This class holds all the data for the quests.
# If you want a new quest, add it in here.
# This is the class name. If you add another list, you need a different class name.
# It's a good idea to just use Quest_Data2/3/4/5/6/etc...
class Quest_Data
attr_accessor :description, :questname, :objectives,
:useoutlines, :descoutline, :desctext, :incompoutline,
:incomptext, :compoutline, :comptext, :menuoutline,
:menutext, :backpicture
def initialize
@questname = []
@description = []
@objectives = []
for i in 0...10000
@description[i] = []
@objectives[i] = []
end
# These are options you can change:
# These control the colors of the text.
# The code for this is:
# Color.new(Amount of Red, Amount of Green, Amount of Blue, Opacity)
# Each of these can be set from 0-255, 255 being the highest.
@useoutlines = true# Set to false if you don't want the text to have an outline
@descoutline = Color.new (0, 0, 0, 255)# Outline color for description text
@desctext = Color.new (255, 255, 255, 255)# Text color for description text
@incompoutline = Color.new(0, 0, 0, 255)# Outline color for incomplete objectives
@incomptext = Color.new(255, 0, 0, 255)# Text color for incomplete objectives
@compoutline = Color.new(0, 0, 0, 255)# Outline color for completed objectives
@comptext = Color.new(0, 255, 0, 255)# Text color for completed objectives
@menuoutline = Color.new(0, 0, 0, 255)# Outline color the in progress list
@menutext = Color.new(255, 255, 255, 255)# Text color for the in progress list
#-------------------------------------------------------------------------------
# This is the filename of the background picture for quests in progress:
@backpicture = "InProgressQuestScroll"
# It needs to be placed in the Graphics/Pictures folder.
#-------------------------------------------------------------------------------
# This is the data that is displayed when there are no quests active.
# I'll be using it to explain how to set up a quest, too:
@questname[0] = "Brak zadań" # This will be the name of your quest.
# This is the description for the quest. The format is:
# @description[quest number] = ["line 1", "line 2", "line 3", "etc..."]
# Note that if you have too many lines of description you can run out of room
# for objectives.
@description[0] = ["Obecnie nie mam żadnych zadań do wykonania."]
# The format is the same for @objectives if the quest has any.
#-------------------------------------------------------------------------------
# Quest 1
@questname[1] = "Odpocznij!"
@description[1] = ["Po ciężkiej bitwie z wilkami, nie jestem wstanie",
"dalej walczyć... Muszę wrócić do domu, położyć się",
"do łóżka i odpocząć."]
@objectives[1] = ["-Wróć do domu",
"-Odpocznij"]
end
end
#-------------------------------------------------------------------------------
# This class holds all the data for the quests.
# If you want a new quest, add it in here.
# This is the class name. If you add another list, you need a different class name.
# It's a good idea to just use Quest_Data2/3/4/5/6/etc...
class Quest_Data2
attr_accessor :description, :questname, :objectives,
:useoutlines, :descoutline, :desctext, :incompoutline,
:incomptext, :compoutline, :comptext, :menuoutline,
:menutext, :backpicture
def initialize
@questname = []
@description = []
@objectives = []
for i in 0...10000
@description[i] = []
@objectives[i] = []
end
# These are options you can change:
# These control the colors of the text.
# The code for this is:
# Color.new(Amount of Red, Amount of Green, Amount of Blue, Opacity)
# Each of these can be set from 0-255, 255 being the highest.
@useoutlines = true# Set to false if you don't want the text to have an outline
@descoutline = Color.new (0, 0, 0, 255)# Outline color for description text
@desctext = Color.new (255, 255, 255, 255)# Text color for description text
@incompoutline = Color.new(0, 0, 0, 255)# Outline color for incomplete objectives
@incomptext = Color.new(255, 0, 0, 255)# Text color for incomplete objectives
@compoutline = Color.new(0, 0, 0, 255)# Outline color for completed objectives
@comptext = Color.new(0, 255, 0, 255)# Text color for completed objectives
@menuoutline = Color.new(0, 0, 0, 255)# Outline color the in progress list
@menutext = Color.new(255, 255, 255, 255)# Text color for the in progress list
#-------------------------------------------------------------------------------
# This is the filename of the background picture for quests in progress:
@backpicture = "CompletedQuestScroll"
# It needs to be placed in the Graphics/Pictures folder.
#-------------------------------------------------------------------------------
# This is the data that is displayed when there are no quests active.
# I'll be using it to explain how to set up a quest, too:
@questname[0] = "" # This will be the name of your quest.
# This is the description for the quest. The format is:
# @description[quest number] = ["line 1", "line 2", "line 3", "etc..."]
# Note that if you have too many lines of description you can run out of room
# for objectives.
@description[0] = ["Brak ukończonych zadań"]
# The format is the same for @objectives if the quest has any.
#-------------------------------------------------------------------------------
# Quest 1
@questname[1] = "Odpocznij!"
@description[1] = ["Po ciężkiej bitwie z wilkami, nie jestem wstanie",
"dalej walczyć... Muszę wrócić do domu, położyć się",
"do łóżka i odpocząć."]
@objectives[1] = []
end
end
Screeny:
Spoiler:
Demo:
Dodatkowe informacje:
Pierwotna wersja skryptu tutaj:
http://save-point.org/thread-1872.html
(wystarczyło dobrze napisać Jaberwocky's quest log i znalazło od razu)
W demie edytowana jest scene_map:
Spoiler:
Kod:
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make sprite set
@spriteset = Spriteset_Map.new
# Make message window
@message_window = Window_Message.new
# Transition run
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of sprite set
@spriteset.dispose
# Dispose of message window
@message_window.dispose
# If switching to title screen
if $scene.is_a?(Scene_Title)
# Fade out screen
Graphics.transition
Graphics.freeze
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Loop
loop do
# Update map, interpreter, and player order
# (this update order is important for when conditions are fulfilled
# to run any event, and the player isn't provided the opportunity to
# move in an instant)
$game_map.update
$game_system.map_interpreter.update
$game_player.update
# Update system (timer), screen
$game_system.update
$game_screen.update
# Abort loop if player isn't place moving
unless $game_temp.player_transferring
break
end
# Run place move
transfer_player
# Abort loop if transition processing
if $game_temp.transition_processing
break
end
end
# Update sprite set
@spriteset.update
# Update message window
@message_window.update
# If game over
if $game_temp.gameover
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If returning to title screen
if $game_temp.to_title
# Change to title screen
$scene = Scene_Title.new
return
end
# If transition processing
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
if $game_temp.transition_name == ""
Graphics.transition(20)
else
Graphics.transition(40, "Graphics/Transitions/" +
$game_temp.transition_name)
end
end
# If showing message window
if $game_temp.message_window_showing
return
end
# If encounter list isn't empty, and encounter count is 0
if $game_player.encounter_count == 0 and $game_map.encounter_list != []
# If event is running or encounter is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.encounter_disabled
# Confirm troop
n = rand($game_map.encounter_list.size)
troop_id = $game_map.encounter_list[n]
# If troop is valid
if $data_troops[troop_id] != nil
# Set battle calling flag
$game_temp.battle_calling = true
$game_temp.battle_troop_id = troop_id
$game_temp.battle_can_escape = true
$game_temp.battle_can_lose = false
$game_temp.battle_proc = nil
end
end
end
# If Z button was pressed
if Input.trigger?(Input::Z)
unless $game_system.map_interpreter.running? or $game_system.menu_disabled
$game_system.se_play($data_system.decision_se)
$scene = Scene_Quests.new
end
end
# If B button was pressed
if Input.trigger?(Input::B)
# If event is running, or menu is not forbidden
unless $game_system.map_interpreter.running? or
$game_system.menu_disabled
# Set menu calling flag or beep flag
$game_temp.menu_calling = true
$game_temp.menu_beep = true
end
end
# If debug mode is ON and F9 key was pressed
if $DEBUG and Input.press?(Input::F9)
# Set debug calling flag
$game_temp.debug_calling = true
end
# If player is not moving
unless $game_player.moving?
# Run calling of each screen
if $game_temp.battle_calling
call_battle
elsif $game_temp.shop_calling
call_shop
elsif $game_temp.name_calling
call_name
elsif $game_temp.menu_calling
call_menu
elsif $game_temp.save_calling
call_save
elsif $game_temp.debug_calling
call_debug
end
end
end
#--------------------------------------------------------------------------
# * Battle Call
#--------------------------------------------------------------------------
def call_battle
# Clear battle calling flag
$game_temp.battle_calling = false
# Clear menu calling flag
$game_temp.menu_calling = false
$game_temp.menu_beep = false
# Make encounter count
$game_player.make_encounter_count
# Memorize map BGM and stop BGM
$game_temp.map_bgm = $game_system.playing_bgm
$game_system.bgm_stop
# Play battle start SE
$game_system.se_play($data_system.battle_start_se)
# Play battle BGM
$game_system.bgm_play($game_system.battle_bgm)
# Straighten player position
$game_player.straighten
# Switch to battle screen
$scene = Scene_Battle.new
end
#--------------------------------------------------------------------------
# * Shop Call
#--------------------------------------------------------------------------
def call_shop
# Clear shop call flag
$game_temp.shop_calling = false
# Straighten player position
$game_player.straighten
# Switch to shop screen
$scene = Scene_Shop.new
end
#--------------------------------------------------------------------------
# * Name Input Call
#--------------------------------------------------------------------------
def call_name
# Clear name input call flag
$game_temp.name_calling = false
# Straighten player position
$game_player.straighten
# Switch to name input screen
$scene = Scene_Name.new
end
#--------------------------------------------------------------------------
# * Menu Call
#--------------------------------------------------------------------------
def call_menu
# Clear menu call flag
$game_temp.menu_calling = false
# If menu beep flag is set
if $game_temp.menu_beep
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Clear menu beep flag
$game_temp.menu_beep = false
end
# Straighten player position
$game_player.straighten
# Switch to menu screen
$scene = Scene_Menu.new
end
#--------------------------------------------------------------------------
# * Save Call
#--------------------------------------------------------------------------
def call_save
# Straighten player position
$game_player.straighten
# Switch to save screen
$scene = Scene_Save.new
end
#--------------------------------------------------------------------------
# * Debug Call
#--------------------------------------------------------------------------
def call_debug
# Clear debug call flag
$game_temp.debug_calling = false
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Straighten player position
$game_player.straighten
# Switch to debug screen
$scene = Scene_Debug.new
end
#--------------------------------------------------------------------------
# * Player Place Move
#--------------------------------------------------------------------------
def transfer_player
# Clear player place move call flag
$game_temp.player_transferring = false
# If move destination is different than current map
if $game_map.map_id != $game_temp.player_new_map_id
# Set up a new map
$game_map.setup($game_temp.player_new_map_id)
end
# Set up player position
$game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
# Set player direction
case $game_temp.player_new_direction
when 2 # down
$game_player.turn_down
when 4 # left
$game_player.turn_left
when 6 # right
$game_player.turn_right
when 8 # up
$game_player.turn_up
end
# Straighten player position
$game_player.straighten
# Update map (run parallel process event)
$game_map.update
# Remake sprite set
@spriteset.dispose
@spriteset = Spriteset_Map.new
# If processing transition
if $game_temp.transition_processing
# Clear transition processing flag
$game_temp.transition_processing = false
# Execute transition
Graphics.transition(20)
end
# Run automatic change for BGM and BGS set on the map
$game_map.autoplay
# Frame reset
Graphics.frame_reset
# Update input information
Input.update
end
end
Potrzebne grafiki:
*Ikony*(można zrobić własne, wystarczy tak samo nazwać)
Pomógł: 15 razy Dołączył: 20 Kwi 2012 Posty: 186 Skąd: się biorą dzieci?
Wysłany: Sro 13 Cze, 2012 15:33
Fenix co mam zrobić gdy włączam grę daję nowa gra pokazuje się error: SyntaxError occured while running script. Nie mam żadnych innych skryptów... Daję nowe zdarzenie wpisuje dodaj zadanie ten kod
$game_temp.qupdate[1][Co mam tu wpisać?] = true
To się własnie tamten error pokazuje...
________________________ Jeśli pomogłem, daj
Spoiler:
POMÓGŁ
Uwielbiam się bawić na zdarzeniach w VX-ie... Więc jeśli masz jakieś pytanie jak coś zrobić na zdarzeniach to napisz. Jeśli będę wiedział to odpowiem
ściągnij demo, zrób wszystko jak tam. I nic masz tam nie wpisywać.
Poza tym ty tworzysz w XP czy VX(profil preferowany: VX) Zdecyduj się. Na VX ci nie pójdzie.
Ja mam problem :( po wklejeniu skryptu po naciśnięciu "D" na klawiaturze, nie wyskakuje Quest Log. ;\ Co może być nie tak?? Mam polską wersje z Twierdzy.
A podmieniłeś scene_map?
Dziennik wywołujesz: $scene = Scene_Quests.new
Możesz zawsze szukać skryptów na klawisze i pokombinować. Jeśli nic z tych rzeczy nie zadziała, to wiń tylko siebie za posiadanie polskiej wersji.
Edit:
Z nieznanych mi powodów plik został usunięty z serwera sendspace.com - nie przeze mnie, raczej przez sam serwer. Całe szczęście nie powinno to przeszkodzić w ściąganiu przez was owego skryptu. Życzę owocnych i udanych prac, oraz ciekawie napisanych zadań w owym dzienniku zadań. Pozdrawiam
Edit2:
Mały błąd, a raczej niedopatrzenie w komendzie na dodanie zadania do wykonanych, wystarczy dodać 2 na koniec qupdate.
Kod:
$game_temp.qupdate2[Numer_zadania][0] =
true
Tak to wygląda poprawnie, proszę o aktualizacje tylko tej linijki z kodem.
________________________
Ostatnio zmieniony przez Nhadala Czw 19 Lip, 2012 10:14, w całości zmieniany 1 raz
Mam problem. Dziennik działa normalnie, tylko jeśli nie ma w nim żadnych zadań. Gdy dodam zadanie komendą:
$game_temp.qupdate[1] =
true
i włączę dziennik, wyświetla się błąd:
????? 'qest log' ? 65 ??? NoMethodError ???????? undefined method '[]' for true:TrueClass
Gdy otwieram edytor skryptów, kursor pojawia się przy 65 linijce w której mam niezmiennie napisane:
if @questswitches[i][0] == true
Proszę o pomoc! Skrypt ciekawy, nieźle urozmaici grę, więc chciałbym go wykorzystać w moim projekcie. Dziękuję za fatygę :D
Edit:
Jakby co, demo nie działa poniewaź jest jakaś niezgodność z programem. Mam polskiego makera, chyba z twierdzy.
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach Nie możesz załączać plików na tym forum Możesz ściągać załączniki na tym forum