How do I make a PNG image (or animation) show up when a character dies?
#5
You'd have to manually add the collapse method to the Sprite_Battler class to make it appear.

Code:
class Sprite_Battler
  alias :last_words_sprt_btlr_up :update
  def update
    last_words_sprt_btlr_up
    reset_last_words
  end

  def reset_last_words
    return unless @last_words and @_collapse_duration == 0
    @last_words = false
    # your Last Words destruction code here
  end

  def collapse
    @last_words = true
    # your Last Words creation code here
     super
  end
end

You gotta know that RPG::Sprite already has a collapse method, BUT not all of your sprites have to show those last words before disappearing. That's why I recommended to add it to Sprite_Battler and call super like I did there to let it apply RPG::Sprite's collapse method's effects accordingly.

The disposal of that custom sprite of yours was a bit tricky, but you can simply alias Sprite_Battler's update method and add your custom code there. You can take a look at my example to get an idea on how to do it.

NOTES

This piece of code assumes you already know how to create sprites and add bitmaps to them.
@last_words is a flag you desperately need to keep track of your Last Words process at all times.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply


Messages In This Thread
RE: How do I make a PNG image (or animation) show up when a character dies? - by kyonides - 7 hours ago

Possibly Related Threads…
Thread Author Replies Views Last Post
   Image transitions FriKitty 2 2,492 11-24-2024, 05:00 AM
Last Post: DerVVulfman
   Animation Action justpassingby 16 23,209 11-06-2017, 01:59 AM
Last Post: justpassingby
   Scan skill should show states Tumen 5 11,629 05-02-2017, 03:33 AM
Last Post: DerVVulfman
   Custom Message by Hodgeelmf, need to make it above picture LunarBerry 6 14,363 05-09-2016, 01:15 AM
Last Post: LunarBerry
   Atoa Custom Battle System CTB animation while cast Noctis 6 14,390 01-04-2016, 03:05 PM
Last Post: Noctis
   show variables on screen rpg maker xp ThePrinceofMars 22 42,169 10-19-2014, 08:01 PM
Last Post: ThePrinceofMars
  Make LockeZ's Sacrifice script Blizzard Compatible Steel Beast 6Beets 0 4,101 05-29-2014, 02:13 AM
Last Post: Steel Beast 6Beets
   Help editing Animation Resizer MechanicalPen 3 7,300 11-22-2012, 08:39 PM
Last Post: MechanicalPen
   Auto-play Character animation Taylor 0 3,902 05-30-2012, 11:56 AM
Last Post: Taylor
   How do you make a call script? firestalker5 0 3,985 04-21-2011, 05:22 AM
Last Post: firestalker5



Users browsing this thread: 3 Guest(s)