Fushigi - Pi± 14 Sty, 2011 22:32 Temat postu: Drzewko umiejÄ™tnoÅ›ci by DeitySabikku - Pi± 14 Sty, 2011 23:23 1. Skrypty zamieszczaj w znacznikach [ code ], inaczej tracÄ… cennÄ… tabulacjÄ™.
2. Jeśli czegoś nie umiesz, to tego nie rób... To tylko moje zdanie, ale - lepiej czytać coś po angielsku niż niezrozumiale przetłumaczone na polski. W tym stylu, no niestety, wywołuje to uśmiech na twarzy:
Kod:
# Aby wywołać skrypt musisz wywołać skrypt#
Kod:
# Teraz masz następujące uwagi których możesz użyć #
# <skills> needed_skill_id,needed_skill_id <skills_end> #
sprite.bitmap.draw_line(skill.place[0]+13, skill.place[1]+13, @skills[search_id(cond)].place[0]+13, @skills[search_id(cond)].place[1]+13, NOT_LEARNED_SKILL_COLOR, LINES_WIDTH, LINES_HEIGHT,SKIPPED_PXL)
end
end
end
rect = Rect.new(0,0,sprite.width,sprite.height)
self.contents.blt(0,0,sprite.bitmap,rect)
end
icons = []
for i in @actor.class.learnings
next if SkillTree_Skill.new(i.skill_id,@actor_id,i.level).hidden?
skill = [i.skill_id,@actor.skill_learn?($data_skills[i.skill_id])]
icons.push(skill)
end
for i in 0...icons.size
x = @skills[i].place[0].to_i
y = @skills[i].place[1].to_i
self.contents.fill_rect(x,y,26,26,SLOT_COLOR1)
self.contents.fill_rect(x+1,y+1,24,24,SLOT_COLOR2)
draw_icon($data_skills[icons[i][0]].icon_index, x+1, y+1, icons[i][1])
end
end
end
def search_id(skill_id)
id = 0
for i in 0...@skills.size
if @skills[i].id == skill_id
id = i
end
end
return id
end
end
class Window_SkillTreeInformationSmall < Window_Base
def initialize(x,y,width,heigth,skill_id,skills,actor_id)
super(x,y,width,heigth)
@bitmap = self.contents
@skills = skills
@actor = $game_party.members[actor_id]
refresh(skill_id) if skill_id != 0
end
def change_actor_id(actor_id)
@actor = $game_party.members[actor_id]
end
def refresh(skill_id)
if @skills.size > 0
@bitmap.clear
@bitmap.draw_text(0,0,self.width-32,24,@actor.name,0)
draw_actor_level(@actor, self.width-32-56, 0)
self.contents.font.color = system_color
@bitmap.draw_text(0,24,self.width-32,24,SKILL_POINTS + ":",0)
@bitmap.draw_text(0,84,self.width-32,24,SKILL_COST,0)
self.contents.font.color = normal_color
@bitmap.draw_text(0,24,self.width-32,24,@actor.skill_points.to_s,2)
@bitmap.draw_text(0,84,self.width-32,24,@skills[search_id(skill_id)].costs.to_s,2)
@bitmap.draw_text(0,54,self.width-32,24,$data_skills[skill_id].name,1)
@bitmap.draw_text(0,114,self.width-32,24,CONDITIONS,1)
y = 134
for i in @skills
if i.id == skill_id
@bitmap.font.color = NOT_LEARNED_SKILL_COLOR
if LEVEL_CONDITIONS
if @actor.level >= i.level
@bitmap.font.color = LEARNED_SKILL_COLOR
end
@bitmap.draw_text(0,y,self.width-32,24,SKILL_LEVEL + " " + i.level.to_s,0)
y += 22
end
for o in i.conditions
@bitmap.font.color = NOT_LEARNED_SKILL_COLOR
if @actor.skill_learn?($data_skills[o.to_i])
@bitmap.font.color = LEARNED_SKILL_COLOR
end
@bitmap.draw_text(0,y,self.width-32,24,$data_skills[o.to_i].name,0)
y += 22
end
end
end
@bitmap.font.color = Font.default_color
end
end
def search_id(skill_id)
for i in 0...@skills.size
if @skills[i].id == skill_id
return i
end
end
end
end
class Window_SkillTreeInformationBig < Window_Base
def initialize(x,y,width,heigth,skill_id,actor_id)
super(x,y,width,heigth)
self.visible = false
@bitmap = self.contents
@actor = $game_party.members[actor_id]
refresh(skill_id) if skill_id != 0
end
def change_actor_id(actor_id)
@actor = $game_party.members[actor_id]
end
def refresh(skill_id)
@bitmap.clear
skill = $data_skills[skill_id]
@bitmap.font.bold = true
@bitmap.draw_text(0,0,self.width-32,24,skill.name,1)
@bitmap.font.bold = false
@bitmap.draw_text(0,24,self.width-32,24,skill.description)
if skill.base_damage > 0
text = SKILL_DAMAGE + " " + skill.base_damage.to_s
else
text = SKILL_RECOVER + " " + (skill.base_damage * -1).to_s
end
@bitmap.draw_text(0,50,self.width/2-16,24,text,0)
@bitmap.draw_text(self.width/2-16,50,self.width/2,24,SKILL_COST + " " + skill.mp_cost.to_s,0)
eles = []
for i in skill.element_set
eles.push($data_system.elements[i])
end
@bitmap.font.bold = true
@bitmap.draw_text(0,74,self.width-32,24,SKILL_ELEMENTS,1)
@bitmap.font.bold = false
y = 74
for i in 0...eles.size
if i % 2 == 0
x = 0
y = y + 24
else
x = self.width/2
end
@bitmap.draw_text(x,y,self.width/2-16,24,eles[i],1)
end
y = y + 26
@bitmap.font.bold = true
@bitmap.draw_text(0,y,self.width-32,24,SKILL_STATE,1)
@bitmap.font.bold = false
y += 24
@bitmap.font.bold = true
@bitmap.draw_text(0,y,self.width/2-16,24,SKILL_ADD_STATE,1)
@bitmap.draw_text(self.width/2-16,y,self.width/2,24,SKILL_SUB_STATE,1)
@bitmap.font.bold = false
y += 24
z = y
for i in skill.plus_state_set
@bitmap.draw_text(0,z,self.width/2-16,24,$data_states[i].name,1)
z += 24
end
for i in skill.minus_state_set
@bitmap.draw_text(self.width/2-16,y,self.width/2,24,$data_states[i].name,1)
y += 24
end
end
end
class Scene_SkillTree < Scene_Base
def initialize(actor_id)
@viewport = Viewport.new(0,0,544,416)
@actor_id = actor_id
@actor = $game_party.members[actor_id]
@skills = []
@index = 0
for i in @actor.class.learnings
skill = SkillTree_Skill.new(i.skill_id,actor_id,i.level)
@skills.push(skill)
end
@info = Window_Help.new
if @actor.skills.include?($data_skills[@skills[@index].id])
@info.set_text(SKILL_LEARNED,1)
else
@info.set_text(LEARN_SKILL,1)
end
@skilltree = Window_SkillTree.new(0,56,544-240,416-56,actor_id,@skills)
if @skills.size > 0
@info_small =
def update_big_window
if Input.trigger?(Input::A)
if @info_big.visible == true
refresh_windows(@skills[@index].id) if @skills[@index] != nil
@info_big.visible = false
@info_small.visible = true
@skilltree.visible = true
@cursor.visible = true
else
@info.set_text(INFO_TEXT,1)
@info_big.visible = true
@info_small.visible = false
@skilltree.visible = false
@cursor.visible = false
end
end
end
def update_cursor
if Input.trigger?(Input::LEFT)
search_nearst_skill("left")
Sound.play_cursor
refresh_windows(@skills[@index].id) if @skills[@index] != nil
refresh_cursor(@skills[@index].place) if @skills[@index] != nil
elsif Input.trigger?(Input::RIGHT)
search_nearst_skill("right")
Sound.play_cursor
refresh_windows(@skills[@index].id) if @skills[@index] != nil
refresh_cursor(@skills[@index].place) if @skills[@index] != nil
elsif Input.trigger?(Input::UP)
search_nearst_skill("up")
Sound.play_cursor
refresh_windows(@skills[@index].id) if @skills[@index] != nil
refresh_cursor(@skills[@index].place) if @skills[@index] != nil
elsif Input.trigger?(Input::DOWN)
search_nearst_skill("down")
Sound.play_cursor
refresh_windows(@skills[@index].id) if @skills[@index] != nil
refresh_cursor(@skills[@index].place) if @skills[@index] != nil
end
end
def search_nearst_skill(direction)
sid = 0
skills = {}
for i in @skills
sid += 1 if i == @skills[@index]
next if i == @skills[@index]
case direction
when "up"
if i.place[1] < @skills[@index].place[1]
skills[sid] = ((i.place[0] - @skills[@index].place[0]).abs+(i.place[1] + 24 -
@skills[@index].place[1]).abs).abs
end
when "down"
if i.place[1] > @skills[@index].place[1]
skills[sid] = ((i.place[0] - @skills[@index].place[0]).abs+(i.place[1] - @skills[@index].place[1] +
24).abs).abs
end
when "right"
if i.place[0] > @skills[@index].place[0]
skills[sid] = ((i.place[0] - @skills[@index].place[0] + 24).abs+(i.place[1] -
@skills[@index].place[1]).abs).abs
end
when "left"
if i.place[0] < @skills[@index].place[0]
skills[sid] = ((i.place[0] + 24 - @skills[@index].place[0]).abs+(i.place[1] -
@skills[@index].place[1]).abs).abs
end
end
sid += 1
end
if !skills.empty?
skill = skills.invert.sort
id = 0
while @skills[skill[id][1]].hidden? do
id += 1
end
skill = skill[id][1]
@index = skill
return skill
else
return @index
end
end
def update_skill_confirm
if Input.trigger?(Input::C)
case @confirm.index
when 0
$game_party.members[@actor_id].learn_skill(@skills[@index].id)
@confirm.active = false
@confirm.visible = false
@actor.skill_points -= @skills[@index].costs
Sound.play_decision
refresh_windows(@skills[@index].id) if @skills[@index] != nil
when 1
@confirm.active = false
@confirm.visible = false
Sound.play_cancel
end
end
end
def refresh_windows(skill_id)
if @skills.size > 0
@info_small.refresh(skill_id)
@skilltree.refresh
@info_big.refresh(skill_id)
if @actor.skills.include?($data_skills[@skills[@index].id]) && !@info_big.visible
@info.set_text(SKILL_LEARNED,1)
else
@info.set_text(LEARN_SKILL,1)
end
else
@info.set_text(NO_LERNABLE_SKILLS,1)
end
end
def return_scene
$scene = LAST_SCENE + ".new"
end
def refresh_cursor(place)
if place != nil
@cursor.x = place[0] + 15
@cursor.y = place[1] + 71
else
@cursor.x = 25
@cursor.y = 81
end
end
end
class Game_Interpreter
def add_skill_points(party_member_id,points)
$game_party.members[party_member_id].skill_points += points
end
end
class Window_Base
def draw_actor_sp(actor,x,y)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 32, WLH, Deity::SkillTree::SHORT_SP_NAME)
self.contents.font.color = normal_color
self.contents.draw_text(x + 32, y, 24, WLH, actor.skill_points, 2)
end
alias refresh_skilltree_status refresh unless $@
def refresh
refresh_skilltree_status
draw_actor_sp(@actor,300,0)
end
end
end
superbaton - Sob 15 Sty, 2011 11:37 Thx wlasnie tego skryptu szukalem nareszcie:)polek - Sob 30 Kwi, 2011 08:42 Co on robi ?
w sensie dokÅ‚adniej i jakiÅ› screenshot z niegopolek - Sob 30 Kwi, 2011 16:52 nie dziaÅ‚a [demo]Ayene - Sob 30 Kwi, 2011 23:24 Nie możesz otworzyć dema? Skorzystać z tego tutoriala http://www.ultimateam.pl/viewtopic.php?t=2583MrBoomGood - Pi± 17 Cze, 2011 20:48 Czy ja dobrze zrozumiaÅ‚em? On dziaÅ‚a tak: JesteÅ› sobie magiem i jak rozwijasz jakieÅ› umiejÄ™tnoÅ›ci to możesz zostac Magiem Leczenia, albo ognia?Angius - Nie 19 Cze, 2011 13:31 Na pewno dobrze skopiowaÅ‚eÅ› skrypt? Bo wyglÄ…da na to, że coÅ› jest nie tak z metodÄ… "learnings", coÅ› z klasÄ…. Spróbuj skopiować ten skrypt raz jeszcze i odpowiednio go skonfiguruj. Albo wklej go do czystego projektu.Berkor - Nie 19 Cze, 2011 16:27 WkleiÅ‚em do nowego projektu i nic. Nie pomaga to. Ale dziÄ™ki za pomoc.sawik99 - Czw 05 Sty, 2012 14:47 Jak tu dodać nowÄ… umiejÄ™tność do tego drzewkaVrona - Czw 05 Sty, 2012 16:14 CiÄ…gle sÅ‚yszÄ™ "a jak","a jak","a jak" i to zaczyna mnie denerwować.
InstrukcjÄ™ masz w skrypcie.sawik99 - Pi± 06 Sty, 2012 23:59 A może jakaÅ› prostsza instrukcjaAyene - Sob 07 Sty, 2012 00:01 A sprawdzaÅ‚eÅ› demo? sawik99 - Sob 07 Sty, 2012 00:27 SprawdziÅ‚em ale nie rozumiem za bardzoAyene - Sob 07 Sty, 2012 00:33 W takim razie zacznij od czegoÅ› prostszego. WiÄ™kszość skryptów nie jest 'noob friendly', dlatego nie jest zalecana dla poczÄ…tkujÄ…cych twórców. JeÅ›li nie rozumiesz dema, to tym bardziej nikt Tobie nie pomoże. Poszukaj może czegoÅ› innego, Å‚atwiejszego, nie tak rozbudowanego. Czasami proste rozwiÄ…zania dajÄ… lepsze efekty.sawik99 - Pon 23 Sty, 2012 00:42 Już go rozgryzÅ‚em:) UżyjÄ™ go do swego projektu.darkknights - Sob 30 Mar, 2013 17:13 KtoÅ› może zrobić by dziaÅ‚aÅ‚o na ring menu!Prosze