Witam przedstawiam wam QuestLog, mojego autorstwa, wyglÄ d "zgapiĹem" z Melvina QuestLoga, wiÄc dla niego podziÄkowania.
Screen:
Spoiler:
Sorry za jakoĹÄ, ale chciaĹem Ĺźeby mniej waĹźyĹo.
Skrypt wymaga ATP by Samo, The thief.
ATP:
Spoiler:
Kod:
=begin
ATP(Advanced Text Paragrapher) V1.0 by Samo, The thief
Ok, Something of The Scripters do normally to draw a text in form of a paragraph is
doing an array [] that contains each line. The Time Has come For
This Microsoft Word Effect!
This Script Just need a Long String and it will paragraph it!
How to call it?
paragraph = str_paragraph(string, width of the paragraph.)
Example :
@my_paragraph = str_paragraph("La la la la la la la la la , This is a Looooong Strriiiing!", 120)
Returns an Array with each line separately.
How to draw it?
draw_paragraph(x,y,width,height, paragraph)
width and height for each line, not for the paragraph.
.::-NOTE-::.
If you put a ' ^ '(must be between spaces), the text will pass to the next line.
This Symbol Won't be drawed.
Reminder: Always use '' instead of ""! It works faster!
=end
class Window_Base < Window
#--------------------------------------------------
def str_paragraph(str_old, width)
temp_str = ''
str = '' + str_old
words = []
size = 0
str_size = 0
#
while ((c = str.slice!(/./m)) != nil)
temp_str += c
str_size += 1
if c == ' '
words.push(temp_str)
temp_str = ''
end
if str.size == 0
words.push(temp_str)
temp_str = ''
end
end
lines = []
for i in 0...words.size
word = words[i]
if word == '^ '
lines.push(temp_str)
temp_str = ''
next
end
temp_str += word
size = contents.text_size(temp_str).width
if size > width - contents.text_size(' ').width
for i in 1..word.size
temp_str = temp_str.chop
end
lines.push(temp_str)
temp_str = ''
temp_str += word
end
end
words = words.compact
if temp_str != ''
lines.push(temp_str)
end
return lines
end
#---------------------------------------------------------------------
def draw_paragraph(x,y,width,height,lines,align = 0)
for i in 0...lines.size
self.contents.draw_text(x, y + i * self.contents.font.size + 1, width, height, lines[i], align)
end
end
#-----------------------------------------------------------------
end
QuestLog wersja poprawiona:
Spoiler:
Kod:
=begin
Author: HellKiller
Version: 1.01
=end
Ikona = "032-item01"
class Game_Party
alias :questlog_hellkiller_initialize :initialize
attr_accessor :all_quest
def initialize
questlog_hellkiller_initialize
# $quest = ["nazwa", "opis", kasa, "nagroda", trudnosc]
@quest = []
@quest_done = []
@all_quest = 1
end
def quest
return @quest
end
def quest_done
return @quest_done
end
def add_quest(quest)
@quest.push(quest) if not @quest.include?(quest)
end
def add_quest_done(quest)
@quest_done.push(quest) if @quest.include?(quest)
@quest.delete(quest)
end
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...$game_party.quest.size
@data.push($game_party.quest[i])
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $defaultfonttype # "Items" window font
self.contents.font.size = $defaultfontsize
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x = 8
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(x , y, 212, 32, item[0], 0)
end
end
class QuestLog
def initialize
@quest = $game_party.quest
end
$quest naleĹźy zmieniaÄ na np. $quest1, $quest2 itd., Ĺźeby nie nastÄ piĹy jakieĹ komplikacje.
3 "Jak zmieniÄ ikonÄ" ?
- w jednej z pierwszych linijek jest
Kod:
Ikona
w niej jest podana nazwa ikony, zmieĹ jÄ i ciesz siÄ nowÄ ikonÄ .
Credits:
HellKiller
Melvin - wzorowaĹem siÄ wyglÄ dowo na jego skrypcie (nie wiem czy go dawaÄ, ale ,Ĺźeby nie byĹo :D)
Ostatnio zmieniony przez Nhadala Wto 03 Sie, 2010 10:23, w całości zmieniany 2 razy
[size=14pt]Zmiany w 1.5:[/size]
- moĹźliwoĹÄ wyĹÄ czenia dwĂłch okienek odpowiedzialne za informowanie o wszystkich zadaniach i o iloĹci ukoĹczonych zadaniach
- zmieniony wyglÄ d
- pokazywanie obrazka
- poprawione bĹÄdy
- zmienione tworzenie zadaĹ - szczegĂłĹy FAQ pytanie #2
Skrypt od czasu do czasu bÄdzie ulepszany.
Screen z wersji 1.0:
Przepraszam za stary screen ,ale nie mam moĹźliwoĹci wrzuciÄ nowego.
Skrypt wymaga ATP by Samo, The thief.
ATP:
Spoiler:
Kod:
=begin
ATP(Advanced Text Paragrapher) V1.0 by Samo, The thief
Ok, Something of The Scripters do normally to draw a text in form of a paragraph is
doing an array [] that contains each line. The Time Has come For
This Microsoft Word Effect!
This Script Just need a Long String and it will paragraph it!
How to call it?
paragraph = str_paragraph(string, width of the paragraph.)
Example :
@my_paragraph = str_paragraph("La la la la la la la la la , This is a Looooong Strriiiing!", 120)
Returns an Array with each line separately.
How to draw it?
draw_paragraph(x,y,width,height, paragraph)
width and height for each line, not for the paragraph.
.::-NOTE-::.
If you put a ' ^ '(must be between spaces), the text will pass to the next line.
This Symbol Won't be drawed.
Reminder: Always use '' instead of ""! It works faster!
=end
class Window_Base < Window
#--------------------------------------------------
def str_paragraph(str_old, width)
temp_str = ''
str = '' + str_old
words = []
size = 0
str_size = 0
#
while ((c = str.slice!(/./m)) != nil)
temp_str += c
str_size += 1
if c == ' '
words.push(temp_str)
temp_str = ''
end
if str.size == 0
words.push(temp_str)
temp_str = ''
end
end
lines = []
for i in 0...words.size
word = words[i]
if word == '^ '
lines.push(temp_str)
temp_str = ''
next
end
temp_str += word
size = contents.text_size(temp_str).width
if size > width - contents.text_size(' ').width
for i in 1..word.size
temp_str = temp_str.chop
end
lines.push(temp_str)
temp_str = ''
temp_str += word
end
end
words = words.compact
if temp_str != ''
lines.push(temp_str)
end
return lines
end
#---------------------------------------------------------------------
def draw_paragraph(x,y,width,height,lines,align = 0)
for i in 0...lines.size
self.contents.draw_text(x, y + i * self.contents.font.size + 1, width, height, lines[i], align)
end
end
#-----------------------------------------------------------------
end
class Game_Party
alias :questlog_hellkiller_initialize :initialize
attr_accessor :all_quest
def initialize
questlog_hellkiller_initialize
# $quest = ["nazwa", "opis", kasa, "nagroda", trudnosc, "obrazek"]
@quest = []
@quest_done = []
@quest_x = []
@all_quest = 1
end
def quest_x
return @quest_x
end
def quest
return @quest
end
def quest_done
return @quest_done
end
def add_quest(quest)
@quest.push(quest) if not @quest.include?(quest)
end
def add_quest_done(quest)
@quest_done.push(quest) if @quest.include?(quest)
@quest.delete(quest)
end
def add_quest_x(quest)
@quest_x.push(quest) if @quest.include?(quest)
@quest.delete(quest)
end
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...$game_party.quest.size
@data.push($game_party.quest[i])
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $defaultfonttype # "Items" window font
self.contents.font.size = $defaultfontsize
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x = 8
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if @item_max > 0
self.contents.draw_text(x , y, 212, 32, item[0], 0)
else
self.contents.draw_text(x , y, 212, 32, item, 0)
end
end
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...$game_party.quest_done.size
@data.push($game_party.quest_done[i])
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $defaultfonttype # "Items" window font
self.contents.font.size = $defaultfontsize
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x = 8
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if @item_max > 0
self.contents.draw_text(x , y, 212, 32, item[0], 0)
else
self.contents.draw_text(x , y, 212, 32, item, 0)
end
end
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...$game_party.quest_x.size
@data.push($game_party.quest_x[i])
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = $defaultfonttype # "Items" window font
self.contents.font.size = $defaultfontsize
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x = 8
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
if @item_max > 0
self.contents.draw_text(x , y, 212, 32, item[0], 0)
else
self.contents.draw_text(x , y, 212, 32, item, 0)
end
end
end
class QuestLog
def initialize
@quest = $game_party.quest
end
$quest naleĹźy zmieniaÄ na np. $quest1, $quest2 itd., Ĺźeby nie nastÄ piĹy jakieĹ komplikacje.
3 "Jak zmieniÄ ikonÄ" ?
- w jednej z pierwszych linijek jest
Kod:
Ikona
w niej jest podana nazwa ikony, zmieĹ jÄ i ciesz siÄ nowÄ ikonÄ .
4. "Jak wywoĹaÄ dziennik ?"
- wystarczy Ĺźe wywoĹasz skrypt i wpiszesz
Kod:
$scene = QuestLog.new
5. "Jak dodaÄ zadania ukoĹczone ?"
dodajemy je podobnie jak z zwykĹym zadaniem poprzez wywoĹanie skryptu i wpisaniu:
Kod:
$game_party.add_quest_done(quest)
, gdzie quest w nawiasie oznacza nazwÄ zadania
6 "Jak dodaÄ zniszczone(?) zadania" ?
dodajemy je podobnie jak z zwykĹym zadaniem poprzez wywoĹanie skryptu i wpisaniu:
Kod:
$game_party.add_quest_x(quest)
, gdzie quest w nawiasie oznacza nazwÄ zadania
Credits:
HellKiller
Ostatnio zmieniony przez kamillo112 Pią 03 Gru, 2010 15:34, w całości zmieniany 1 raz
________________________ ...Amelanduil & FireBlade words will be remembered... ...Amelanduil & FireBlade acts will be remembered... ...Amelanduil & FireBlade never gonna die...
Ĺťeby zadziaĹaĹo potrzeba wkleiÄ do main:
Kod:
$defaultfonttype = "Times New Roman"
$defaultfontsize = 26
Nie dziaĹa( wrÄcz wyskakuje bĹÄ d)
Kod:
1: "Jak dodajemy zadania" ?
- dodajemy je poprzez wywoĹanie skryptu i wpisaniu:
Kod:
$game_party.add_quest(quest)
, gdzie quest w nawiasie oznacza nazwÄ zadania
2: "Jak robiÄ zadania" ?
- dobrze jest zaĹoĹźyÄ pustÄ kartÄ i w niej wpisywaÄ, wedĹug wzoru:
Kod:
$quest = ["nazwa", "opis", kasa, "nagroda", trudnosc, "obrazek"]
$quest naleĹźy zmieniaÄ na np. $quest1, $quest2 itd., Ĺźeby nie nastÄ piĹy jakieĹ komplikacje.
3 "Jak zmieniÄ ikonÄ" ?
- w jednej z pierwszych linijek jest
Kod:
Ikona
w niej jest podana nazwa ikony, zmieĹ jÄ i ciesz siÄ nowÄ ikonÄ .
4. "Jak wywoĹaÄ dziennik ?"
- wystarczy Ĺźe wywoĹasz skrypt i wpiszesz
Kod:
$scene = QuestLog.new
5. "Jak dodaÄ zadania ukoĹczone ?"
dodajemy je podobnie jak z zwykĹym zadaniem poprzez wywoĹanie skryptu i wpisaniu:
Kod:
$game_party.add_quest_done(quest)
, gdzie quest w nawiasie oznacza nazwÄ zadania
6 "Jak dodaÄ zniszczone(?) zadania" ?
dodajemy je podobnie jak z zwykĹym zadaniem poprzez wywoĹanie skryptu i wpisaniu:
Kod:
$game_party.add_quest_x(quest)
, gdzie quest w nawiasie oznacza nazwÄ zadania
Nie dziaĹa (wyskakuje jeszcze inny bĹÄ d)
A problem jest taki Ĺźe dziaĹaĹo przez moment, a potem siÄ wyĹÄ czyĹo.
Czy mogÄ prosiÄ o konkretne rady typu:
-Jak zaĹoĹźyÄ pustÄ kartÄ i w niej wpisywaÄ, wedĹug wzoru [...] ?
- jak wywoĹaÄ dziennik ( ta opcja nie dziaĹa w ogĂłle)?
________________________ ...Amelanduil & FireBlade words will be remembered... ...Amelanduil & FireBlade acts will be remembered... ...Amelanduil & FireBlade never gonna die...
PozwoliĹem sobie przeedytowaÄ, tak Ĺźeby dziaĹaĹo takĹźe na angielskim makerze:
Spoiler:
Kod:
=begin
Author: HellKiller
Version: 1.01
=end
Ikona = "032-item01"
class Game_Party
alias :questlog_hellkiller_initialize :initialize
attr_accessor :all_quest
def initialize
questlog_hellkiller_initialize
# $quest = ["nazwa", "opis", kasa, "nagroda", trudnosc]
@quest = []
@quest_done = []
@all_quest = 1
end
def quest
return @quest
end
def quest_done
return @quest_done
end
def add_quest(quest)
@quest.push(quest) if not @quest.include?(quest)
end
def add_quest_done(quest)
@quest_done.push(quest) if @quest.include?(quest)
@quest.delete(quest)
end
end
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
for i in 0...$game_party.quest.size
@data.push($game_party.quest[i])
end
@item_max = @data.size
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * 32)
self.contents.font.name = "Comic Sans MS"
self.contents.font.size = 22
for i in 0...@item_max
draw_item(i)
end
end
end
def draw_item(index)
item = @data[index]
x = 8
y = index * 32
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
self.contents.draw_text(x , y, 212, 32, item[0], 0)
end
end
class QuestLog
def initialize
@quest = $game_party.quest
end
To zgadujÄ Ĺźe masz polskÄ wersjÄ. JedynÄ radÄ jest to, ĹźebyĹ ĹciÄ gnÄ Ĺ sobie angielskÄ wersjÄ.
________________________ ...Amelanduil & FireBlade words will be remembered... ...Amelanduil & FireBlade acts will be remembered... ...Amelanduil & FireBlade never gonna die...
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