Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #═╦═════════════════════════════════════════════════════════════════════════════
- # ║ § Common Event Queues (v1.2) by Enelvon [License: CC BY-SA 3.0]
- # ║ <RMVX Ace>
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Change Log
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ v1.0 (May 20th, 2013) - Script written.
- # ║ v1.1 (May 20th, 2013) - Fixed something I overlooked.
- # ║ v1.2 (June 5th, 2014) - Fixes accidental deletion - reported by Zalerinian
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Summary
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ This script allows common events to be queued and run in order.
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Required Scripts
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ None.
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Known Incompatibilities
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ None.
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Installation
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ Put this somewhere below Materials.
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Configuration
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ None.
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Script Calls/Other
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ Use this to add common events to the queue:
- # ║
- # ║ $game_temp.reserve_common_event(!ID!)
- # ║
- # ║ With !ID! being the ID of the common event in question. It's essentially
- # ║ the same as the old method, except that it now runs as a queue so multiple
- # ║ common events can be run in a row without issue, such as in Tsukihime's
- # ║ "Equip Events" script.
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Aliased Methods
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ ● class Game_Temp
- # ║ initialize
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ § Redefined Methods
- #─╫─────────────────────────────────────────────────────────────────────────────
- # ║ ● class Game_Temp
- # ║ reserve_common_event
- # ║ common_event_reserved?
- # ║
- #═╬═════════════════════════════════════════════════════════════════════════════
- # ║ ▼ class Game_Temp
- #═╩═════════════════════════════════════════════════════════════════════════════
- class Game_Temp
- alias en_ceq_gt_i initialize
- def initialize
- en_ceq_gt_i
- @common_event_queue = []
- end
- def reserve_common_event(common_event_id)
- @common_event_queue << common_event_id if common_event_id > 0
- end
- def common_event_reserved?
- @common_event_id = @common_event_queue[0]
- @common_event_id != nil
- end
- end
- #═╦═════════════════════════════════════════════════════════════════════════════
- # ║ ▲ class Game_Temp
- #═╩═════════════════════════════════════════════════════════════════════════════
Advertisement
Add Comment
Please, Sign In to add comment