XS - Attribute System

● ARCHIVED · READ-ONLY
Started by Nicke 20 posts View original ↗

  1. xs.png



    XS - Attribute System




    Version 1.1b


    Introduction

    This script allows you to gain a set of default points (5) each time an actor gains a level. You can then distribute these points to make your character stronger (i.e increase mana, magic resistance, health etc).

    Features

    • Attribute points!
    • Easy to setup the font, size, color, bars, icons etc.
    • Support for own background.
    • The ability to change the max stat, cost, distribute formulas.
    • You can reward/remove points for the specified actor as you wish using a script call.
    • The ability to enable/disable stat growth, which means the actor won't gain any attributes when levelling up.
    • Currently supporting up to 14 attributes.
    • Customizable formulas for each actor (change starting distribute points or max points etc using a unique formula for the specified actor).
    • And more!

    Screenshots

    Spoiler
    xs-attribute.png
    How to Use

    To install any of my scripts, open up your script editor and copy/paste the script to an open slot below Materials but above Main. Remember to save.

    Script

    Get the script here and the Core Script.

    Note:

    This script requires IceDragon's Numeric class and Mithran's Text Cache. (place those above everything else.)

    Updates

    Released 1.0b. Added support for XS - Level Title.

    Credit

    Do credit me, Nicke, if you are planing on using any of my scripts. Thanks.

    Can be use in commercial projects. (Please private message me if so)
  2. this is really useful for me!!!

    thx...
  3. I love scripts like this, thank you! Any thoughts on doing one like that with variables?
  4. Finally been waiting for one these on ACE. Can this be viewed threw the main menu and you get points upon level because that what I was really looking for? Still nice one.

    EDIT: Using a blank project and getting this error.

  5. Thanks for the feedback. Um, what does it say on that line?

    Anyways, quick update. I've cleaned up the code a bit and fixed a small issues. You will need my newer version of the core script which can be downloaded at topic.

    @Mooshrago12: Found the error. You will need Mithran's text cache as well, I forgot to mention that. Sorry!
  6. Cool it works now, but can you make a version were it fits in the menu? And is there a way to modify it to were you gain points when you level up like in this script for VX? (KGC's Distributive Parameter)

    http://www.mediafire...r2bwto32xl314rq
  7. Um you gain 5 points each time an actor gains a level. Didn't you read the introduction? These can be changed in the settings as well.

    @Knightmare: Care to explain what you mean with variables?
  8. Oh I miss that I am an idiot(Face plam),but still can you make a menu option? I am making a game from VX to Ace and that is a big customization feature for the character in the game that can be opened at any time. Well I guess I can make an item that uses a common event to open the menu. :huh: Thanks for this script though.
  9. @Mooshrago12: You can open up the scene by calling the following method:



    Code:
    SceneManager.call(Scene_Attribute)
    Use that code in your own menu or tweak the default one. I might release a newer version later on that will add this to the default menu.
  10. Ok I will mod the base scripts for this thanks for the advice, but how would go about modding the base menu I tried modding the scene menu script but am kind of lost?
  11. Thanks for this script ! :D

    Does this script disables the normal statgrowth of the actors

    if it doesn't would you make an add-on for that ?

    it would be very helpful .

    Edit:

    Thankyou ! that was fast .

    now we can have a attribute system like the ones on MMORPGs :D
  12. @LeviCore.exe: You mean when you level up normally the stats would increase even without this script? If so, I might be able to do a addon as you say which will remove that so you can customize your character completely.

    Allright, script upgraded to 1.0b which includes a few new features and also the one @LeviCore.exe suggested. Make sure you grab the newer version and report here if you find any bugs, cheers.

    OK. Second update which means I've released yet a newer version (1.0c) which adds a few more details to the scene as well as few minor details. This should be the last update until something major. x)
  13. well you could have it set up where every acter gains 1-2 points among their stats every lvl based on their class type
  14. Version 1.1 released. See more at OP.
  15. i asked on a similar script is it possible to add skills and abilitties to this? so that i can make players choose between powering up their stats or learning a new skill or is it possible to make a diff one for skills so you can customize the skills they learn?
  16. @Xaigoth: Yeah I will be doing something similar but if you have played Torchlight or Diablo you will know how that skill tree works. I will try to create something along those lines.
  17. Released 1.1b.
  18. Hello, those icons look pretty cool. How do I get the attribute system to use those icons? Thanks.
  19. After using this script for a while I noticed some strange quirks. I do not know if it is working as intended but I figured I'd point them out just in case.

    1. The xparams are displayed as percentages but they seem to be an order of 100 too small. For example hit chance is 0.85% but using the default character who has 95% hit - 10% hit for wielding an axe results in 85% not 0.85%. I believe this is a mistake since 0.85 % indicates almost no chance of landing your hit.

    2. The guages and numbers do not reflect changes made by Yanfly's Extra Parameters Formula script. This is because this script uses the xparam method to get parameter values instead of their alternative names such as "hit" and "eva" which are aliased by Yanfly's Extra Parameters Formula. The game values also seem to reflect the values generated by the alternative names rather than xparam as well.

    3. Unspent attribute points are not saved properly. For example if you speed one point and you have four points left. You save and than close the game completely, open the game and load you will now have either 0 or 5 points.

    My fix for problems 1 + 2:

    Spoiler
    class Game_BattlerBase def xparam(xparam_id) features_sum(FEATURE_XPARAM, xparam_id) end alias_xparam = ["hit", "eva", "cri", "cev", "mev", "mrf", "cnt", "hrg", "mrg", "trg"] alias_xparam.each { |xparam| id = 0 if xparam == "hit" id = 1 if xparam == "eva" id = 2 if xparam == "cri" id = 3 if xparam == "cev" id = 4 if xparam == "mev" id = 5 if xparam == "mrf" id = 6 if xparam == "cnt" id = 7 if xparam == "hrg" id = 8 if xparam == "mrg" id = 9 if xparam == "trg" aStr = %Q( alias game_battlerbase_#{xparam}_epf2 #{xparam} def #{xparam} base_#{xparam} = game_battlerbase_#{xparam}_epf2 n = eval(YEA::XPARAM::FORMULA[:#{xparam}_n_value]) return eval(YEA::XPARAM::FORMULA[:#{xparam}_formula]) + xparam_plus(#{id}) end ) module_eval(aStr) }endclass Window_Base < Window def draw_actor_xparam_gauge(actor, x, y, width, xparam_id, font, size, bar_color1, bar_color2, txt_color1, txt_color2) case xparam_id when 0 xparam_rate = actor.hit xparam_name = Vocab.xparam(0) when 1 xparam_rate = actor.eva xparam_name = Vocab.xparam(1) when 2 xparam_rate = actor.cri xparam_name = Vocab.xparam(2) when 3 xparam_rate = actor.cev xparam_name = Vocab.xparam(3) when 4 xparam_rate = actor.mev xparam_name = Vocab.xparam(4) when 5 xparam_rate = actor.mrf xparam_name = Vocab.xparam(5) when 6 xparam_rate = actor.cnt xparam_name = Vocab.xparam(6) when 7 xparam_rate = actor.hrg xparam_name = Vocab.xparam(7) when 8 xparam_rate = actor.mrg xparam_name = Vocab.xparam(8) when 9 xparam_rate = actor.trg xparam_name = Vocab.xparam(9) end contents.font.name = font contents.font.size = size contents.font.bold = true contents.font.shadow = false draw_gauge_ex(x, y - 14, width, 20, xparam_rate, bar_color1, bar_color2) contents.font.color = txt_color1 draw_text(x + 10, y, 120, line_height, xparam_name) contents.font.color = txt_color2 draw_text(x + width - 38, y, 36, line_height, "#{(xparam_rate * 100).clamp(0,100).round_to(1)}%", 2) reset_font_settings endendclass Scene_Attribute < Scene_AttributeBase def on_index_change(index) title = Vocab::param(index) case index when 8 ; title = Vocab::xparam(0) when 9 ; title = Vocab::xparam(1) when 10 ; title = Vocab::xparam(2) when 11 ; title = Vocab::xparam(3) when 12 ; title = Vocab::xparam(4) when 13 ; title = Vocab::xparam(5) end stats = XAIL::ATTRIBUTE_SYSTEM::LIST[index][1] stats = (stats * 100).to_s + "%" if stats < 1 cost = XAIL::ATTRIBUTE_SYSTEM::LIST[index][2].to_s @attribute_param.set_text(title.to_s + " +" + stats.to_s, Color.new(150,205,150,225)) @attribute_info.set_text("Increase " + title + ". Cost » " + cost + " points", XAIL::ATTRIBUTE_SYSTEM::pARAM_TXT_COLOR[1]) refresh_windows endend
    My fix for problem 3:

    Spoiler
    class Game_BattlerBase attr_accessor :points alias original_initialize initialize def initialize @points = [5] original_initialize endendclass Game_Actor < Game_Battler def gain_attribute(actor_id, value, type = :gain) points = @points case type when :gain points[0] = (points[0] + value).clamp(0, XAIL::ATTRIBUTE_SYSTEM.attr_max(actor)) when :lose points[0] = (points[0] - value).clamp(0, XAIL::ATTRIBUTE_SYSTEM.attr_max(actor)) end end def attribute?(actor_id) @points[0] endendclass Window_Attribute_Points < Window_Base def refresh contents.clear current = @actor.points[0].to_s max = XAIL::ATTRIBUTE_SYSTEM.attr_max($game_actors[@actor.id]).to_s text = "Points: " + current contents.font.name = XAIL::ATTRIBUTE_SYSTEM::FONT contents.font.size = 20 contents.font.color = Color.new(255,255,255) draw_text(0, 0, contents.width, line_height, text) reset_font_settings endend
    Hopefully I didn't leave anything out. I'm still rather new at ruby so I wouldn't be surprised if I missed something.

    Edit: Change "n = eval(YEA::XPARAM::FORMULA[:#{xparam}_n_value])" to "n = 0". It was calculating Yanfly's n value twice.
  20. maybe a demo? it doesnt work either... after a battle i get a error and acor 1 and 2 got 5 points at the beginning and can spent it how they should but 3,4 and 5 should get 5 points but if i set 1 point in hp (cost one) they cot no more points... and i dont know why.,, pls help