Battle Use Limits

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

This script allows you to limit the number of times a skill or item can
be used in a single battle. The use counts are reset at the end of each battle.

battleUseLimits1

Download

Script: download here

Installation

Place this script below Materials and above Main

Usage

Note-tag items or skills with

<battle use limit: x>

For some integer x. Once you’ve used a skill or item that many times in a
single battle you can’t use it again until the next battle.

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

27 Responses

  1. Pumamori says:

    Hey! I stumbled upon a fatal bug. It seems that the script doesn’t like the scope “All Allies” all too much, at least that’s when it throws me the following error:

    http://puu.sh/hs0wc/067ceb4215.png

    Is there anyway you could help me out with this? I’d really rather not pass on this script, as it adds a whole level of depth to the skills of one of my main actors.

    • Hime says:

      I have tested a potion with All Allies scope and it does not crash the game. Try it in a new project and verify that it is not a compatibility issue.

      • Pumamori says:

        Indeed, my bad. I located the source of the error in a script from Moghunter, who basically overwrites a targeting method that skips the selection when the scope is set to “All Allies/Enemies”. Sadly, I need both scripts and am not experienced enough to adjust it on my own, so I’ll just have to avoid using items with an “All” scope.

        Terribly sorry for wasting your time, keep up the good work!

        • Hime says:

          Try moving this script above and below and see if that makes a difference. The default scripts do not prompt for selection when the scope targets all.

          • Pumamori says:

            Sadly, this changed nothing. Still the same error here, no matter where I put it. 🙁
            http://puu.sh/hwiFR/fe50861888.png

          • Pumamori says:

            Hey there again. I really don’t want to waste your time, but could you just quickly check if this could be the source of the issue..? If I disable this particular script, the “All” scope works as it should.

            (Snippet: http://pastebin.com/WQUJyeA3)

            (Full Script, Translated by me: http://pastebin.com/fskQnh6q)

            Again, terribly sorry if I annoy you.

          • Hime says:

            I just tested the two scripts and they work together.

          • Pumamori says:

            Odd, seeing as it works fine if I disable it in my project. Well, thanks for going out of your way to check it anyway. I guess I’ll just have to delay the release a bit further back to find the issue! I really appreciate it! (:

          • Hime says:

            To be absolutely sure, take those two scripts and move them into a new project of its own and see if the error occurs. It’s possible that there are multiple scripts working together to cause the problem, and disabling one of them just happens to solve it.

          • Pumamori says:

            Interesting! I pasted the scripts together in a new project, and the exact same error popped up. I recorded a super awkward slow-downed gif to try and show you, it includes only using your script here, in addition to the battle cursor one. The Potion, as seen at the end, is set to target “All Allies”. ( http://puu.sh/hDZ2I/25c02e8bc5.gif )
            Gosh, this is frustrating! I just want to get back to actual story progression, haha x(

          • Hime says:

            Ok I think I see what’s going on. When I tested the scripts, I had two actors in the party, and it was the first actor that used the potion. The second actor simply guarded.

            The bug occurs when the last actor uses something that does not require target selection, because once the last actor chooses the item/skill, the game will begin executing actions. Unfortunately, the cursor script will still try to check if the current item is enabled (for targeting purposes), and something goes wrong.

            I’ve updated my script to prevent that check from causing issues.

          • Pumamori says:

            Works like a charm! Thank you so much for your help Hime. I really owe you one, if you ever need anything, please, feel free to send me a message. Been doing translations, video and image editing for years, in case you’re interested in anything like that!

  2. Setsuna 03 says:

    Hello Hime,

    I’m currently working on a project that is planned for commercial release. This script does almost exactly what I need for my current design task! What’s the best way to talk with you about commercially licensing this script? Keep up the solid work!

    Thanks,
    setsuna_03

  3. sean says:

    I meant zero uses, not items. Also to the above, I guess I wanted to see if there was a way to
    turn this script into a “consume x” one because right now, the default RMVXace has either use once or use forever. . For example, I want a want of cure wounds which
    could be used 50 times before it turned into dust, which is something it cannot do, at least not with eventing for every item.

  4. sean says:

    How would you do it if you reached zero items, the item would disappear with some sort of message like “item x has ran out of magic.” I know the reset lines would have to be deleted but how would you call for the item to be deleted and would the charge be stored from battle?…i.e. I set the integer to 50 and the item was used five times in one battle? Would this code allow the game to “remember” that the item only has 45 charges left. Sorry for all of the questions but I am new to Ruby and RPGMaker VX ace.

  5. Kagu says:

    Is there a way I can clear the battle use count another way instead of having it take effect every beginning and end of every battle? Say, with a line of script or something?

  6. Platoon says:

    Nice script bro!

    There’s a bug when you have 0 items to use in battle and press OK at the blank item selection:
    ‘undefined method “id” for nil:Nilclass’

    Any fix? 🙂

  7. estriole says:

    how about item description. by creating escape code (there’s global escape code scripts already)
    Usage Left : lim(41)
    example skill 41 limit is 3 per battle and already used once…
    will print…
    Usage Left : 2

    • estriole says:

      after posting… have some thought… it would be better if:
      Usage Left : 2 / 3
      sorry for double post. cannot edit.

  8. Rodjie says:

    just a suggestion, how about showing how many times left? 🙂 thanks nice script

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax