hello, im after a custom skill scene.
the features i want are
something to show its attack power and attribute.
and thats it really.
thanks in advance
"Attribute" as in element? Like Fire, Darkness, Anti-Undead, Anti-Angel, etc? (The "Element Names" list in the System tab of RMXP), right?
For the elements, do you want text or do you want to use icons?
The power is a simple edit. I'll get back to you soon.
EDIT:
The power mod. It displays power : sp_cost instead of just sp_cost.
Paste this just below Window_Skill.
class Window_Skill
alias win_skill_power_mod_draw_item draw_item
def draw_item(index)
win_skill_power_mod_draw_item(index)
skill = @data[index]
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
txt = "#{skill.power} : #{skill.sp_cost}"
self.contents.fill_rect(x+196, y, 84, 32, Color.new(0, 0, 0, 0))
self.contents.draw_text(x + 196, y, 84, 32, txt, 2)
end
end
This is of course assuming that you're using the DMS. If you're using anything else, let me know.
yeh i ment the elements, and thanks for helping agian
aslo im using stormtronics cms but i have disable it when in the skill scene.
ok i got it working but you cant tell what is the sp cost or the strenth. is it posible to label them with SP (Skill points) and S (Strenth)
Just type out how you want it to look.
o yeh. silly me. :^_^':
i didnt see how it was done but iv spotted the part now to add the SP and S.
and thanks agian :up:
np :)
ahh fogot some thing, is it posible to have each skills attribute (element) as an icon after the sp cost and stuff. i know this would be abit more arwcward so it would mean a huge powersup if any one want to do it. it would prob be better if it was made so if i add a new atribute i can add it to the script then choose the icon for it by puting what icon from the icon file i want it to have.
i hope i made sense.
Quoteit would prob be better if it was made so if i add a new atribute i can add it to the script then choose the icon for it by puting what icon from the icon file i want it to have.
You mean you'll define an icon for each attribute in the script and that icon should show up near thr SP Cost? It isn't that hard. I'll get to it.
EDIT: What if a skill has more than one element? Things might get cramped. Give me a layout on how a line looks like.
ok iv been looking at it and it would be very crampt, is it posible to have them in the discription, becuase there is loads of room in there.
p.s. the icons are smaller then the average icon so they will fit the hight of the discription box
By description, do you mean the help window at the top? Yeah, that can totally work.
yeah, there would be great
Here it is.
class Window_Skill
def get_element_icon(id)
b = case id
#::::::::::::::::::::::::::::::::::::::::::::::::
# CONFIG BEGIN
#::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then '037-Item06'
when 2 then '035-Item04'
when 3 then '044-Skill01'
# when ID then ICON_FILE_NAME
#::::::::::::::::::::::::::::::::::::::::::::::::
# CONFIG END
#::::::::::::::::::::::::::::::::::::::::::::::::
else
''
end
return RPG::Cache.icon(b) if b != ''
end
alias win_skill_power_mod_draw_item draw_item
def draw_item(index)
win_skill_power_mod_draw_item(index)
skill = @data[index]
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
txt = "#{skill.power} : #{skill.sp_cost}"
self.contents.fill_rect(x+196, y, 84, 32, Color.new(0, 0, 0, 0))
self.contents.draw_text(x + 196, y, 84, 32, txt, 2)
end
alias win_skill_element_mod_upd_hlp update_help
def update_help
win_skill_element_mod_upd_hlp
skill = @data[self.index]
elements = skill.element_set
return if elements.size < 1
gap = 2
elements.each_with_index {|id, i| x = 604 - (i + 1) * (24 + gap)
self.help_window.contents.fill_rect(x, 4, 24, 24, Color.new(0, 0, 0, 0))
bitmap = get_element_icon(id)
next if bitmap = nil
opacity = self.contents.font.color == normal_color ? 255 : 128
self.help_window.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
}
end
end
It will draw the icons from the right side corner.
ok, iv got an error.
when i added this script the other script had an error. on line 5 and it said stack level to high.
Oh, both are the same. Delete the old one.
ok, new error. sorry
its on line 47, cant convert NilClass into bitmap.
Sorry, stupid mistakes ^_^'
class Window_Skill
def get_element_icon(id)
b = case id
#::::::::::::::::::::::::::::::::::::::::::::::::
# CONFIG BEGIN
#::::::::::::::::::::::::::::::::::::::::::::::::
when 1 then '037-Item06'
when 2 then '035-Item04'
when 3 then '044-Skill01'
# when ID then ICON_FILE_NAME
#::::::::::::::::::::::::::::::::::::::::::::::::
# CONFIG END
#::::::::::::::::::::::::::::::::::::::::::::::::
else
''
end
return nil if b != ''
return RPG::Cache.icon(b)
end
alias win_skill_power_mod_draw_item draw_item
def draw_item(index)
win_skill_power_mod_draw_item(index)
skill = @data[index]
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
txt = "#{skill.power} : #{skill.sp_cost}"
self.contents.fill_rect(x+196, y, 84, 32, Color.new(0, 0, 0, 0))
self.contents.draw_text(x + 196, y, 84, 32, txt, 2)
end
alias win_skill_element_mod_upd_hlp update_help
def update_help
win_skill_element_mod_upd_hlp
skill = @data[self.index]
elements = skill.element_set
return if elements.size < 1
gap = 2
elements.each_with_index {|id, i| x = 604 - (i + 1) * (24 + gap)
self.help_window.contents.fill_rect(x, 4, 24, 24, Color.new(0, 0, 0, 0))
bitmap = get_element_icon(id)
next if bitmap == nil
opacity = self.contents.font.color == normal_color ? 255 : 128
self.help_window.contents.blt(x, 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
}
end
end
ok, i have no errors know but i dont see any icons. i have placed the name of the icons i wanted and aslo used the one that were already in the script but non of them showed.
o.o I'll check it out... hang on.
ok, take your time. there is no rush
It's done :)
class Window_Skill
def get_element_icon(id)
b = case id
#::::::::::::::::::::::::::::::::::::::::::::::::
# CONFIG BEGIN
#::::::::::::::::::::::::::::::::::::::::::::::::
when 100 then '037-Item06'
# when ID then ICON_FILE_NAME
#::::::::::::::::::::::::::::::::::::::::::::::::
# CONFIG END
#::::::::::::::::::::::::::::::::::::::::::::::::
else
''
end
if b == ''
return nil unless $DEBUG
r = Bitmap.new(24, 24)
r.fill_rect(0, 0, 24, 24, Color.new(255, 255, 255, 192))
r.fill_rect(1, 1, 22, 22, Color.new(0, 0, 0, 192))
r.draw_text(0, 0, 24, 24, id.to_s, 1)
return r
end
return RPG::Cache.icon(b)
end
def make_element_icons
return if self.index < 0
return if self.help_window == nil
return if self.help_window.contents ==nil
skill = @data[self.index]
elements = skill.element_set
return if elements.size < 1
gap = 4 # Gap b/w icons in pixels
x = 608 - elements.size * (24 + gap)
elements.each_with_index {|id, i|
self.help_window.contents.fill_rect(x, 4, 24, 24, Color.new(0, 0, 0, 0))
bitmap = get_element_icon(id)
next if bitmap == nil
opacity = self.contents.font.color == normal_color ? 255 : 128
self.help_window.contents.blt(x, 4, bitmap, bitmap.rect, opacity)
x += 24 + gap}
end
alias win_skill_power_mod_draw_item draw_item
def draw_item(index)
win_skill_power_mod_draw_item(index)
skill = @data[index]
x = 4 + index % 2 * (288 + 32)
y = index / 2 * 32
txt = "#{skill.power} : #{skill.sp_cost}"
self.contents.fill_rect(x+196, y, 84, 32, Color.new(0, 0, 0, 0))
self.contents.draw_text(x + 196, y, 84, 32, txt, 2)
end
def index=(val)
super(val)
make_element_icons
end
alias win_skill_power_mod_help_window_eq help_window=
def help_window=(win)
win_skill_power_mod_help_window_eq(win)
make_element_icons
end
alias win_skill_power_mod_upd_hlp update_help
def update_help
win_skill_power_mod_upd_hlp
if Input.repeat?(Input::LEFT) || Input.repeat?(Input::UP) ||
Input.repeat?(Input::RIGHT) || Input.repeat?(Input::DOWN) ||
Input.repeat?(Input::L) || Input.repeat?(Input::R)
make_element_icons
end
end
end
Run it in DEBUG mode and you'll get dummy icons with the element ID number on them.
yay it works, thanks agian. powersup
np again :)
PS: What about the resolved tag :P
Fanta, mind if I use this and edit it to fit my game's needs? :D
i fogot to put the [RESOLVED] in
:^_^':
That's up to Shadonking, not me :P
Besides, if you look at the code, understand it and make your own edit, it'll be totally yours. I do that with other scripts. If I plan to make my own script, I'll find a similar script, understand it and try doing it on my own. I think you made a status screen edit, right? this is not really hard, I believe you can do it :)
i dont mind you useing the script. every one here is so helpful it would be rude to say no.
and Fantasist you made it so it should be your choice to who uses them.