FixedArray - Printable Version +- Save-Point (https://www.save-point.org) +-- Forum: Material Development (https://www.save-point.org/forum-8.html) +--- Forum: Scripts Database (https://www.save-point.org/forum-39.html) +--- Thread: FixedArray (/thread-8438.html) |
FixedArray - kyonides - 12-31-2021 FixedArray
The Array With a Fixed Size for XP VX & ACE
Have you ever wanted to keep a Ruby Array at a certain size? Was it a pain you know where to prevent it from ever increasing its size or length? Now you should not worry about that anymore! Even so you can still clear its contents at any given time. The Scriptlet Code: # * FixedArray Script Calls You may use p or print or puts or msgbox or msgbox_p script calls depending on your debugging needs and RM version. Actually >> is an alias of the unshift method. Code: array = FixedArray.new(3) Terms & Conditions You may include my nickname if you want.
It's free as in beer and speech!
RE: FixedArray - kyonides - 01-13-2022 Minor Update
During my playtesting of the KPartyActors and KBankai XP scripts, I noticed something curious.My scriptlet above did not return a FixedArray object but a mere Array whenever people had added some foreign array to the FixedArray list. Usually nobody would mind about it for it will still behave like an array, right? The problem was that it would no longer care about the maxsize limitation I had implemented in my custom child class. I have finally figured out what I had to do so I have come back to share it will our beloved audience. I know, I know. This is a scripting tool and nothing else but who knows? Some day it might help some people keep stuff in check. |