TDW - Restrict Weapons/Armors to Certain Actors

wrigty12

Veteran
Veteran
Joined
Jan 11, 2014
Messages
533
Reaction score
76
First Language
English
Primarily Uses
TDW Equip Actor Restriction - v 1.00
wrigty12
 ​
Intro - Allows you to have Weapons/Armors only be equippable by certain Actors.

Features -

- Have as many Actor Restrictions for each Weapon or Armor as you want, using names or ID numbers.

How To Use - Simply download, place in your js file, and install!

Parameters - None.

Note Tags -

Place the following tags in Armor or Weapon note boxes:

 

<actorRestriction: x>

Restricts the equip to only be equipped by actor with ID of x.

 

<actorRestriction: x y z>

Restricts the equip to only be equipped by actor with ID of x, y, and z.

You can place as many ID's in the tag, as long as they are all integers and

have spaces between them.

 

<actorRestriction: Bob>

Restricts the equip to only be equipped by actor named Bob.

 

<actorRestriction: Bob Mary Joe>

Restricts the equip to only be equipped by actors named Bob, Mary, and Joe.

You can place as many names in the tag, as long as they are all single words 

and have spaces between them.

 

You can also do any combination of names and ID numbers, as long as there are spaces between each.

Example:

 

<actorRestriction: Bob 1 Joe 3> will work just fine for actors Bob and Joe, as well as actors with

ids of 1 and 3.
Future Plans - None.

Terms of Use - Free for commercial and non-commercial use. Feel free to credit: wrigty12 or Tyler Wright

Download Link Here

Note - I am a beginner in the ways of making plug-ins and in JavaScript. If there is anything you see wrong, could be improved, or bugs you find, just let me know.
 

Sapphu

Villager
Member
Joined
Jan 13, 2016
Messages
15
Reaction score
3
First Language
English
Edit: Please disregard, I'm an idiot and didn't realize I did not have the most up-to-date version of Yanfly's ItemCore.

Just what I was looking for, thank you !! Seems to work for the most part.

 

However, it seems I'm already encountered a small (or big, depending) bug. While I was testing the plugin out and making sure other actors couldn't equip certain items, I noticed that when I would unequip and then re-equip an item (which I would do multiple times in a row), it would duplicate itself so that I would have two of that item in my inventory. It only seems to happen some of the time, and usually I only end up with 2 but just now I did it enough to end up with 3 of the same item. Even more oddly, it also did this with items that were not restricted to any actors. I'm pretty sure it is a plugin issue, though, seeing as though that it only seems to happen when I have this script on.

 

I thought this might be an issue stemming from the fact that the armor is initial equipment (idk, something about the game giving items to you automatically) but it does seem to be happening to other items gained in-world.

 

edit: Oh, I see. It appears it is duplicating all the items in my inventory (I only have equips atm, not sure if it would happen to regular items too). It's possible using the "Clear All" option in the menu is causing or contributing to the issue, it's difficult to tell.

edit 2: After a bit more tinkering it actually looks like it's a compatibility issue with Yanflys's ItemCore script. The duplicating doesn't seem to happen when I turn ItemCore off, but the testing I've done is minimal. You might want to mention that there's a possible issue when used in conjunction this other script, since it's such a universally used one.  :) Please feel to reply/message me for any more info I could give, or let me know if you think you've fixed the issue. I hope it gets fixed, since I really would love to use both of these scripts!
 
Last edited by a moderator:

wrigty12

Veteran
Veteran
Joined
Jan 11, 2014
Messages
533
Reaction score
76
First Language
English
Primarily Uses
Just what I was looking for, thank you !! Seems to work for the most part.

 

However, it seems I'm already encountered a small (or big, depending) bug. While I was testing the plugin out and making sure other actors couldn't equip certain items, I noticed that when I would unequip and then re-equip an item (which I would do multiple times in a row), it would duplicate itself so that I would have two of that item in my inventory. It only seems to happen some of the time, and usually I only end up with 2 but just now I did it enough to end up with 3 of the same item. Even more oddly, it also did this with items that were not restricted to any actors. I'm pretty sure it is a plugin issue, though, seeing as though that it only seems to happen when I have this script on.

 

I thought this might be an issue stemming from the fact that the armor is initial equipment (idk, something about the game giving items to you automatically) but it does seem to be happening to other items gained in-world.

 

edit: Oh, I see. It appears it is duplicating all the items in my inventory (I only have equips atm, not sure if it would happen to regular items too). It's possible using the "Clear All" option in the menu is causing or contributing to the issue, it's difficult to tell.edit 2: After a bit more tinkering it actually looks like it's a compatibility issue with Yanflys's ItemCore script. The duplicating doesn't seem to happen when I turn ItemCore off, but the testing I've done is minimal. You might want to mention that there's a possible issue when used in conjunction this other script, since it's such a universally used one.  :) Please feel to reply/message me for any more info I could give, or let me know if you think you've fixed the issue. I hope it gets fixed, since I really would love to use both of these scripts!
Hmm. I made this plugin with most Yanfly plugins always on... 

I cannot replicate your issue, even with only Yanfly Item Core and my plugin on.. do you have the latest version of item core?
 

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
818
First Language
English
Primarily Uses
Always good to see someone else moving from plugin requests to plugin releases :cutesmile:
 

Sapphu

Villager
Member
Joined
Jan 13, 2016
Messages
15
Reaction score
3
First Language
English
Hmm. I made this plugin with most Yanfly plugins always on... 

I cannot replicate your issue, even with only Yanfly Item Core and my plugin on.. do you have the latest version of item core?
/facepalm

I could have sworn I had completely updated all my Yanfly plugins (considering I batch-uploaded them yesterday, unless a few of whats in that zip file are a little out of date, or maybe I did something weird), but it does seem that for some reason I still had vers. 1.7 of ItemCore. I updated it and it does seem to have fixed the problem. Super sorry for wasting your time! Thank you so much again for the script, it was exactly what I needed. 
 

wrigty12

Veteran
Veteran
Joined
Jan 11, 2014
Messages
533
Reaction score
76
First Language
English
Primarily Uses
/facepalm

I could have sworn I had completely updated all my Yanfly plugins (considering I batch-uploaded them yesterday, unless a few of whats in that zip file are a little out of date, or maybe I did something weird), but it does seem that for some reason I still had vers. 1.7 of ItemCore. I updated it and it does seem to have fixed the problem. Super sorry for wasting your time! Thank you so much again for the script, it was exactly what I needed. 
Not a waste at all! Any time I can help someone, it benefits both of us.

But it's a good RPGMaker MV lesson: If something doesn't work, check for plugin updates. Especially Yanfly's, because she is constantly fixing things.
 

signaltome

Veteran
Veteran
Joined
Oct 31, 2015
Messages
37
Reaction score
3
First Language
English
Any way this could be altered to restrict items? I've asked and asked and no one has answered and then I search for myself and find something VERY close to


what I was searching for, but now quite. I have training manuals that should obviously only work with specific characters, and while they cannot actually learn the


skill in them, it is bothersome to actually know that they can "use" it.


As it is I need to have them as reusable so it is not used up on the wrong person.


Any help very much appreciated guys.
 

wrigty12

Veteran
Veteran
Joined
Jan 11, 2014
Messages
533
Reaction score
76
First Language
English
Primarily Uses
So you want certain items only to be used by certain actors? I can try to do this
 

signaltome

Veteran
Veteran
Joined
Oct 31, 2015
Messages
37
Reaction score
3
First Language
English
If you could I would be grateful. :D I would be the first to say I have barely to no grasp of programming or scripting. I can usually grasp the concept enough to know its use, but other than that... I did take a look at your java script for wepons and armor and it feels to me that it should be able to do the same for items like I want: To have a consumable item (say, a book/magazine for instance!) that only actor x can use, if another actor, say "y" tries to use it will only get a "cannot use" or similar and it will not be consumed, only "x" can do so.


Of course, it does not have to be a consumable item, I guess it will work on items in general but that is what i want to do with it right now. Like actorequip <actorRestriction: x> only with items. And I am babbling because it is 3 am. Oh well.


No rush and in your own time. If it is not possible then I will admit defeat. If it is the least I can do is add you to my growing credit list! :)
 
Last edited by a moderator:

wrigty12

Veteran
Veteran
Joined
Jan 11, 2014
Messages
533
Reaction score
76
First Language
English
Primarily Uses
After multiple attempts, I cannot get it to work properly. Using an item takes a different "path" than determining if an equipment can be equipped or not, and finding the correct path for the item use is what I cannot find myself able to do.


I will keep digging in, but as of now I cannot do this... :/ (Remember, I still am a n00b at JavaScript. Someone more qualified may be able to do this for you)
 

signaltome

Veteran
Veteran
Joined
Oct 31, 2015
Messages
37
Reaction score
3
First Language
English
Then I will keep looking. If you eventually find a solution let me know! ;) Your current plugin works great, maybe I will use it. So keep up the good work!
 

nAtAstearns

Warper
Member
Joined
Sep 5, 2016
Messages
1
Reaction score
0
Primarily Uses
Good day to you!

I was wondering if there was a way to change this script a bit to restrict items (instead of weapons and armors) to certain actors. I was thinking of making only a certain class be able to use items, such as grenades that they could use from their inventory.


Thank you much for your help.
 

wrigty12

Veteran
Veteran
Joined
Jan 11, 2014
Messages
533
Reaction score
76
First Language
English
Primarily Uses
Good day to you!

I was wondering if there was a way to change this script a bit to restrict items (instead of weapons and armors) to certain actors. I was thinking of making only a certain class be able to use items, such as grenades that they could use from their inventory.


Thank you much for your help.
Sorry for the late reply, I just noticed this post.


Restricting item use is a different beast that preventing equipping, but I can look into it and see if I can write up something for you.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

I forgot I had an account on rpgmakercentral lol
"What do you think the best place to visit on this cold days?" "Hell..."
Been so busy lately that I wonder if I should slowly start preparing the advent calendar resources so I have enough in december.
Man, I wish it was harder for mean d-holes to make me feel like crying.
Made 8 games. Was aiming for 20. Gonna go for 40. Because 20 + 20. /Bed.

Forum statistics

Threads
94,538
Messages
921,718
Members
124,400
Latest member
Standanddeliver
Top