While I was working on my first project I wanted to make my own Quest System. So I started off with adding a Quest Board first. Instead of making some message windows I wanted to script my own thing. I started to watch GubiD's tutorials on YouTube. And I've read some Ruby scripting tutorials on else places. And started to work a few hours ago. This is what I came up with. I wanted to share my result because this is the first thing I've scripted. I hope you tell me how it is going.
(And by the way I hope this is the correct forum to post this.)
Features So Far
-Shows quests and its descriptions.
-Can disable, enable quests with a script call.
//This is done with the following call:
Code:
The "index" here is quest id.[I]DrakathQBQ::QUESTS[index][2][/I]Screenshot


Updates
-Added disabling and enabling quests with a script call. //21.07.2012
-Changed how things were being handled. //21.07.2012
So What?
Those screenshots show everything. I just made some windows added some scene to show those windows. I'm going to improve things as I learn much more about RGSS2 scripting.
Gimme the Script!
OK, OK calm down. Here is the script.
1.2(new)
Spoiler
Code:
#############################################
#Set your quest variables here. #
#Quest ID => [Quest Name, Details, enabled?]#
#############################################
module DrakathQBQ
QUESTS ={
0 => ["Giadron Hunt", "Go and hunt a Giadron!", true],
1 => ["Hythron Hunt", "Hunt a Hynthron", false],
2 => ["Hunt for you", "Hunty hunty", true]
}
end
##################################
#This one is quest detail window.#
##################################
class DrakathQBDetail < Window_Base
def initialize
super(32,32,480,352)
self.opacity = 255
refresh
end
def refresh
create_contents
self.contents.draw_text(0,0,456,40,DrakathQBQ::QUESTS[$qlist_id][0])
self.contents.draw_text(0,40,456,WLH,DrakathQBQ::QUESTS[$qlist_id][1])
end
end
##########################
#Here is our board scene.#
##########################
class DrakathQBScene < Scene_Base
def start
my_size = DrakathQBQ::QUESTS.size - 1
s ={}
@quest_data ={}
for i in 0..my_size
@quest_data = DrakathQBQ::QUESTS
s[i]=DrakathQBQ::QUESTS[i][0]
end
@questb_window = Window_Command.new(480, s, 32, 32, 1, 11)
draw_quest_item
end
def draw_quest_item
my_size = DrakathQBQ::QUESTS.size - 1
for i in 0..2
unless @quest_data[i][2] == true
@questb_window.draw_item(i, false)
end
end
@questb_window.active = true
@questb_window.index = 0
end
def update
@questb_window.update
if Input.trigger?(Input::
$scene = Scene_Map.new
end
if Input.trigger?(Input::C)
unless @quest_data[@questb_window.index][2] == false
$qlist_id = @questb_window.index
Sound.play_decision
$scene = DrakathQBDetailScene.new
else
Sound.play_buzzer
end
end
end
def terminate
@questb_window.dispose
end
end
###############################
#This one is our detail scene.#
###############################
class DrakathQBDetailScene < Scene_Base
def start
@my_window123 = DrakathQBDetail.new
end
def update
@my_window123.update
if Input.trigger?(Input::
$scene = DrakathQBScene.new
end
end
def terminate
@my_window123.dispose
end
endSpoiler
Code:
################################
#Set your quest variables here. #
################################
module DrakathQBQ
QUESTS ={}
QUESTS[0] = "Giadron Hunt"
QUESTS[1] = "Hythron Hunt"
QUESTS[2] = "Glydra Slay"
QUESTS[3] = "Rare Lily Collect"
QUESTS[4] = "Draugr Killer"
QUEST_DATA ={ }
QUEST_DATA[0] ="Go and hunt a Giadron!"
QUEST_DATA[1] ="Go and hunt a Hythron!"
QUEST_DATA[2] ="Go and slay 5 Glydras!"
QUEST_DATA[3] ="Go collect a Rare Lily!"
QUEST_DATA[4] ="Go and kill a Draugr"
end
#######################
#This is board window. #
#######################
class DrakathQBWindow < Window_Selectable
def initialize
super(32, 32, 480, 352)
self.opacity = 255
refresh
end
def refresh #This makes content to be drawn.
@item_max = DrakathQBQ::QUESTS.size
create_contents
for i in 0..@item_max
draw_quest_enable(i)
end
end
def draw_quest_enable(index) #And this actually draws content.
rect = item_rect(index)
self.contents.draw_text(rect, DrakathQBQ::QUESTS[index])
end
end
##################################
#This one is quest detail window. #
##################################
class DrakathQBDetail < Window_Base
def initialize
super(32,32,480,252)
self.opacity = 255
refresh
end
def refresh
create_contents
self.contents.draw_text(0,0,456,40,DrakathQBQ::QUESTS[$qlist_id])
self.contents.draw_text(0,40,456,WLH,DrakathQBQ::QUEST_DATA[$qlist_id])
end
end
##########################
#Here is our board scene. #
##########################
class DrakathQBScene < Scene_Base
def start
@my_window134 = DrakathQBWindow.new
@my_window134.active = true
@my_window134.index = 0
end
def update
@my_window134.update
if Input.trigger?(Input::
$scene = Scene_Map.new
end
if Input.trigger?(Input::C)
$qlist_id = @my_window134.index
Sound.play_decision
$scene = DrakathQBDetailScene.new
end
end
def terminate
@my_window134.dispose
end
end
###############################
#This one is our detail scene. #
###############################
class DrakathQBDetailScene < Scene_Base
def start
@my_window123 = DrakathQBDetail.new
end
def update
@my_window123.update
if Input.trigger?(Input::
$scene = DrakathQBScene.new
end
end
def terminate
@my_window123.dispose
end
endI could not see written and detailed RGSS2 scripting tutorials around. GubiD's tutorials are great to learn but I watched 3 parts of a cooking script tutorial (Each 18 mins.) to learn how to use command choises. If you know any written tutorial can you lead me to them?
Sorry if the above question should not been asked here. Tell it to me and ignore it if that's the case.
OOPPPSSS I WAS ALMOST ABOUT TO FORGOT!!!
It might not be something much but DO NOT CLAIM THIS AS YOUR OWN WORK!