Nickname functioning as Weapon: A bit of modification.

Discussion in 'RGSS3 Script Requests' started by Panda_Artist, Aug 27, 2019.

  1. Panda_Artist

    Panda_Artist Humble RPG Fan Veteran

    Messages:
    59
    Likes Received:
    4
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    Hello everyone.

    I hope I am not like a flea around here, but thanks to you guys I have been able to progress quite well into my big project.

    I have programmed my game so that, instead of equipping multiple weapons you recieve weapon upgrades. So. I have used the nickname in RMVX Ace to place the name of the "Equipped" Weapon.

    However. What I am requesting here is the following:

    - The ability to add a functionality to this "nickname". For example, if an actor has a certain nickname (Which in this cases functions as if he/she has a new weapon equipped, he/she would recieve the stats that "weapon" nickname is programmed with.)

    Basically, I would like the nick name to function like equipment, with a stat boost attributed to that weapon "nickname"

    I did try Galv's Nickname functionality but it did not work at all for some reason.

    UPDATE

    I was able to play around with the programming a bit and found a way around it.
     

    Attached Files:

    Last edited: Aug 27, 2019
    #1
  2. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,709
    Likes Received:
    376
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    It sounded like you were describing item affixes and prefixes
     
    #2
  3. Panda_Artist

    Panda_Artist Humble RPG Fan Veteran

    Messages:
    59
    Likes Received:
    4
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    No. Basically what I want is to give a nickname a stat boost. Sorry if I didn't explain correctly. Unfortunately what I tried did not work.
     
    #3
  4. vFoggy

    vFoggy Veteran Veteran

    Messages:
    65
    Likes Received:
    24
    Here:
    Code:
    #===============================================================================
    #
    # Script Name: Nickname Base Stats
    # Author: vFoggy
    # Description:
    #   This script increases an actor's parameters depending on their nickname.
    #   The parameters are taken from a weapon in the database that has the same
    #   name as the actor's nickname. Basically if an actor's nickname exists as a
    #   weapon, their base params, xparams and sparams will increase according to  
    #   the weapon's params.
    #
    #===============================================================================
    
    class Game_Actor < Game_Battler
     
      alias fog_setup setup
      def setup(actor_id)
        fog_setup(actor_id)
        @nickname_stats = $data_weapons.find{|i| !i.nil? && i.name == @nickname}
      end
     
      def nickname_plus(param_id)
        if @nickname_stats
          features = @nickname_stats.features.select{|f| f.code == FEATURE_PARAM}
          features.select!{|f| f.data_id == param_id}
          nickname_value = features.inject(0){|v, f| v+f.value} * @nickname_stats.params[param_id]
          return nickname_value
        else
          return 0
        end
      end
     
      alias fog_pb param_base
      def param_base(param_id)
        fog_pb(param_id) + nickname_plus(param_id)
      end
     
      alias fog_xparam xparam
      def xparam(xparam_id)
        nickname_value = 0
        if !@nicknamestats.nil?
          features = @nickname_stats.features.select{|f| f.code == FEATURE_XPARAM}
          features.select!{|f| f.data_id == xparam_id}
          nickname_value = features.inject(0){|v, f| v+f.value}
        end
        fog_xparam(xparam_id) + nickname_value
      end
     
      alias fog_sparam sparam
      def sparam(sparam_id)
        nickname_value = 0
        if !@nicknamestats.nil?
          features = @nickname_stats.features.select{|f| f.code == FEATURE_SPARAM}
          features.select!{|f| f.data_id == sparam_id}
          nickname_value = features.inject(0){|v, f| v+f.value}
        end
        fog_sparam(sparam_id) + nickname_value
      end
    end
    
    Didn't have enough time to test it thoroughly though.
    You basically create a weapon with the same name as the nickname you want to "connect" it to. I chose to use weapons because it seems easier to control values etc. Those values are used as the base values of the actor's parameters.
    Currently it only uses params, xparams and sparams. If you would like me to add other features, like atk-element, (de)buff rates etc., let me know.
     
    #4
  5. Panda_Artist

    Panda_Artist Humble RPG Fan Veteran

    Messages:
    59
    Likes Received:
    4
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    Thanks so much for the effort, unfortunately I could not get it to work but I have found another way around it!!

    I used a Victor's passive states to create the weapon as state! Worked well so far.
     
    #5
  6. vFoggy

    vFoggy Veteran Veteran

    Messages:
    65
    Likes Received:
    24
    Seems like there was a conflict with another script.
    In any case, good thing you got it working :)
     
    #6

Share This Page