Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: mad.array on March 13, 2013, 09:00:37 am

Title: [XP] Monster Event Deletion
Post by: mad.array on March 13, 2013, 09:00:37 am
Monster Event Deletion
Authors: mad.array
Version: 1.0
Type: Snippet
Key Term: Misc Add-on



Introduction

Just 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




Screenshots

How do you show an erased event?


Script

Insert somewhere above Main.
Spoiler: ShowHide

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



Instructions

To 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.



Compatibility

I don't think there will be any compatability issues. Aliases call_battle from Scene_Map and Initialize from Game_Temp.


Credits and Thanks

I did it all by my self. Yaaaaay!


Author's Notes

Credit 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!
Title: Re: [XP] Monster Event Deletion
Post by: KK20 on March 13, 2013, 01:25:44 pm
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.
Title: Re: [XP] Monster Event Deletion
Post by: Blizzard on March 13, 2013, 02:31:26 pm
Quote from: KK20 on March 13, 2013, 01:25:44 pm
and database-worthy, script.


If the header gets fixed. :X
Title: Re: [XP] Monster Event Deletion
Post by: KK20 on March 13, 2013, 02:41:56 pm
But of course! (http://wiki.teamfortress.com/w/images/f/fd/Spy_yes02.wav)

In its current state, it is not database-worthy :D
Title: Re: [XP] Monster Event Deletion
Post by: mad.array on March 13, 2013, 08:48:17 pm
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.
Title: Re: [XP] Monster Event Deletion
Post by: mad.array on March 18, 2013, 11:11:02 am
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?
Title: Re: [XP] Monster Event Deletion
Post by: ThallionDarkshine on March 18, 2013, 12:19:25 pm
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.
Title: Re: [XP] Monster Event Deletion
Post by: mad.array on March 29, 2013, 01:01:25 pm
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.