Main Menu
  • Welcome to The RPG Maker Resource Kit.

[VXA] Hover Alerts

Started by modern algebra, October 17, 2012, 01:54:21 AM

0 Members and 2 Guests are viewing this topic.

outlandish

Great script! This is just what I always wanted but never got around to asking for. Good job!  ;D

veltonvelton

My game is literally at a standstill as this was sort of part of the main concept of it. Modern Algebra, need your help!
  • Web designer
  • Music producer/DJ
  • Graphic Designer
Why am I 'training wheels'??

modern algebra

Sorry veltonvelton. I will try to get to it tonight or tomorrow.

And thanks outlandish! I am happy to hear that.

modern algebra

Quote from: veltonvelton on November 21, 2012, 03:52:31 AM
Bug report - when receiving an item whilst moving, the icon appears repeatedly for every step until the player stops moving. Using a wait command doesn't fix the problem; perhaps the player has to take their hand off the arrow key to make it stop? But yeah. Quite important as I use this as a Zelda-like long grass coin finding thing.

Hey. Sorry, I have been unable to recreate the error. Receiving an item while walking works fine in my demo, as far as I can tell.

Could you perhaps recreate the error in the demo and send me a copy so I can see what's going wrong?

pinkapinkie

I noticed a little problem with Victor's Control Codes and Text scripts.
When autogaining an item with some codes to change the color, for example, it shows the code and not the item's name color changed.
I don't know which of the two scripts causes the problem though, so I'll link both:

Control Codes: http://victorscripts.wordpress.com/rpg-maker-vx-ace/windows-scripts/control-codes/
Control Text: http://victorscripts.wordpress.com/rpg-maker-vx-ace/windows-scripts/control-text/

Thanks

modern algebra

#30
Well, unfortunately, that's not really a problem I'm willing to fix at the moment. In order to have the script interpret colour codes, I would either have to make the sprite an invisible window or else manually account for every possible code in every possible script. The former I do not want to do as windows will potentially cause more lag and it would foreclose the possibility of some effects, such as flash or showing animations on the hover alert. The latter I simply do not want to do because it's way too much work for very minor benefit.

However, if you want to just account for colour codes, you could add this code into its own slot somewhere below the Hover Alerts script but still above Main:

#==============================================================================
# ** Sprite_HoverAlert
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    overwritten method - maha_draw_text
#==============================================================================

class Sprite_HoverAlert
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Text
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def maha_draw_text
    # Else draw the word
    x = 0
    self.bitmap = Bitmap.new(24, 24)
    if @hover_alert.name && !@hover_alert.name.empty?
      maha_reset_font_settings
      # Retrieve actual string
      txt = @hover_alert.name.gsub(/\\[Cc]\[(\d+)\]/, "")
      ts = bitmap.text_size(txt)
      if @hover_alert.icon_index > 0
        x = 28
        ts.width += 28
        ts.height = 24 if ts.height < 24
      end
      # Resize
      bitmap.dispose
      self.bitmap = Bitmap.new(ts.width + 4, ts.height + 4)
      maha_reset_font_settings
      @hover_alert.colour = $1.to_i if @hover_alert.name[/\\[Cc]\[(\d+)\]/]
      bitmap.font.color = text_color(@hover_alert.colour)
      # Draw text
      bitmap.draw_text(x, 0, bitmap.width - x, bitmap.height, txt, 1)
    end
    # Draw Icon
    @hover_alert.icon_hue == 0 ? maha_draw_icon(@hover_alert.icon_index, 0, (height - 24) / 2) :
      maha_draw_icon_with_hue(@hover_alert.icon_index, @hover_alert.icon_hue, 0, (height - 24) / 2)
    @ap_time = -1
    @ap_width = bitmap.width
  end
end


Keep in mind that if this script is ever updated, retaining this code could interfere with other changes to the script.

veltonvelton

I've had a problem with VX licenses (namely not having one) so I'm waiting to pay for it when I get paid. So yeah, I'll send you something then if you're still ok to help.
  • Web designer
  • Music producer/DJ
  • Graphic Designer
Why am I 'training wheels'??

modern algebra

Sure. VXA is currently on sale for 2 for 1, so if you wanted to get someone a Christmas gift as well, it's a good time to do so. I think the sale goes to the end of December, but don't trust me on that, because that memory is entirely unsourced. My memory of that is about as strong as the time I remember kissing Anne Hathaway, so be alert!

The Frontera

Epic script Modern Algebra!
I have a suggestion for a thing I need for my project...
I noticed that if the graphic of the event is set to none, the icon is shown in place of the event [1]
If there's graphic, the icon is shown over the event. [2]
Is there a way to be able to show the icon ON the event even if set the graphic? (like in [1], but this time there's graphic exactly below it)
Thanks in advance
Visit my official website for resources, games, and informations.
Download for free my (great) videogames and resources.
Link:
http://thefrontera.knossus.net

Watch also my great videos !
Link: Awesome videos here

The VX Project I'm working on: (Click to see the Description)


ALL MY AWESOME COMPLETED GAMES [OPEN THE SPOILER!!!]
[spoiler]
My Completed VX Games:
The Frontera Legends (Click to Download)


My Completed XP Games:
The Frontera 2 (Click to Download)


The Frontera 1
Unfortunatly I can't have more than three pictures in my signature...
However, download it HERE (without the cool image)
[/spoiler]

modern algebra

For how many graphics do you need to show both a graphic and an icon? If it is a small number, then you could just edit the graphics themselves and paste the icon where you want it to go.

The Frontera

Yeah, you are right, that's an option.
But, for example, if I want to show the icon with the flash or fade effect...
In my project I need to show that icon on items that can be destroyed by bombs, and it would be cool if it was flashing.
Visit my official website for resources, games, and informations.
Download for free my (great) videogames and resources.
Link:
http://thefrontera.knossus.net

Watch also my great videos !
Link: Awesome videos here

The VX Project I'm working on: (Click to see the Description)


ALL MY AWESOME COMPLETED GAMES [OPEN THE SPOILER!!!]
[spoiler]
My Completed VX Games:
The Frontera Legends (Click to Download)


My Completed XP Games:
The Frontera 2 (Click to Download)


The Frontera 1
Unfortunatly I can't have more than three pictures in my signature...
However, download it HERE (without the cool image)
[/spoiler]

modern algebra

I'm sorry. I had initially misunderstood your request. There is currently no way to adjust the position of the hover alert manually.

I am not opposed to adding that feature, but I suspect it will be some time before I can get around to it.

The Frontera

Thank you!
I'll be waiting fot that feature :)
Visit my official website for resources, games, and informations.
Download for free my (great) videogames and resources.
Link:
http://thefrontera.knossus.net

Watch also my great videos !
Link: Awesome videos here

The VX Project I'm working on: (Click to see the Description)


ALL MY AWESOME COMPLETED GAMES [OPEN THE SPOILER!!!]
[spoiler]
My Completed VX Games:
The Frontera Legends (Click to Download)


My Completed XP Games:
The Frontera 2 (Click to Download)


The Frontera 1
Unfortunatly I can't have more than three pictures in my signature...
However, download it HERE (without the cool image)
[/spoiler]

ekomega

When I set AUTOGAIN_HOVERALERTS_SWITCH at line 182 = 0, the item gain alerts still pop up.  I think the problem is at line 390, you have if "MA_HoverAlert::AUTOGAIN_HOVERALERTS_SWITCH >= 0".  It should be > 0, not >= 0, right?

Changing it to just > worked for me.

Also, thanks for the script!!!!  ;D

P.S. I just registered, and wanted to mention that the CAPTCHA type verification is impossible to read.  And I hate pop-ups (req. for listening), so this part of registration and posting is difficult and annoying.

modern algebra

Yes, you're correct about the error. The CAPTCHA stuff is annoying but is necessary to protect against spam bots. Once you've made a few posts, you no longer have to verify your humanity.

omoney

Is there a way to change the text color of the auto popup text in game? For example I want the color to be red when I lose items and the color to be green? when I gain items? Thanks

Acezon

How can I remove the icon when a player gains an item?

modern algebra

You can go to line 446 in the script, which should look like this:


      icon_hue = $imported[:MAIcon_Hue] ? item.icon_hue : 0
      $game_player.show_hover_alert(text, item.icon_index, icon_hue,


Replace both lines with:


      $game_player.show_hover_alert(text, 0, 0,

Yin

Is there an option to show a windowskin, ( any image that can scale with the text inside ) behind the text? It gets kind of hard to read on certain backgrounds.

modern algebra


nev182

First off, you make amazing things happen Modern Algebra! I love your scripts when I can figure them out. =) I'm new to scripting and I still can't get Hover Alerts to work. Can you or someone post screenshots or a sample game so I can see the correct implementation of the script?

Thanks

bluntsword

Hey Nev,

There's a sample game to download that really helped me when it comes to understanding how to use this script. Check it out in the main post!

nev182

Quote from: bluntsword on July 30, 2013, 08:51:17 PM
Hey Nev,

There's a sample game to download that really helped me when it comes to understanding how to use this script. Check it out in the main post!

The link to the demo didn't work a few days ago when I tried it and now it does. Maybe an error on my part I don't know. Thanks Bluntsword!

Gaming Princess Luna

That is a really cool script, I was looking for something like this for my GIAW, but it's kinda to late. :(
But anyway, I will use this in the next demo I will release after the GIAW, if you don't mind. ;)
I surely will give you credits for this great work, there is no question about it... :D

Yin

Suggestion:
Auto Alerts for stuff in the actor section (gain or lose Exp, HP, MP, Level, skills, etc) through an event command.