[RESOLVED]custom skill scene

Started by Shadonking, November 28, 2008, 11:21:27 am

Previous topic - Next topic

Shadonking

November 28, 2008, 11:21:27 am Last Edit: November 29, 2008, 03:37:19 pm by Shadonking
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





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

November 28, 2008, 12:54:30 pm #1 Last Edit: November 28, 2008, 01:09:03 pm by Fantasist
"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.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Shadonking

November 28, 2008, 01:39:05 pm #2 Last Edit: November 28, 2008, 01:49:16 pm by Shadonking
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)





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

Just type out how you want it to look.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Shadonking

November 28, 2008, 02:11:23 pm #4 Last Edit: November 28, 2008, 02:34:03 pm by Shadonking
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:





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Shadonking

November 28, 2008, 04:41:41 pm #6 Last Edit: November 28, 2008, 04:43:54 pm by Shadonking
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.





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

November 29, 2008, 01:25:25 am #7 Last Edit: November 29, 2008, 01:30:31 am by Fantasist
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.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Shadonking

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





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

By description, do you mean the help window at the top? Yeah, that can totally work.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Shadonking






Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

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.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Shadonking

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.





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

Oh, both are the same. Delete the old one.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Shadonking

ok, new error. sorry

its on line 47, cant convert NilClass into bitmap.





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

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
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Shadonking

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.





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

o.o I'll check it out... hang on.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Shadonking

ok, take your time. there is no rush





Creator Of Music And Games
Spoiler: ShowHide
]

keywords: ShowHide
rmxp rmvx blizz-abs rpg maker xp vx abs cbs cms script tons of addons charsets autotiles HUD


come here if you have a ps3
http://forum.chaos-project.com/index.php?topic=1952.0

Fantasist

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.
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews