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.

Sprite_Battler question

Well, I'm having a problem trying to add something to this RTAB script...
Basically I just need to know how the 'appear' command works o.O
It's used here:
Code:
if not @battler.hidden and not @battler.dead? and
         (@battler.damage.size < 2 or @battler.damage_pop.size < 2)
        appear
        @battler_visible = true
      end
I need to make it instant instead of fading in x_x
Tried commenting it out, ended up with wierd ghost sprites for the enemies:
http://img135.imageshack.us/img135/7564 ... duppn7.png[/IMG]

When I leave it in, it doesn't happen so... I just need to know exactly what it's doing that prevents that <.<
 

Anonymous

Guest

The help file is your friend.

Past this above Game_Temp:

Code:
module RPG
  class Sprite
    def appear
      self.blend_type = 0
      self.color.set(0, 0, 0, 0)
      self.opacity = 0
      @_appear_duration = 16
      @_whiten_duration = 0
      @_escape_duration = 0
      @_collapse_duration = 0
    end
  end
end

Then change the 16 to 1.
 
Something like this should work. Just insert below all your scripts.

Code:
class RPG::Sprite
  Auto_Appear_Battlers = [Game_Enemy, Game_Actor]
  alias_method :seph_autoappear_rpgspr_appear, :appear
  def appear
    seph_autoappear_rpgspr_appear
    if self.is_a?(Sprite_Battler)
      if Auto_Appear_Battlers.include?(self.battler)
        self.opacity = 255
        @_appear_duration = 0
        return
      end
    end
  end
end

You keys hear are :

Code:
    def appear
      self.blend_type = 0
      self.color.set(0, 0, 0, 0)
      self.opacity = 0
      @_appear_duration = 16
      @_whiten_duration = 0
      @_escape_duration = 0
      @_collapse_duration = 0
    end

# under def update

      if @_appear_duration > 0
        @_appear_duration -= 1
        self.opacity = (16 - @_appear_duration) * 16
      end

Setting your appear duration to anything other than 0, will offset the opacity automatically.

That should do the trick. Let me know if it didn't.
 
I'm still getting the double image, unfortunately x_x
It's only doing this to the enemies, actors work fine, and it dissapears after a while... o.O Works when the enemies fade in, don't know why it doesn't when they start at full opacity x_x
 

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