RPG Maker Forums

Description

Offers a generic hook for other scripts to read notetags from the current page of events.

Prerequisites

None

How to use

In your own scripts, register your regex by calling the following method:

IAVRA::EVENT_TAGS.register:)key, /regex/, :int, :int)This will attempt to capture the first 2 groups from your regex and convert them to integers. Everything less than 2 will be set to nil in the result, while everything more than 2 will be discarded.Get the matches for that regex during runtime like this:

IAVRA::EVENT_TAGS.get_all(1, :key)IAVRA::EVENT_TAGS.get(1, :key)IAVRA::EVENT_TAGS.get(1, :key, 0)"get_all" returns an array containing all matches for the regex registered under :symbol."get" returns one of those matches and default to the first (0-indexed).

Each match is an array containing your captured groups.

Configuration

You can register your own capture categories by extending the CAPTURES variable.

CAPTURES = { :string => lambda {|value| value}, :symbol => lambda {|value| value.to_sym}, :int => lambda {|value| value.to_i}, :float => lambda {|value| value.to_f}}Terms of UseFree to use for both commercial and non-commercial games. Please give credit.

Credits

Iavra

FAQ

None so far

Changelog

- 1.01: Added support for named capture groups.

- 1.02: Renamed get to get_all and added a new get method for direct access.

- 1.03: Added an $imported entry for the script.

- 1.04: Shortened the hash building.

- 1.05: Rebuilt the script. Support for named groups was discarded, since i figured those don't get used much, anyway.

- 1.06: Reduced the number of iterations to improve performance.

Script

http://pastebin.com/UVw3ULHB

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,037
Messages
1,018,464
Members
137,821
Latest member
Capterson
Top