Hover Alerts Version: 1.0.3 Author: modern algebra Date: 4 November 2012
Version History
<Version 1.0.3> 2012.11.04 - Fixed a bug where the SE would play all the time when a repeated effect is selected <Version 1.0.2> 2012.10.28 - Fixed another bug with :disintegrate <Version 1.0.1> 2012.10.17 - Fixed a bug with :disintegrate and added the proximity feature <Version 1.0.0> 2012.10.16 - Original Release Description
This script lets you display a graphic which hovers above any given event, player or follower. The primary virtue of the script is that it allows for a feature like in Diablo, where characters that have something important to say have an exclamation point or something above their heads. However, it is not limited to that: this script can show any picture, icon, text, or combination of icon & text above any character.
A secondary (and completely optional) feature is that you can set it up so that whenever gold, items, weapons, or armours are received through their respective event commands, a hover alert will float above the player's head with the icon, name, and amount of the item received before fading out. (This feature is OFF by default in the script itself, while it is tied to switch 5 in the demo. You can and should change that if you want this feature.)
Features
Can show a graphic above any character on the map. Can show either pictures, icons, text, or a combination of icon & text. Sets up very simply through comments. You can set up to a dozen different features for each hover alert, including but not limited to relevant font options for text and a timer that will dispose the alert after a sufficient number of frames. You can also exclude any of those options from any given hover alert. If showing a picture, you can set it to animate by including in its name %[n] and n animation frames in the graphic itself. Can show a number of neat effects for the hover alerts, such as bouncing it, fading it out, or disintegrating it. Can activate an option which will automatically show an alert above the player with the icon, name, and amount of any items or gold gained through events and have it fade out or disintegrate. Screenshots Instructions
Paste the script into its own slot in the Script Editor, above Main but below Materials.
For instructions on configuration and use, please read the header of the script quite thoroughly. I also recommend that you download the
demo to see a number of sample hover alerts set up.
Script
Retrieve it from
Pastebin or from the
demo .
Credit
Thanks
Yin, for notifying me of the :disintegrate error, for suggesting the proximity feature, and for alerting me to a compatibility error with galv's Region Effects script Support
Please post in this topic at RMRK.net if you have any questions, suggestions, error reports, or comments about this script. Please do not message me privately, as it is more efficient and useful to answer any concerns you have in the topic where others may benefit from our correspondence.
Known Compatibility Issues
Spoiler for galv's Region Effects :
There is an error with
galv's Region Effects script, v. 1.7. If you walk through an event-generating region while a hover alert is showing, it will repeatedly restart, like a skipping CD.
To fix it, insert the following code into its own slot in the Script Editor, somewhere below galv's Region Effects script but still above Main.
#============================================================================== # Hover Alerts + galv's Region Effects # Compatibility Patch # Version: 1.0 # Authors: modern algebra (rmrk.net) & galv # Date: 5 October 2013 #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Description: # # This patch fixes an error between my Hover Alerts script and galv's Region # Effects script. Without it, a hover alert will constantly refresh when # walking through an event-generating region. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Instructions: # # Insert this script into the Script Editor (F11) in a new slot, somewhere # below galv's Region Effects script but still above Main. #============================================================================== #============================================================================== # ** Spriteset_Map #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # new method - gre_refresh_event #============================================================================== class Spriteset_Map #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Refresh Event #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def gre_refresh_event(id) # Find any existing event with the same ID esi = @character_sprites.find_index {|sprite| sprite && sprite.is_a?(Sprite_Character) && sprite.character.is_a?(Game_Event) && sprite.character.gre_event_id == id } if esi # Dispose Existing Event @character_sprites[esi].dispose if !@character_sprites[esi].disposed? @character_sprites.delete_at(esi) else esi = $game_map.events.values.size - 1 end # Refresh new region event @character_sprites.insert(esi, Sprite_Character.new(@viewport1, $game_map.events[id])) end end #============================================================================== # ** Game_Event #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # new method - gre_event_id #============================================================================== class Game_Event #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Event ID #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def gre_event_id @id # Get Event ID end end #============================================================================== # ** Game_Map #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ # Summary of Changes: # overwritten method - region_effect #============================================================================== class Game_Map #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * Region Effect #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ def region_event(dx, dy, event_id, map_id) # Retrieve event from the spawn map map_id = @map_id if map_id == 0 event = generated_region_event($data_spawn_map, event_id) # Generate ID new_id = @effect_var.length < Region_Effects::MAX_EFFECTS ? (@events.keys.max.nil? ? 1 : @events.keys.max + 1) : @effect_var.shift @effect_var.push(new_id) # Create new Event @events[new_id] = Game_Event.new(@map_id, event) @events[new_id].moveto(dx, dy) SceneManager.scene.spriteset.gre_refresh_event(new_id) # Refresh Event end end
Due to the nature of the error, that fix does, however, alter galv's script design, and it may cause errors down the line that I did not anticipate. I do not assign a high probability to that possibility, but I do not give any guarantees. If problems do occur, you can always just delete this patch, but you should also let me know.
I am currently unaware of any other compatibility problems, but please let me know if you encounter any.
Demo
See
attached .
Terms of Use
I adopt RMRK's default
Terms of Use .