Selchar

Equipment Level Base

45 posts in this topic

Equipment Level Base Ver. 1.05

Selchar
 

 
Introduction
This script adds the necessary methods for leveling.  It doesn't do anything on it's own, but other scripts such as the examples can take advantage of it.  I have supplied exp leveling for equips, as well as a basic scene for upgrading equips.

Features
- Allows for the creation of equipment leveling scripts.
- Example allows for leveling weapons via exp, just like actors.
- New example shows my attempt at a simple equip upgrade scene(see screenshot)
- Can choose a default max level for all, or individual via notetags.
- Different exp curves for different weapons, or all the same!

Screenshot
EquipUpgradeScene_zps2031b0aa.png

 
How to Use
Place the script below ▼ Materials, below Tsukihime's Instance Items, but above ▼ Main Process.  Use the provided notetags and follow the instructions within the script.
 
Script
>Required<

>Pick one of these<
Equip Leveling Base 0 (Levels start at 0)
Equip Leveling Base 1 (Levels start at 1)

Equip Leveling by Exp (Requires a Base)
Equip Upgrade Scene(Requires a Base)
Equip Leveling by Ap(Requires a Base and Basic AP)
 
FAQ
Q: What are the terms of use?
A: My terms are, anything goes, while the terms for Tsukihime's scripts can be found here
 
Credit and Thanks
- Selchar
- Tsukihime for the Instance Items Base

Updates
1/7/14: Fixed equip name when leveling down | Changes in param calculations to guarantee accuracy.
1/11/14: Compatibility with Weapon Durability
1/12/14: Finalized? Compatibility with Weapon Durability(Price Fixing)
1/16/14: Compatibility update with all other instance scripts using Tsukihime's Instance Items.  Added my basic Equip Upgrade Scene.
1/17/14: Made Equip Upgrade Scene a little more dynamic, you can now control what parameters are shown, and in what order.
3/4/14: Fixed a freezing bug in the Leveling by Exp script. Edited by Selchar
GGSlayer, BCj, Chaos17 and 1 other like this

Share this post


Link to post
Share on other sites

To go along with the earlier compatibility update, I'm adding a basic equip upgrade scene! See screenshot above.

Small update to the upgrade scene, the stat window showing current stats and upgrade stats can now easily be controlled, which is to say you can control what params are shown, and the order by which they are shown!

Edited by Selchar

Share this post


Link to post
Share on other sites

Heya.

Can I request some features for this script in here?

This has been pretty much the script I have been looking for minus one thing:

Using items/materials in the upgrade process (like metals, and other whatnot like that).

- Checking if player has enough of required item(s)

-- Displaying quantity of item (Green if enough, red if insufficient/missing, etc.) in a window.

 

Just wanted it so you wouldn't just throw money at the guy in case he needs some rare ores to upgrade the weapon, haha.

 

And just some more ideas that would be cool (but not muh request!):

- Percentage of success for an upgrade(for example, +10 might only have a 20% chance of success, whereas +1 has a 100% chance)

-- If said upgrade fails, whether weapon is destroyed or is broken.

--- If broken, if it retains its current upgrade tier upon being repaired.

-- Ability to use items(catalysts) to boost success % (I realize the screen might be cramped, so perhaps another window after selecting the weapon, confirming whether or not the player wants to use an item to boost the success chance)

--- Displays current and new success % with catalyst applied

--- Different items having different success boost chance - Catalyst A = +10%, Catalyst B + 30%, etc.

 

I typed a lot, didn't I :|

Anyways, it'd be pretty cool if you could add the materials thing up there. Loving the script!

Share this post


Link to post
Share on other sites

1: Using items/materials in the upgrade process (like metals, and other whatnot like that).

If I can figure out how to implement it properly I'll do it, been kind of stuck on some parts of the planning, so I can't give any guarantees.  You are free to request the changes to the provided scene from someone else, or even a completely different scene(if moving windows and such to fit stuff is unavoidable) from someone else if I keep drawing blanks.  Maybe if I looked at how crafting scripts do their checking...

 

2: Percentage of success for an upgrade(for example, +10 might only have a 20% chance of success, whereas +1 has a 100% chance)

I considered making an add-on to do this, and should be relatively simple, it's just a matter of deciding how to set success rates since there are a few ways of doing it, want to try and make it flexible if I do it.

 

3a: If said upgrade fails, whether weapon is destroyed or is broken.

I'm more of a de-leveling person myself... (lost too many gears in games)

3b: If broken, if it retains its current upgrade tier upon being repaired.

With this in mind tho, it could be done by "borrowing" a few changes from my durability script, since I'd need to make sure a "broken" equip can't be equipped... would need a "rate of destruction/broken" to be checked on failure.

 

4: Ability to use items(catalysts) to boost success % (I realize the screen might be cramped, so perhaps another window after selecting the weapon, confirming whether or not the player wants to use an item to boost the success chance)

Relatively speaking, same answer as #1, I'm already getting headaches thinking about it @.@, 1 step at a time! Depends on however I do the number 2 if I do it, now would also be a good time for me to learn how to add a standard confirm window.

 

Scene/Window making is serious business, full of blood, sweat, tears, headaches... oh the headaches, especially when they get more complicated and you don't know how to do a particular thing.  I count myself lucky that I made the scene seen in my screenshot ^^  Anyways I'll see what I can do when I have time, but I can't really give any guarantees.

 

Edit: Doesn't look like I'll have the time to figure it out.

Edited by Selchar

Share this post


Link to post
Share on other sites

Found an issue while testing equip formulas.

http://www.rpgmakervxace.net/topic/22618-equip-param-formulas/

Basic formula:

 

50 * level
And it crashes because the level was not initialized.

It is not obvious how the level is initialized, but I put in a

 

def level  @level ||= 1end
for RPG::EquipItem.

My assumption is that all equips start at level 1, even if they don't actually level.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

It's done when the instance it actually made, and starts at 0, but I went ahead and added your little snippet with that change to fix the issue,

Share this post


Link to post
Share on other sites

I see the problem now.

My script accesses the template at some point.

So the reason why initializing level for a template works, because it was trying to check the template's level.

As for why it's doing that, the problem lies with the way instance items are refreshed

 

"def refresh_#{ivar}   var = InstanceManager.get_template(self).#{ivar}   @#{ivar} = make_#{ivar}(InstanceManager.make_full_copy(var))end"
The way instances are refreshed is to first grab the template and then use all those `make` methods to modify variables.

My assumption for any scripts based on instances was that you didn't have to worry about templates, but that assumption does not hold during the actual refresh process: if some script was trying to access attributes that were not initialized in the templates, it would crash.

I'm not sure if there is a way to address this issue without requiring all custom variables to be at the very least initialized.

Edited by Tsukihime

Share this post


Link to post
Share on other sites

Having trouble with this one... Cannot get items to level without the custom scene (ie: from experience).

 

I have these scripts in place (in this order):

Instance Items

Instance Equip Leveling Base Ver. 1.05

Instance Equip Leveling by Exp Ver. 1.02

Equip Upgrade Scene

 

In Instance Items, I have it set like so:

    Enable_Items = false    Enable_Weapons = true    Enable_Armors = true

In Leveling base, I have it set like so:

 
  module Equip    #Set this to the default maximum level of your choice.    Default_Max_Level = 10        #Change this to how you wish for your weapon's level to be shown.    #'+' will show it as 'Name+1', while 'LV ' will show as 'Name LV 1'    Level_Prefix = ' +%s'        #Default Multipler bonus    Default_Mult_Bonus = 1.25    #Mult bonus for price    Default_Mult_Price = 1.25        #Determines the default availability of an equip's ability to level.    #The <can level> notetag will always do the opposite    Default_Can_Level = true

I didn't change anything in the Leveling XP script.

I didn't add notetags to anything (as I thought if I had default leveling set to TRUE, I'd be all set).

 

If I use the scene, I can level up items just fine.

But if I grant XP to the party or have them win a fight with monsters with gobs of XP, the items don't level.

 

I must be missing something...

 

EDIT: I'm using Yanfly's Equip engine, wonder if that's the problem?

Edited by oldbone

Share this post


Link to post
Share on other sites

1: I just tried the scripts you mentioned in a new project and was able to level up equips without problems save for 1 which has been addressed.

 

2: Slight adjustment to the Upgrade Scene to automatically correct an equip's exp amount if used in conjunction with the leveling by exp script.(didn't think anyone would use both before)

 

3: Default_Can_Level = true does indeed mean you don't need to use the notetag <can_level> to enable it.

 

4: Currently only exp from Battle is added on to equipment exp.

 

Not sure what could be causing your problems.

Share this post


Link to post
Share on other sites

Nice - it was actually Yanfly Battle Aftermath causing the issue. 

 

Guess I'll find a new way to simply strip out the after-battle message. 

 

Thanks!

Share this post


Link to post
Share on other sites

Hmm... Shields & Weapons gain XP fine... but things like Bodygear, Headgear, etc do not. 

Share this post


Link to post
Share on other sites

I can see where there would be a problem if Yanfly's Aftermath is after my scripts, but if you have it before mine, then your equips will level up properly.

 

I got everything to level up properly, so doublecheck for notetags?  I'm not sure what else would prevent your equips from leveling.

Share this post


Link to post
Share on other sites

Hi Selchar

I have a small issue with the script.

First: No matter what I do, if I pick up the equipment it has no level. But it levels up with even 0exp and gets the atk+4 bonus I set for level up.

 

For those of you who want let's say for each level 100exp more than the level before.

Example:

Level 1=100exp to next level

Level 2=200exp to next level

Level 3=300exp to next level

and so on

 

Here is the formula for this case.

if self.level <= 1100 * self.levelelse self.level * 100 * (self.level - (0.5 * (self.level-1)))end

If you want an other number to be accumulated to the previous exp.

Example

Level 1=50exp to next level

Level 2=100exp to next level

Level 3=150exp to next level

 

Just change the 100 to the number you like to accumulate to the exp needed the level before.

Edited by BMASTER

Share this post


Link to post
Share on other sites

1: An equip's level always starts at 0.(I have yet to see a game where it actually starts at 1 and the first 'level up' puts the equip at level 2, but maybe I wasn't looking hard enough.)
 
2: With the above in mind, the original exp formula of '(level+1)*100' shows that you would need 100 exp per level.(Yes I can see now that that formula is pointless unless you use very low amounts of exp per monster throughout the game.  In any event focus on the (level+1) part.  You should have fewer problems with your exp formula is you add 1 to the equip's level at each point in the calculation it's used... or start off with a = self.level+1 and substitute all self.level in your formula with a.

 

Just keep that information in mind and you should have fewer problems deciding on a formula to use and debugging it.

 

Now that I think about it tho perhaps I should make an 'AP' version of the leveling by exp script, probably using Fomar's basic AP system, or I can make my own since he doesn't have a $imported for compatibility checks.  AP would be easier to manage compared to exp in this case, or maybe call it EP for equip points? *shrugs*

 

Edit: Or I can make an alternative Base script that starts at level 1, pushing stat calculations to start at level 2.  That's another option I suppose.

Edited by Selchar

Share this post


Link to post
Share on other sites

1: An equip's level always starts at 0.(I have yet to see a game where it actually starts at 1 and the first 'level up' puts the equip at level 2, but maybe I wasn't looking hard enough.)

 

Have a look at Fomar0153's Equipment Level Up. He uses a Notetag to determine the min_level of an Item. I tried to use it before, but couldn't get it to work with all those scripts I use.

Share this post


Link to post
Share on other sites

I meant an actual game, not a script, tho looking at SES Equip Level script that's another one that has levels start at 1.  Personally it just looks weird to have all equips that haven't leveled have +1 or LV 1 at the end of it's name.
 
Try the following Base Script instead of the one in the opening post.
https://drive.google.com/file/d/0BywhvOtY4_H9dmdKV0tlbDJybmc/view?usp=sharing

 

Edit: Fixed an obvious error on my part, just updated.

Edited by Selchar

Share this post


Link to post
Share on other sites

I meant an actual game, not a script, tho looking at SES Equip Level script that's another one that has levels start at 1.  Personally it just looks weird to have all equips that haven't leveled have +1 or LV 1 at the end of it's name.

 

Try the following Base Script instead of the one in the opening post.

https://drive.google.com/file/d/0BywhvOtY4_H9dmdKV0tlbDJybmc/view?usp=sharing

 

Edit: Fixed an obvious error on my part, just updated.

 

Now I get an error on line 117:

unexpected keyword_do, expecting keyword_end

(@level.times - 1) do

 

If this takes to much time, you don't need to do it. It's nothing major and I can explain that within my game just fine.

Edited by BMASTER

Share this post


Link to post
Share on other sites

Try grabbing it again, I made a rather obvious error when you grabbed it, the very line you copied.

BMASTER likes this

Share this post


Link to post
Share on other sites

Now it works. Really appreciate your work.

Would it be much work to show Lv 1 behind the Items once picked up?

Only if it's not too much trouble :D

Share this post


Link to post
Share on other sites

Sorry for the delay, updated again to address with what I think you were referring to.

BMASTER likes this

Share this post


Link to post
Share on other sites

hi any who can help I am unsure as to what note-tag to put in the weapon for the formula to determine the exp curve as described in the script for the levelling gear by exp. i just put <exp curve: x> and nothing seems to work

do I get a level up message when I gain a level on my gear or what? thanks folks

Share this post


Link to post
Share on other sites

You have to set more than just this notetag.

 

Here is what I have set for my first axe weapon

<can level><max level: 100><static level atk: 2><exp curve>if self.level <= 130 * self.levelelse self.level * 30 * (self.level - (0.5 * (self.level-1)))end</exp curve>

can level needs to be in the notetag if you have set the line 55 in the Leveling Base Script to false. If this line is set to true, then you don't need the notetag.

maxlevel and static level don't need to be set.

exp curve needs a number (10) or an actual formula (self.level * 10).

If you want to use more complicated formulas you can even use the if... else... conditions as in the code snipped provided above.

Share this post


Link to post
Share on other sites

It is also possible to setup a multi-line exp curve in the actual exp leveling script.  I have a feeling tho since it uses the same exp as actors, that the exp curve notetags are still necessary to adjust the leveling rate of weaker/common  and stronger/rare equips to differentiate them in ways other than stats.

 

Anyways added an AP Leveling variation, as well as my own AP script, and moved the new base script to the opening post in case anyone else wants their equips to start at level 1 instead of 0.

BMASTER likes this

Share this post


Link to post
Share on other sites

ok thank you very much i understand now, i think i was getting about right but i was just unsure but you have cleared it up i think lol. i have my can level set to true so i dont use that notetag. the rest is great though, i love the item rarity and upgrade scene also. i was trying to make the upgrade screen accessible from the menu but i dont know how to change what appears in the menu lol. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.