RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED] Self-Upgrading Weapons

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 84
The sigil of ice keeps me at bay...
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?
  • Google
  • RMRK.net

What did you search for?
  • Self-Upgrading Weapon Script
  • RMVX Self Upgrading Weapon
  • RMVX Auto Upgrading Script
« Last Edit: February 20, 2009, 07:05:55 PM by 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

**
Rep: +0/-0Level 84
The sigil of ice keeps me at bay...
Sorry for not doing this at first  ;9
Why does nobody ever stab somebody with a gunblade, and then pull the trigger?


Which Final Fantasy Character Are You?
Final Fantasy 8

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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.

**
Rep: +0/-0Level 84
The sigil of ice keeps me at bay...
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.
« Last Edit: February 20, 2009, 03:56:18 AM by 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

**
Rep: +0/-0Level 84
The sigil of ice keeps me at bay...
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

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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.


**
Rep: +0/-0Level 84
The sigil of ice keeps me at bay...
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

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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.

Code: [Select]
  #--------------------------------------------------------------------------
  # * 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.

Code: [Select]
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?

**
Rep: +0/-0Level 84
The sigil of ice keeps me at bay...
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?
« Last Edit: February 20, 2009, 06:29:08 AM by 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

**
Rep:
Level 86
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.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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

**
Rep: +0/-0Level 84
The sigil of ice keeps me at bay...
Okay, thanks both of you ^_^

And that script is exactly what I was looking for, thanks tons, both of you!
« Last Edit: February 20, 2009, 07:05:39 PM by 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