Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Different Battle glows depending what armor you're wearing...

Anyone think they can create a script where when you choose your options and attack, you glow a different color depending on what armor you're wearing? This is what it currently looks like:

http://img.photobucket.com/albums/v122/ ... normal.png[/img]

Now, say that character is wearing armor called "Red Armor", All I have to do is go into the script, add somewhere (anywhere in the script) a code like,

Code:
['Red Armor', 'Armor2', 'Armor 3'] = color.#aa0011

Or something like that... so Red Armor, Armor2 and Armor 3 are all going to be the color assained from the Color Wheel (In this case, #aa0011, which is a red colored number). Then, when I play the game, the character will now look like this when choosing/attacking (Was edited in photoshop):

http://img.photobucket.com/albums/v122/ ... hanged.png[/IMG]

Think anyone can do that? It doesn't seem to be a really hard script to me but I don't have a lot of knowledge in scripting in Ruby... Any help is appreciated!
 
I'd like it exactly the way it is right now, just being able to change the color depending what armor you wear.

Edit: In other words, pulsating when choosing what to do, then a quick flash of that color when you actually attack.
 
I did this real quick. I haven't tested it, so if something goes wrong let me know.

Code:
class Game_Actor
  Blink_Colors = {}
  Blink_Colors.default = Color.new(255, 255, 255)
  attr_accessor :blink_color
  def blink_color
    return @blink_color.nil? ? Blink_Colors[@id] : @blink_color
  end
end

class Game_Enemy
  Blink_Colors = {}
  Blink_Colors.default = Color.new(255, 255, 255)
  attr_accessor :blink_color
  def blink_color
    return @blink_color.nil? ? Blink_Colors[@id] : @blink_color
  end
end

class Sprite_Battler
  alias_method :seph_spriteblinkcolors_sprbtlr_update, :update
  def update
    seph_spriteblinkcolors_sprbtlr_update
    unless @battler.nil?
      if @battler.is_a?(Game_Battler)
        self._blink_color = @battler.blink_color
      end
    end
  end
end

class RPG::Sprite
  attr_accessor :_blink_color
  alias_method :seph_spriteblinkcolors_rpgspr_init, :initialize
  alias_method :seph_spriteblinkcolors_rpgspr_updt, :update
  def initialize(viewport = nil)
    seph_spriteblinkcolors_rpgspr_init(viewport)
    @_blink_color = Color.new(255, 255, 255)
  end
  def update
    seph_spriteblinkcolors_rpgspr_updt
    if @_blink
      @_blink_count = (@_blink_count + 1) % 32
      if @_blink_count < 16
        alpha = (16 - @_blink_count) * 6
      else
        alpha = (@_blink_count - 16) * 6
      end
      r, g, b = @_blink_color.red, @_blink_color.green, @_blink_color.blue
      self.color.set(r, g, b, alpha)
    end    
  end
end

You can change the default actor and enemy blink colors here:

Code:
  Blink_Colors = {}
  Blink_Colors.default = Color.new(255, 255, 255)

Below Blink_Colors = {}, add lines like so:
Code:
Blink_Colors[actor_id] = Color.new(r, g, b)
Do that for each actor/enemy you want to change the blink color for.

You can change them mid game with:
Code:
$game_actors[actor_id].blink_color = Color.new(r, g, b) (or nil for default)

Let me know if you need any other info.
 
Alright, I tested the script. Although it's not exactly what I'm looking for, it's pretty close.

From what I noticed the Enemy Blinking is absolutely useless because it doesn't change the blink when either the enemy or actor use an action; it only changes the color of the blink from the actors choosing an action.

And while each actor having their own blink wasn't what I was looking for (I wanted a different blink for each armor, not actor... I can see where someone could mix the two), the way it's set up is certainly how I wanted it.

If you don't mind changing it to work for armors only then you can do it (It's your script). Otherwise, I can stick with this and I'll definitely put your name on top of the Script's Credits. Thanks!
 
Yeah, I can't find any other problems than the ones I've already mentioned. However, I don't understand how each actor can have their own glow... is it supposed to go,

Code:
Blink_Colors[[b]001[/b]] = Color.new(r, g, b)

Or,

Code:
Blink_Colors[[b]actor_001[/b]] = Color.new(r, g, b)

?

Because neither work... Anyway, go one with the armor glow! I really appreciate it!
 
SephirothSpawn;187862 said:
just : Blink_Colors[1] = Color.new(r, g, b)

Just change r, g, & b to a number between 0 and 255.

I will add actor, class, weapon, and armor glows, and you will be able to control which ones and such.

Hmm... nope it doesn't work. I've tried multiple things and only the default works and only when choosing what to do.

I await the extras you're going to add though!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top