Battle Use Limits

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.



Download

Get it at Hime Works!

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 asingle battle you can't use it again until the next battle.

Notes

There is a display issue when using items: if no one can use it, the item is not even displayed in the window. This is the default behavior and am not sure how it should be handled.
i post in your blog about solution to show how many usage left for the skill.

you could create message escape code

ex:

\lim[41]

skill 41 have 3 limit usage. and already used once.

so it will print:

2 / 3

so we can tag the skill description:

Usage Left : \lim[41]

there's already global text escape codes already out there.
Got a script I can just add the convert code to? So I don't have to write myself.
yanfly message script?

used by many.

https://yanflychannel.wordpress.com/rmvxa/core-scripts/ace-message-system/

but usually all message code script is located at window base method: convert_escape_characters

you could alias that method.

then in the method call the alias. store it inside a variable. then do .gsub! to that variable. then return that variable.

so it will compatible with most message scripts (i think)

some example: (from Enelvon External Text)

class Window_Base  alias en_et_wb_cec convert_escape_characters  def convert_escape_characters(*args, &block)    result = en_et_wb_cec(*args, &block)    result.gsub!(/\eT\[(.+)\]/i) { if $game_text.keys.include?($1)                                      $game_text[$1][1]                                   else                                      "Invalid key [#{$1}]. No matching text exists."                                   end                                 }    result  endend
😀

Original thread: https://forums.rpgmakerweb.com/threads/battle-use-limits.13988/