Wsparcie [XP] - Wyświetlanie obrazka jako tła w HellKiller Questlog
xGamerPLz - Sob 09 Lut, 2013 19:23 Temat postu: Wyświetlanie obrazka jako tła w HellKiller QuestlogWitam! Jak zrobić żeby jako tło do tego skryptu był wyświetlany obrazek "questlog.png"
Skrypt:
Spoiler:
Kod:
=begin
Author: HellKiller
Version: 1.01
=end
Ikona = "032-item01"
OP = 100
class Game_Party
alias :questlog_hellkiller_initialize :initialize
attr_accessor :all_quest
def initialize
questlog_hellkiller_initialize
# $quest = ["nazwa", "opis", kasa, "nagroda", trudnosc]
$quest1 = ["nazwa", "opis", 555, "nagroda", 5]
@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
self.back_opacity = (OP)
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.back_opacity = (OP)
self.contents.draw_text(x , y, 212, 32, item[0], 0)
end
end
class QuestLog
def initialize
@quest = $game_party.quest
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(0, 0, 80, 32, "Trudnosc:")
self.contents.font.color = normal_color
self.contents.draw_text(90, 0, 120, 32, "Bardzo łatwy") if @quest == 0
self.contents.draw_text(90, 0, 120, 32, "Łatwy") if @quest == 1
self.contents.draw_text(90, 0, 120, 32, "Średni") if @quest == 2
self.contents.draw_text(90, 0, 120, 32, "Trudny") if @quest == 3
self.contents.draw_text(90, 0, 120, 32, "Bardzo trudny") if @quest == 4
self.contents.draw_text(90, 0, 120, 32, "Hiper Trudny") if @quest == 5
end
def update
refresh
end
end
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
Ayene - Sob 09 Lut, 2013 22:20 Poza obrazkiem, ma się wyświetlać w tle mapa?xGamerPLz - Sob 09 Lut, 2013 23:55 tak, ale to już zrobiłem został tylko ten obrazek z którym się okropnie męczę.Ayene - Nie 10 Lut, 2013 00:23 Znajdź fragment:
xGamerPLz - Nie 10 Lut, 2013 21:44 OK! Działa ale jak zrobić żeby po otwarciu questloga usunęły się wszystkie obrazki z mapy (fog, maska świetlna itp.)Ayene - Nie 10 Lut, 2013 23:00 Znajdź fragment:
Kod:
@spriteset = Spriteset_Map.new
zamień na:
Kod:
@spriteset = Spriteset_Map_QuestLog.new
następnie znajdź:
Kod:
if $scene.is_a?(Scene_Title)
dodaj przed:
Kod:
@spriteset.dispose
Na samym dole skryptu dodaj:
Spoiler:
Kod:
class Spriteset_Map_QuestLog
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
@viewport1 = Viewport.new(0, 0, 640, 480)
@tilemap = Tilemap.new(@viewport1)
@tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
for i in 0..6
autotile_name = $game_map.autotile_names[i]
@tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
end
@tilemap.map_data = $game_map.data
@tilemap.priorities = $game_map.priorities
@panorama = Plane.new(@viewport1)
@panorama.z = -1000
@character_sprites = []
for i in $game_map.events.keys.sort
sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
@character_sprites.push(sprite)
end
@character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
end
#--------------------------------------------------------------------------
# * Dispose
#--------------------------------------------------------------------------
def dispose
@tilemap.tileset.dispose
for i in 0..6
@tilemap.autotiles[i].dispose
end
@tilemap.dispose
@panorama.dispose
for sprite in @character_sprites
sprite.dispose
end
@viewport1.dispose
end
end
xGamerPLz - Pon 11 Lut, 2013 09:46 Wszystko działa, ale po otwarciu dziennika a potem np. ekwipunku wyskakuje, że rgss przestał działać :(Ayene - Pon 11 Lut, 2013 10:56 A przed wprowadzeniem korekt wszystko działało? Pisałam już że skrypt jest mocno niezoptymalizowany. Nie usuwał domyślnie spriteseta mapy przez co po trzykrotnym wejściu do QuestLoga gra się zawieszała. Korekty, które wprowadziłam nie są na tyle poważne, aby siadał program. Problem leży po stronie samego skryptu na dziennik.xGamerPLz - Pon 11 Lut, 2013 13:23 Czyli z użycia questlogu nici? Jaki dziennik polecasz? Bo nie ogarniam zbytnio Jaberwocky, a inne mi nie pasują, bo to trudne do ogarnięcia, bo to po otwarciu otwiera się małe okienko z podziałem itp.Ayene - Czw 21 Lut, 2013 23:27 Przykro mi, ale w kwestii ogarniania to nie jestem dobrym doradcą, bo to który jest dla Ciebie najlepszy / najłatwiejszy, możesz tylko Ty zdecydować. Przejrzyj na spokojnie zasoby, może uda się Tobie coś znaleźć. Pewnie do tych bardziej rozbudowanych skryptów można znaleźć jakieś tutoriale.