How do I make a PNG image (or animation) show up when a character dies?
#1
Hi! I was hoping I could implement an effect where a PNG image pops in or fades in when a character dies, then fades out two seconds later, like this:

   
(base screenshot taken from DerVVulfman's Lani's Locks)

It need not be an animation sheet, just a PNG is more than enough (see attached for examples) but really, whichever is easier to implement would be great.  Laughing

I hope someone can help me out!


Attached Files Thumbnail(s)
       
[Image: SP1-Writer.png]
[Image: SP1-PixelArtist.png]
Reply
#2
Currently, I am without my main system ... ergo without RPGMaker. But I am wondering if this can merely be done within the TROOPS database.

The 'collapse' effect which changes the default battler red and fades the battler away is done because it it is a sprite object. That being an object that is given and holds a picture image (imagine a picture frame), and it is the frame that is controlled by such effects. And when one uses the [SHOW PICTURE] event, they are actually creating a sprite to hold a picture.
Code:
@>Control Variiable[0011:AHeroHealth]== [Aluxes:HP]
@>Control Variiable[0012:BHeroHealth]== [Basil:HP]
@>Control Variiable[0013:GHeroHealth]== [Gloria:HP]
@>Control Variiable[0014:HHeroHealth]== [Hilda:HP]
@>Conditional Branch [Variable - 0011:AHeroHealth]<- 0
  @>Conditional Branch [Switch - 0021:AluxesDead] == OFF
    @>SHOW PICTURE[006, "AluxesOuch",220,360, 255]
    @>MOVE PICTURE[006, 0, 40frame(s)
    @>Control Switch[0021:AluxesOuch] == ON
  @>end
@>end
@>Conditional Branch [Variable - 0012:BHeroHealth]<- 0
  @>Conditional Branch [Switch - 0022:BasilDead] == OFF
    @>SHOW PICTURE[007, "BaslOOF",340,360, 255]
  ===etc===

I am kinda spitballing, so this is not tested. I am thinking that this could be pasted within your individual TROOPS database pages that are set to run all the time to detect HP changes, both for heroes and enemies.

If the player formation doesn't change in-game, this would work. And it would work for the enemies as well, this assuming it is used in the desired individual TROOP pages. If for the actors, this would be used in every page. And this could be adapted for the enemies.

Again, spitballing as I am not at a PC with RPGMaker.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply
#3
(Yesterday, 01:42 PM)DerVVulfman Wrote: Currently, I am without my main system ... ergo without RPGMaker. But I am wondering if this can merely be done within the TROOPS database.

The 'collapse' effect which changes the default battler red and fades the battler away is done because it it is a sprite object.  That being an object that is given and holds a picture image (imagine a picture frame), and it is the frame that is controlled by such effects.  And when one uses the [SHOW PICTURE] event, they are actually creating a sprite to hold a picture.
Code:
@>Control Variiable[0011:AHeroHealth]== [Aluxes:HP]
@>Control Variiable[0012:BHeroHealth]== [Basil:HP]
@>Control Variiable[0013:GHeroHealth]== [Gloria:HP]
@>Control Variiable[0014:HHeroHealth]== [Hilda:HP]
@>Conditional Branch [Variable - 0011:AHeroHealth]<- 0
  @>Conditional Branch [Switch - 0021:AluxesDead] == OFF
    @>SHOW PICTURE[006, "AluxesOuch",220,360, 255]
    @>MOVE PICTURE[006, 0, 40frame(s)
    @>Control Switch[0021:AluxesOuch] == ON
  @>end
@>end
@>Conditional Branch [Variable - 0012:BHeroHealth]<- 0
  @>Conditional Branch [Switch - 0022:BasilDead] == OFF
    @>SHOW PICTURE[007, "BaslOOF",340,360, 255]
  ===etc===

I am kinda spitballing, so this is not tested.  I am thinking that this could be pasted within your individual TROOPS database pages that are set to run all the time to detect HP changes, both for heroes and enemies.

If the player formation doesn't change in-game, this would work.  And it would work for the enemies as well, this assuming it is used in the desired individual TROOP pages.  If for the actors, this would be used in every page.    And this could be adapted for the enemies.

Again, spitballing as I am not at a PC with RPGMaker.

Hi, DerVVulfman! Would this mean I'd have to set it up for every troop entry in the database? I was hoping it would be more of mechanic, as I currently have over 200 entries in the Troop database tab and 32 characters in the game (though I only plan on putting a death message for three or four of them).  Confused
[Image: SP1-Writer.png]
[Image: SP1-PixelArtist.png]
Reply
#4
Yer definitely looking for code. Methinks you'll want something like a secondary collapse-like option in the RPG::Sprite class. That will need be coded.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply
#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


Possibly Related Threads…
Thread Author Replies Views Last Post
   Image transitions FriKitty 2 2,491 11-24-2024, 05:00 AM
Last Post: DerVVulfman
   Animation Action justpassingby 16 23,202 11-06-2017, 01:59 AM
Last Post: justpassingby
   Scan skill should show states Tumen 5 11,628 05-02-2017, 03:33 AM
Last Post: DerVVulfman
   Custom Message by Hodgeelmf, need to make it above picture LunarBerry 6 14,362 05-09-2016, 01:15 AM
Last Post: LunarBerry
   Atoa Custom Battle System CTB animation while cast Noctis 6 14,389 01-04-2016, 03:05 PM
Last Post: Noctis
   show variables on screen rpg maker xp ThePrinceofMars 22 42,164 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,298 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,984 04-21-2011, 05:22 AM
Last Post: firestalker5



Users browsing this thread: 2 Guest(s)