TDW - Restrict Weapons/Armors to Certain Actors

Discussion in 'JS Plugin Releases (RMMV)' started by wrigty12, Jan 17, 2016.

  1. wrigty12

    wrigty12 Veteran Veteran

    Messages:
    533
    Likes Received:
    76
    First Language:
    English
    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.
     
    #1
  2. Sapphu

    Sapphu Villager Member

    Messages:
    15
    Likes Received:
    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: Jan 18, 2016
    #2
  3. wrigty12

    wrigty12 Veteran Veteran

    Messages:
    533
    Likes Received:
    76
    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?
     
    #3
  4. DreamX

    DreamX Veteran Veteran

    Messages:
    816
    Likes Received:
    809
    First Language:
    English
    Always good to see someone else moving from plugin requests to plugin releases :cutesmile:
     
    #4
    wrigty12 likes this.
  5. Sapphu

    Sapphu Villager Member

    Messages:
    15
    Likes Received:
    3
    First Language:
    English
    /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. 
     
    #5
    wrigty12 and DreamX like this.
  6. wrigty12

    wrigty12 Veteran Veteran

    Messages:
    533
    Likes Received:
    76
    First Language:
    English
    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.
     
    #6
  7. signaltome

    signaltome Veteran Veteran

    Messages:
    37
    Likes Received:
    3
    Location:
    Norway
    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.
     
    #7
  8. wrigty12

    wrigty12 Veteran Veteran

    Messages:
    533
    Likes Received:
    76
    First Language:
    English
    So you want certain items only to be used by certain actors? I can try to do this
     
    #8
  9. signaltome

    signaltome Veteran Veteran

    Messages:
    37
    Likes Received:
    3
    Location:
    Norway
    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: Jan 24, 2016
    #9
  10. wrigty12

    wrigty12 Veteran Veteran

    Messages:
    533
    Likes Received:
    76
    First Language:
    English
    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)
     
    #10
  11. signaltome

    signaltome Veteran Veteran

    Messages:
    37
    Likes Received:
    3
    Location:
    Norway
    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!
     
    #11
    wrigty12 likes this.
  12. nAtAstearns

    nAtAstearns Warper Member

    Messages:
    1
    Likes Received:
    0
    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.
     
    #12
  13. wrigty12

    wrigty12 Veteran Veteran

    Messages:
    533
    Likes Received:
    76
    First Language:
    English
    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.
     
    #13

Share This Page