Monster Event Deletion
Authors: mad.array
Version: 1.0
Type: Snippet
Key Term: Misc Add-on
IntroductionJust a little fix up for a common problem in RMXP. When you erase an event just after a battle, it always appears for a frame before being deleted. WELL NO MORE! With this script you can erase specific events during the battle scene and they will be gone as soon as the battle is over. Please note that you should still set a switch or something else to make sure they don't come back when you re-enter the map though!
Features
- Monsters be-gone!
- People be-gone!
- Any event be-gone!
- Simple Call Script command
ScreenshotsHow do you show an erased event?
ScriptInsert somewhere above Main.
class Game_Temp
attr_accessor :battle_ids
alias init_battle_ids initialize
def initialize
init_battle_ids
@battle_ids = []
end
end
class Scene_Map
alias call_battle_ids call_battle
def call_battle
call_battle_ids
for i in 0...$game_temp.battle_ids.length
$game_map.events[$game_temp.battle_ids[i]].erase
end
$game_temp.battle_ids = []
$game_map.need_refresh = true
end
end
InstructionsTo use, simply set up a Call Script before your battle. Inside the script put:
$game_temp.battle_ids =[1,2,3]
Replacing the 1,2 & 3 with the event ids that need deleting. Again, make sure you still set up another, more permanent, method to make sure the event doesn't reappear.
CompatibilityI don't think there will be any compatability issues. Aliases call_battle from Scene_Map and Initialize from Game_Temp.
Credits and ThanksI did it all by my self. Yaaaaay!
Author's NotesCredit if you so wish, but it's 24 lines of code... several of which are blank. So feel free to just use it. Just don't claim it as your own!
I remember making it more interesting by playing a disappearing animation when the troop is defeated or, if you ran away, it would flash the event and stop its movement for a few seconds. Perhaps if you added features like that, this could be a helpful, and database-worthy, script.
Quote from: KK20 on March 13, 2013, 01:25:44 pm
and database-worthy, script.
If the header gets fixed. :X
But of course! (http://wiki.teamfortress.com/w/images/f/fd/Spy_yes02.wav)
In its current state, it is not database-worthy :D
I think I've fixed the header issue. I'm not sure what to add to the script. Perhaps automatically switching events to the 'down' pose instead of erasing the event? I know it's in one of the add-on packs so I might take a gander and see what I can see. Any other suggestions, let me know.
Actually, I might combine this with some other actor/event related scripts to give devs a bit more control. Should I post a new topic or alter this one?
I could write an addon to this script using my transitions module to allow users to specify a disappearance animation for the events that would disappear with this script.
I've been giving this some thought.As the whole point of the script is to make events disappear during the battle, rather than before or after, I'm going to forego the disappear animation/effect.
@ThallionDarkshine: The thought is still very much appreciated and if you want to add this feature then feel free.
I should also point out that this feature is included in the mad.array Mini Add-on pack. Could I request that this thread be closed? I won't be updating it and if there were any need for updates, I would put them on the add-on page. Thanks.