Bobstah's Enhanced Equipment, Item, Items Command, Skill, and Skill Type Restrictions 1.5.3

Bobstah

Pluginstah
Veteran
Joined
Oct 24, 2015
Messages
216
Reaction score
165
First Language
English
Primarily Uses
N/A
Updated 08/03/2016 09:21 PM ET


Introduction



Allows you to restrict equipment, items, the items battle command, skills, and skill types by actor ID, class ID, stat (hp, mp, tp, mhp, atk, cri, pdr, etc) minimum value, stat maximum value, other weapon equipped, other armor equipped, switch on/off, variable minimum value, variable maximum value, and a custom Eval option.


asdf

Every set of Restrict tags counts as a group. You can have multiple groups per equipment or item, and the actor only needs to satisfy the conditions of one restriction group to wear the equipment or use the item. Daisy-chaining gear is also accounted for and prevented. Every tag can also be inverted and eval'd for your convenience.




 

Features

  • Restrict equipment and item usage based on a multitude of factors!
  • Restrict some global properties, like Skill Types, using all of the restrictions available to items, skill, weapons, and armor!
  • Set multiple restriction groups on a single item. If one of the groups' restrictions is met, the item can be equipped!
  • Request the opposite of any setting! Instead of equipment being limited to Actor #1, it can be any actor except Actor #1! Just prefix your restriction with an !
  • Eval any ID, Variable, or Switch value by surrounding it with $()!
  • Use a custom Eval command to check for a true or false result!



How to Use
Add the plugin in your game and view the help information. It describes the notetags and all the crazy modifiers you can use. See the examples section for more information.


Notetags

Spoiler





A group of restrictions is contained between the <Restrict> tags. You can have more than one group of restrictions per equip or item, and the actor only has to meet one set of restrictions. If you want multiple restrictions to be met, use a single group instead.


 


If desired, you can prefix any Restriction with an !. This will cause it to check the opposite of what you specify. If you use it with Actor: 1, for example, anyone but Actor 1 can equip the item.


 


You can also replace anything after : with Javascript code inside of $(), like so: Actor: $(yourFunction() ;)


 


You can even combine the two: !Actor: $(yourFunction() ;)


 


Below are all of the available options:


<Restrict>


LevelMin: X - Minimum level.


LevelMax: X - Maximum level.


Class: ID - Actor must be class ID.


Actor: ID - Actor must be this ID.


State: ID - Actor must have state ID applied.


Weapon: ID - Actor must be wearing this weapon.


Armor: ID - Actor must be wearing this armor.


StatMin(Symbol): X - Stat Symbol must be at least X.


StatMax(Symbol): X - Stat Symbol must be at most X.


Switch(ID): On/Off - Switch ID must be on/off.


VarMin(ID): X - Variable ID must be at least X.


VarMax(ID): X - Variable ID must be at most X.


Custom: $(codeHere) - Run some Javascript.


</Restrict>


 


To restrict a global property, like a Skill Type, add the following to any actor's note field:


<Restrict SType: ID,ID,etc>



LevelMin: X - Minimum level.


LevelMax: X - Maximum level.


Class: ID - Actor must be class ID.


Actor: ID - Actor must be this ID.


State: ID - Actor must have state ID applied.


Weapon: ID - Actor must be wearing this weapon.


Armor: ID - Actor must be wearing this armor.


StatMin(Symbol): X - Stat Symbol must be at least X.


StatMax(Symbol): X - Stat Symbol must be at most X.


Switch(ID): On/Off - Switch ID must be on/off.


VarMin(ID): X - Variable ID must be at least X.


VarMax(ID): X - Variable ID must be at most X.


Custom: $(codeHere) - Run some Javascript.


</Restrict>


 


You can also restrict the Items battle command by using <Restrict Items> and any of the above options.





 


For more information on eval, check the plugin's help documentation.






Examples





Spoiler





Let's make an Evil Sword that anyone but our Paladin, Actor#1, can equip:
<Restrict>
!Actor: 1
</Restrict> 

Next, let's make a potion that someone can only use at level 5, 6, 7, 8, 9, and 10:
<Restrict>
LevelMin: 5
LevelMax: 10
</Restrict>

Let's build on that and say that only Actor#3 can equip a piece of armor whenever they want, but other actors can only wear it between levels 5 and 10:<Restrict>
actor: 3
</Restrict>
<Restrict>
LevelMin: 5
LevelMax: 10
</Restrict> 

Building on that even more, let's go all out. The following example will allow any class but class#1 to equip it as long as their atk is at least 5, variable#6 is at least 10, and switch#4 is turned off. Or, they can be actor#3:
<Restrict>
!Class: 1
StatMin(Atk): 5
VariableMin(6): 10
Switch(4): off
</Restrict>
<Restrict>
Actor: 3
</Restrict> 

Next, we'll check to see if an actor has state#3 using the eval feature:
<Restrict>
Custom: ($a._states.indexOf(3) !== -1;)
</Restrict>

What if we want to restrict a skill to actors that have less than 50% HP?
<Restrict>
StatMax(hp):$(a.mhp * 0.5)
</Restrict>

What about restricting a skill to actors that have more than 50% HP?
<Restrict>
StatMin(hp):$(a.mhp * 0.5)
</Restrict>

You can do the same thing with MP and TP, too. If you want to change the percentages, modify 0.5 (50%) to any other number. For example, 23% is 0.23.<Restrict>
StatMin(mp):$(a.mmp * 0.5)
StatMax(mp):$(a.mmp* 0.5)
StatMin(tp):50
StatMax(tp):50
</Restrict>



 


Plugin
Get it here - File name is CASE SENSITIVE: BOB_EnhancedRestrictions.js

Dependencies
None

FAQ


1. How do I use this plugin?


Read the plugin help and ask any questions here.


Changelog

Spoiler



1.5.3 (08/03/2016) - Fixed a conflict between this plugin and Yanfly's Equip Core.


1.5.2 (12/23/2015) - Fixed an issue where Weapon and Armor restrictions would not function when using an Independent/Unique Item script.


1.5.1 (12/11/2015) - Fixed a restriction logic bug and also added individual actor item restriction checking to the default RPGMV Battle Item list. (Before, it was checking if any party member could use the item.)


1.5 (12/10/2015) - Added the ability to restrict the Items battle command.


1.4.2 (11/19/2015) - Fixed a crash bug that could occur when opening the equipment window.


1.4.1 (11/11/2015) - Fixed a crash bug that would occur if you did not restrict a skill type. Bug introduced in version 1.4.


1.4 (11/09/2015) - Added the ability to restrict global properties, starting with Skill Types!


1.3.3a (11/07/2015) - Fixed a bug with my compatibility patch for Ellye's State Damage that could cause the special state settings to not be restored under certain conditions.


1.3.3 (11/07/2015) - Fixed a crash bug introduced by compatibility with Ellye's State Damage.


1.3.2 (11/06/2015) - Added a compatibility patch for Ellye's State Damage.


1.3.1 (Unreleased) - Fixed a bug with Restrictions on armor.


1.3 (11/06/2015) - Added a new restriction type: State.


1.2 (11/04/2015) - Added Skill Restrictions.


1.1 (11/04/2015) - Added Item Restrictions.


1.0 (11/02/2015) - Initial release.



Legal


Free to use in commercial and non-commercial projects with credit. A free copy of the finished game would be nice, but is not required.


Credit and Thanks
- Bobstah 
 
Last edited by a moderator:

Silent Darkness

Robomage
Veteran
Joined
Nov 28, 2013
Messages
2,284
Reaction score
322
First Language
English
This is an excellent plugin and needs more attention.

BUMMMPPPP!

Btw, i've been talking with the dev. All the options for notetags can be inverted!

"

Yeah. It can do all kinds of crazy stuff. You can also invert every option and create restriction groups, so

<Restrict>

weapon: 1

</weapon>

Will only allow something to be equipped if weapon 1 is equipped

<Restrict>

!weapon: 1

</Restrict>

Will only allow something to be equipped if weapon 1 isn't equipped.

Every set of Restrict tags counts as a group. You can have multiple groups per equipment piece, and the actor only needs to satisfy the conditions of one restriction group to wear the equipment. Daisy-chaining gear is also accounted for and prevented."
 
Last edited by a moderator:

Bobstah

Pluginstah
Veteran
Joined
Oct 24, 2015
Messages
216
Reaction score
165
First Language
English
Primarily Uses
N/A
This is an excellent plugin and needs more attention.

BUMMMPPPP!

Btw, i've been talking with the dev. All the options for notetags can be inverted!
Thanks :)
 
Last edited by a moderator:

Bobstah

Pluginstah
Veteran
Joined
Oct 24, 2015
Messages
216
Reaction score
165
First Language
English
Primarily Uses
N/A
Version 1.1 is now available! Made all existing restrictions available to Items as well! Download
 

Siul

Veteran
Veteran
Joined
Nov 19, 2012
Messages
70
Reaction score
14
First Language
Spanish
Primarily Uses
Woud it be possible to add a skill restriction feature? 
 

Bobstah

Pluginstah
Veteran
Joined
Oct 24, 2015
Messages
216
Reaction score
165
First Language
English
Primarily Uses
N/A
Version 1.2 is available! Made all existing restrictions available to skills as well! Download

(P.S. Variable, Switch, and Eval restrictions work on enemies, too. :D  )

Woud it be possible to add a skill restriction feature? 
Done! :)
 

Siul

Veteran
Veteran
Joined
Nov 19, 2012
Messages
70
Reaction score
14
First Language
Spanish
Primarily Uses
Version 1.2 is available! Made all existing restrictions available to skills as well! Download

(P.S. Variable, Switch, and Eval restrictions work on enemies, too. :D  )

Done! :)
AWESOME, I'm downloading as I end my job and I'll notice you my feelings :D
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
660
Reaction score
251
First Language
English
Primarily Uses
N/A
Awesome!  Maybe this will be the answer to my Dual wielding issue.

Can you put a restriction to disallow equipping on slot 1 ("Other" weapon slot) if something is equipped in slot 0?

And also disallowing certain equips from being placed in slot 1 to begin with?

Thanks.
 

Bobstah

Pluginstah
Veteran
Joined
Oct 24, 2015
Messages
216
Reaction score
165
First Language
English
Primarily Uses
N/A
Awesome!  Maybe this will be the answer to my Dual wielding issue.

Can you put a restriction to disallow equipping on slot 1 ("Other" weapon slot) if something is equipped in slot 0?

And also disallowing certain equips from being placed in slot 1 to begin with?

Thanks.
I'm sure I can, although I haven't looked into Dual Wielding much so this might take a few days.

Since you seem to be pretty fluent in what you want (referencing slot IDs), you could Eval it until I officially add the feature:

Custom: $(someCode;) - Return true or false

Weapon: $(someCode;) - Return a weapon ID to use for the restriction

Armor: $(someCode;) - Return an armor ID to use for the restriction
 

Maliki79

Veteran
Veteran
Joined
Mar 13, 2012
Messages
660
Reaction score
251
First Language
English
Primarily Uses
N/A
I'm sure I can, although I haven't looked into Dual Wielding much so this might take a few days.

Since you seem to be pretty fluent in what you want (referencing slot IDs), you could Eval it until I officially add the feature:

Custom: $(someCode;) - Return true or false

Weapon: $(someCode;) - Return a weapon ID to use for the restriction

Armor: $(someCode;) - Return an armor ID to use for the restriction
Ok.  I'll see what I can come up with.  Thanks.
 

Knightmare

Knight of the Night
Veteran
Joined
Mar 14, 2012
Messages
1,057
Reaction score
108
First Language
English
Primarily Uses
RMMV
For some reason the link still leads to v1.1 instead of v1.2.
 

Bobstah

Pluginstah
Veteran
Joined
Oct 24, 2015
Messages
216
Reaction score
165
First Language
English
Primarily Uses
N/A
For some reason the link still leads to v1.1 instead of v1.2.
I forgot to update the version number before I posted the file. I've taken care of it, thanks for letting me know! :)
 
Last edited by a moderator:

Siul

Veteran
Veteran
Joined
Nov 19, 2012
Messages
70
Reaction score
14
First Language
Spanish
Primarily Uses
Woratana just released hp-based restrictions. I guess it can be made with your plugin just coding a bit, isn't it? In that case, what code should be? (I know, I'm the master of coding noobs ^^'). 
 

Bobstah

Pluginstah
Veteran
Joined
Oct 24, 2015
Messages
216
Reaction score
165
First Language
English
Primarily Uses
N/A
Woratana just released hp-based restrictions. I guess it can be made with your plugin just coding a bit, isn't it? In that case, what code should be? (I know, I'm the master of coding noobs ^^'). 
Some coding required, but I can take care of that with an update. Unfortunately, I am working on getting another plugin released, then I have to focus on the Dual Wield update on this, THEN I can finally update this for percentages.

This restricts based on hp greater than 50%:

StatMin(hp): $(a.mhp * 0.5)

This is hp less than 50%:

StatMax(hp): $(a.mhp * 0.5)

This is hp greater than 23%:

StatMin(hp): $(a.mhp * 0.23

Does this answer your question?
 

Solis

Veteran
Veteran
Joined
Oct 24, 2015
Messages
367
Reaction score
84
First Language
English
Can you restrict based on a character's state? For example, Mega Ultra 1 Hit Ko 7 Combo (which of courses 1 shots everything including raid bosses) when the character is under the state of Berserk?
 

Bobstah

Pluginstah
Veteran
Joined
Oct 24, 2015
Messages
216
Reaction score
165
First Language
English
Primarily Uses
N/A
Can you restrict based on a character's state? For example, Mega Ultra 1 Hit Ko 7 Combo (which of courses 1 shots everything including raid bosses) when the character is under the state of Berserk?
If the Berserk sate ID is 7, use this notetag:

<Restrict>

Custom: ($a.states().indexOf(7) !== -1;)

</Restrict>
 

Bobstah

Pluginstah
Veteran
Joined
Oct 24, 2015
Messages
216
Reaction score
165
First Language
English
Primarily Uses
N/A
Version 1.3 is now available! Added the ability to restrict based on state! Download

Can you restrict based on a character's state? For example, Mega Ultra 1 Hit Ko 7 Combo (which of courses 1 shots everything including raid bosses) when the character is under the state of Berserk?
I didn't like that you had to use an eval for this, so I added it as a base feature. It supports the opposite/not modifier (the !), so you can determine if someone needs to have a state or cannot have a state.

For example:

state: 3 - Requires that state ID 3 is applied to the actor/enemy.

!state: 3 - Requires that state ID 3 is not applied to the actor/enemy.
 

snorlord

Warper
Member
Joined
Oct 25, 2015
Messages
4
Reaction score
0
First Language
English
Would there be a way to use the Custom: tag to check whether a character has a (de)buff? I've been trying to make a skill that requires the ATK stat to be buffed but nothing has worked so far.

I've tried things like

<Restrict>

Custom: ($a._buffs.indexOf(2) < 1;)

Custom: ($a.isBuffAffected(2) !== true;)

</Restrict>
 

Siul

Veteran
Veteran
Joined
Nov 19, 2012
Messages
70
Reaction score
14
First Language
Spanish
Primarily Uses
Some coding required, but I can take care of that with an update. Unfortunately, I am working on getting another plugin released, then I have to focus on the Dual Wield update on this, THEN I can finally update this for percentages.

This restricts based on hp greater than 50%:

StatMin(hp): $(a.mhp * 0.5)

This is hp less than 50%:

StatMax(hp): $(a.mhp * 0.5)

This is hp greater than 23%:

StatMin(hp): $(a.mhp * 0.23

Does this answer your question?
Yes, sure thing. Indeed, I rather prefer coding answer rather than user-friendly-notetags since those kind of answer helps me to have a better understanding of coding and somehow I will stop asking silly things ^^'. 

Big thanks
 

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

Latest Threads

Latest Posts

Latest Profile Posts

This guy makes so many good hip hop tracks!
can't use certain things with SRDude's Battle Status Customizer? make the gauges show it lol. I got the gauges to show Olivia's Boost Points and other stuff.
Seeing people still using Kaus tiles with stolen contents makes me sad.
Microsoft tools are a blessing and a curse. They're great, but also insanely restrictive :/
When you feel annoyed by all the jokes and fake news, since in your country April's 1 is just a regular day...

Forum statistics

Threads
95,545
Messages
929,962
Members
125,825
Latest member
soulwistel
Top