Item level requirements

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
How do you add a level requirement on an item? Not a weapon/armor/accessory/shield, an ITEM. Like a skill book or a potion. How?
 

Warpmind

Twisted Genius
Veteran
Joined
Mar 13, 2012
Messages
936
Reaction score
578
First Language
Norwegian
Primarily Uses
Sounds to me like you'll want to make the item trigger a Common Event, which starts by checking for the user's level. (Conditional Branch, Script Call - but I can't for the life of me recall what the exact script call to check level would be right now.)

Hope that suggestion at least puts you on the right track.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Yes, without a script, you'd do it with a common event attached to the item.


Control Variables will let you put an actor's level into a variable, which you can then use as a conditional branch. If the item is consumable, and the user isn't the appropriate level, you will need to add the item back to the player's inventory as it will already have been removed.


Using a common event to determine whether the item can be used also means you need to put all the item effects, damage, etc into the common event as well, and leave it off the item setup itself, as the common event is called AFTER damage has been dealt.
 

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
Does anyone know of a script that can add a level requirement to an item? There is some created for weapons/armors, but I can't find one for items.

I would rather not do the common event route, as that's ALOT of common events. I want to make a skill book system where you learn a skill from the book. I have a script that limits what classes can use the item, I just need one to now limit the actors level to use the item.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
I've moved this thread to RGSS3 Script Requests. Please be sure to post your threads in the correct forum next time. Thank you.


I'm not aware of any existing (because I rarely search for scripts - I just roll my own). Take a look at the Master Script List (pinned at the top of the RGSS3 Script Requests forum) and see if you can find something suitable.


If not, I might be able to write one for you (or someone else might be). You'd need to provide a bit more information though and answer a few questions.
 

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
I didn't know it was going to be a script request. I thought maybe it could be done normally.

Ya, if you or someone could that would be awesome.

What questions need to be answered and what more info needs to be known?

More info:

Add a way to check on item use if the person using the item is the right class. So class restrictions.

Add a way to check on item use if the person using the item is the right level. So level requirements.

This is pretty much it. I want to be able to buy a skill book with the effect of learn skill X on the item. I don't want the item to be used if the wrong class tries to use the item OR if the user is too low level to learn the skill.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
In the menu, there is no person "using" the item - only (potentially) a person that the item is being used on.


I imagine if you buy a spell book you want to use it from the menu, not in battle. But you probably don't want to choose the spell book and then have to pick a target.


How will the script decide what actor it's meant to look at, to determine if they are the wrong class or the wrong level, if you have 4 people in your party?
 
Last edited by a moderator:

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
Yes. The item can only be used from the menu. I think it's fine to use the item, then pick the target. That's how it works be default. When I go to use the skill book, I pick the target to use it on, if the target can't use it, it does nothing. If it can be used, it consumes the item. Right now all I have is the class restriction script that does this.
 

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
Can I please get someone to create this OR edit this script to allow item restrictions as well.
 

Peridot Gaming

Veteran
Veteran
Joined
Nov 25, 2012
Messages
123
Reaction score
14
First Language
English
Primarily Uses
Can I please get someone to create this OR edit this script to allow item restrictions as well.
I could have a look at changing that script tonight once I get home from work, if you like.  I will install it and see what it currently does.

Am I right that you want it to continue checking the class restriction, and just have an additional check for level restriction as well?
 

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
Yes. Exactly right. Thank you very much!
 

Peridot Gaming

Veteran
Veteran
Joined
Nov 25, 2012
Messages
123
Reaction score
14
First Language
English
Primarily Uses
I've made my changes to the script. Had to make a few changes to the way that the classes were handled, although it should all still work the same.  I did find that the class restrictions did not appear to be working in battles, so I had to rewrite a chunk of the script to get it to work.  Seems okay in my test project, so if you want to give it a go and see if the class and level restrictions work both in and out of battles:


XS-Class Items with Level restrict.rb


To use the level restrictions, just add a notetag to the item like this:


<level: x>


where x is the minimum level that the actor must be to have the item used on them.


Let me know how it all goes, or if there is any problem accessing the script file.


Edited: as I realised after playing around that Magic also called the same methods in the battle so I needed to catch these and ignore the checks for class and level.
 
Last edited by a moderator:

Zero0018

Apprentice
Member
Joined
Dec 24, 2014
Messages
133
Reaction score
1
First Language
English
Primarily Uses
You sir are a rock star. TYVM! Everything works exactly like it should. As for using the item's in combat, they are for skill books, which I require to only be used through the menu. 
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
In the menu, there is no person "using" the item - only (potentially) a person that the item is being used on.
The person that uses an item in the menu is the actor with the highest PHA stat, which may affect your recovery items.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top