Main Menu
  • Welcome to The RPG Maker Resource Kit.

[RESOLVED] Self-Upgrading Weapons

Started by WeaponMaster Kaesar, January 30, 2009, 04:55:34 AM

0 Members and 1 Guest are viewing this topic.

WeaponMaster Kaesar

Self-Upgrading Weapons
Febuary 7, 2009




Summary
What I'm looking for is a way to enhance a characters weapons with specific items, as well as having the weapons increase in power with the character.

Example: Bob starts with a longsword (ATK 15)
As Bob goes through the game, he reaches level 5 (Yay Bob!). When Bob hits level 5, his longsword increases to ATK 30.
Now Bob is in a dungeons, and finds a Fire gem. Bob puts the Fire gem into his longsword and Hey Presto! He's roastin' weenies with his sword.

That's what I'm lookin for. If it's possible, please lemme know.

If I need to use 2 different scripts that's fine, but I am hoping for one.

Features Desired

  • Automatic replacement or upgrading of weapons, either in inventory or equipped

Games its been in

  • Haven't seen the auto-upgrading system




Did you search?
Yes

Where did you search?

What did you search for?

  • Self-Upgrading Weapon Script
  • RMVX Self Upgrading Weapon
  • RMVX Auto Upgrading Script
Why does nobody ever stab somebody with a gunblade, and then pull the trigger?


Which Final Fantasy Character Are You?
Final Fantasy 8

WeaponMaster Kaesar

Why does nobody ever stab somebody with a gunblade, and then pull the trigger?


Which Final Fantasy Character Are You?
Final Fantasy 8

modern algebra

I'm sure there is probably an enchanting script of some sort out there that can do the second part of your request. For the first part, you want the atk to be reliant on character level, but would it matter when the character picked up the weapon? What I mean is: Does the weapon itself have to level up? If the character only picked up the sword at level 5, would the attack still be 30, or would it be 15?


I am probably not going to take this request. The socketing one sounds a little more interesting, though, so I might do something with that.

WeaponMaster Kaesar

#3
I'm trying to get rid of buying weapons entirely in my game. As it stands now, you can.

Basically, each character only has one weapon they use. Corin has his longsword, which at level 1 has an atk of 20. When he reaches level 10, it changes to 40 and so on.

Even a skeleton outline of the script would be appreciated. I can fill in the specific levels and damage values, not that I was ever expecting anybody else too.

EDIT: I figured out the socketing through common events, so that can be disregarded.
Why does nobody ever stab somebody with a gunblade, and then pull the trigger?


Which Final Fantasy Character Are You?
Final Fantasy 8

WeaponMaster Kaesar

Sorry if I'm busting some rules with this, if I am flame away lol, but;

Just a thought I had after some messing around with the Common Event system

Is it possible to insert something like this

Quote
$game_actor[1].level >= 1 then
     $game_actor[1].level >= 5 then
     @atk = 40
     else
     @atk = 20
else
@atk = 20
end
end

If I can do a string similar to this into the note block, would that do what I want the script to? I'm crappy at coding, and so my attempt, which failed miserably, might not be conclusive enough.....
Why does nobody ever stab somebody with a gunblade, and then pull the trigger?


Which Final Fantasy Character Are You?
Final Fantasy 8

modern algebra

You could do something like that ~ By default, weapon stats are loaded each time the game boots, so what you would first need to do is translate the stats into a class that progresses with the save file, so one of the Game_ classes. It's not hard, but it might not be obvious how to someone not familiar with scripting.


WeaponMaster Kaesar

lol no kidding. So I'd have to make a new class, probably in the materials area that follows the general weapon outline given in the Help included with RMVX, and somehow work in a conditional branch change to keep the @atk value current to the actors level?
Why does nobody ever stab somebody with a gunblade, and then pull the trigger?


Which Final Fantasy Character Are You?
Final Fantasy 8

modern algebra

Not necessarily make a new class. You could add it into an existing class, such as Game_Actor. Then you'd need to modify the damage calculation so that it is taken into account with the atk.

The base_atk method in Game_Actor is the one you want to change most likely.


  #--------------------------------------------------------------------------
  # * Get Basic Attack
  #--------------------------------------------------------------------------
  def base_atk
    n = actor.parameters[2, @level]
    for item in equips.compact do n += item.atk end
    return n
  end


So something like this would do the trick, and I will leave it up to you how @atk_lvlplus is updated.


class Game_Actor
  attr_accessor :atk_lvlplus
  alias mawmkaesr_init_selfupgrading_weapons_8jk3 initialize
  def initialize
    mawmkaesr_init_selfupgrading_weapons_8jk3
    @atk_lvlplus = 0
  end
  alias wpnmstr_kma_wpnugrd_bs_atk_84g2 base_atk
  def base_atk
    return wpnmstr_kma_wpnugrd_bs_atk_84g2 + @atk_lvlplus
  end
end


You'd want to modify level up in such a way that this bonus is increased though.

I do have a question though - why not just increase the level growths of the level, rather than the weapon?

WeaponMaster Kaesar

#8
I thought of that, but to be honest I wasn't sure it'd get quite the right effect.

Sorry for dragooning you into this btw, you did say you probably wouldn't do this one :(

And my last question before you get mad (or madder maybe) at me, is where the second code goes. Just replace the Get Basic Attack bit?
Why does nobody ever stab somebody with a gunblade, and then pull the trigger?


Which Final Fantasy Character Are You?
Final Fantasy 8

Garge

BigEd781 over on rpgmakervx.net made a script that lets an actor gain stats upon leveling up depending on what equipment they had. Equipment Stat Bonuses on Level Up. On page 2, post 27 of the thread, Dyrnwyn made an edit to this script that makes it so the equipment gains the stat bonuses on level up instead of the actor.  It doesn't do quite what you're looking for, but might be a very good place to start.

modern algebra

Well, I suggest you just look at that script now, but no, the code I posted wouldn't replace anything. It'd be posted in its own slot above Main and below Materials

WeaponMaster Kaesar

#11
Okay, thanks both of you ^_^

And that script is exactly what I was looking for, thanks tons, both of you!
Why does nobody ever stab somebody with a gunblade, and then pull the trigger?


Which Final Fantasy Character Are You?
Final Fantasy 8