Modern Algebra Hover Alerts - Sprite Disposal

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
110
First Language
English
Primarily Uses
RMVXA
Hover Alerts script page: http://rmrk.net/index.php?topic=46911.0
Original script:
Once you exit the alert's proximity range (ex: 4 tiles), the alert sprite gets immediately disposed of/hidden.
I'm having a hard time figuring out what part of the script tackles this; trying to modify Sprite_Character inside of the script, maha_finish_effect, and so on hasn't proven to be successful. The goal would be to add a better transition (some sort of fade or flash effect) at the end, rather than having the alert immediately dissapearing.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,402
Reaction score
499
First Language
English
Primarily Uses
RMVXA
Under line 650 are the settings for the effects.
If you want it to fade, you just need to specify : fade in the \ Hover_alert comment for effect =
You could also change the values if you feel that 48 frames is too short to fade.
 

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
110
First Language
English
Primarily Uses
RMVXA
Under line 650 are the settings for the effects.
If you want it to fade, you just need to specify : fade in the \ Hover_alert comment for effect =
You could also change the values if you feel that 48 frames is too short to fade.
I'm not talking about the fade in effect that can be specified in the event comment. Once you're out of the hover alert's range, it immediately dissapears. I'd like to find what section of code I need to edit to add a fade out effect before the hover alert vanishes.
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
187
Reaction score
67
First Language
English
Primarily Uses
RMXP
Looks like line 493, where the visibility is set based on your character's proximity. You'd probably then make an else-case for the next condition directly below it for when it is not visible, then put your "special effect" code there, making sure you only run it once.
 

Roninator2

Gamer
Veteran
Joined
May 22, 2016
Messages
2,402
Reaction score
499
First Language
English
Primarily Uses
RMVXA
Ya, I figured that out after realizing what the problem was when testing.
Haven't been able to get it working yet. Time for bed.
I have this so far.
Code:
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Fade HoverAlert Effect
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maha_fade_effect
    if @hover_alert.proximity > 0
      x = @character.distance_x_from($game_player.x).abs
      y = @character.distance_y_from($game_player.y).abs
    end
    if Math.hypot(x, y) <= @hover_alert.proximity
    else
      while @effect_time > 0
        self.opacity = 12*@effect_time if @effect_time < 16
        @effect_time -= 1
      end
      maha_finish_effect
    end
  end
and on line 684 I changed it to else maha_fade_effect # Close

But this still doesn't work.
 

ZirconStorms

Veteran
Veteran
Joined
Dec 22, 2014
Messages
359
Reaction score
110
First Language
English
Primarily Uses
RMVXA
Looks like line 493, where the visibility is set based on your character's proximity. You'd probably then make an else-case for the next condition directly below it for when it is not visible, then put your "special effect" code there, making sure you only run it once.
Seems to work smoothly, thank you.

Ya, I figured that out after realizing what the problem was when testing.
Haven't been able to get it working yet. Time for bed.
I have this so far.
Code:
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Fade HoverAlert Effect
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maha_fade_effect
    if @hover_alert.proximity > 0
      x = @character.distance_x_from($game_player.x).abs
      y = @character.distance_y_from($game_player.y).abs
    end
    if Math.hypot(x, y) <= @hover_alert.proximity
    else
      while @effect_time > 0
        self.opacity = 12*@effect_time if @effect_time < 16
        @effect_time -= 1
      end
      maha_finish_effect
    end
  end
and on line 684 I changed it to else maha_fade_effect # Close

But this still doesn't work.
I got it to work thanks to KK20's reply, but I appreciate you trying to help.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Just got a better look at the MZ RTP. I'm very happy with it, especially the sci-fi tiles and sprites. Glad I pre-ordered.
I've just checked the VisuStella Plugins for MZ and there are already 11 plugins. The Yanfly team(perhaps a big one?) really works so effectively and efficiently that some MZ users can likely use tons of Yanfly plugins right after MZ's released (still 13 days from now). I wonder if any other plugin developer(or team) will try to compete with Yanfly this time, no matter how slim the chance to win is :)
Hello! :kaopride:I am new to RPG Maker, though I have been lurking the forums for a while. :kaoswt: Hope to make some friends and learn some stuff here! :kaothx:
And now since I've got the whole game parts working, the *contents* await.

I've invented a cheap way to manipulate weather. Should I get it patented?
It's change from frikin' hot to beautiful at the cost of only 4 beers.

Forum statistics

Threads
100,592
Messages
977,573
Members
132,189
Latest member
akshpatil
Top