Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> NPC fadeout, Enemy dies, fade out with red fading...
AphidRuin
post Mar 28 2011, 03:01 AM
Post #1


Level 9
Group Icon

Group: Revolutionary
Posts: 139
Type: Developer
RM Skill: Beginner




In some good RMXP games (Like Blizzard's Lexima Legends IV), when there is a boss monster in the cutscene, when the battle is over, they will have this nice redish fadeout animation before they disappear into thin air. So how are we able to do this? It just look very simple but I can't figure out how can I do this.

Help is very much appreciated as I will be needing this fadeout thing, right now immediately in my project. Thanks. smile.gif


__________________________

Which Final Fantasy Character Are You?
Final Fantasy 7



Current Projects
First game - Shawn's Story]
Second game - TAE (Paused in order to complete Shawn's Story)

[Show/Hide] Cna uyo raed tihs?
Hleeo.Tahnk you for tkanig the tmie to raed tihs.I am bsaing tihs on the frist {oigranl} can you raed tihs?Yaeh olny smoe poelpe can sikm sneentces lkie tehse woituht hvanig to sotp.You rllaey olny hvae to konw the frist and end lttres of the wrod you are tyrnig to raed for yuor mnid to pcik tehm up esaily.Olny 55% of poelpe can raed tihs.I tihnk taht snice you konw waht you are raendig aoubt you can gesus the wrods.If you can raed tihs, palce it in yuor sgitanrue.Dnoe by Senapho.Oops.Sanehpo.


"Creative people don't say themselves as creative because they are creative." -Cheong Cheng Wen a.k.a AphidRuin
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies
AphidRuin
post Apr 1 2011, 06:20 AM
Post #2


Level 9
Group Icon

Group: Revolutionary
Posts: 139
Type: Developer
RM Skill: Beginner




QUOTE (brewmeister @ Mar 30 2011, 02:01 AM) *
I assume you mean a fade-out on the map like the fade-out in battle??

There is no graceful way to do it with event commands alone.
There is a built-in 'collapse' command on the RPG::Sprite class, but it's pretty quick.

Best I can think of is to extend the Game_Character & Sprite_Character classes, and implement our own 'collapse' method.

Paste this script in a new script above Main, event instructions included...

CODE
#======================================================================
========
# ** Collapse Enemy Sprite
#------------------------------------------------------------------------------
# Modify the Game_Character & Sprite_Character classes to enable
# "collapse" effect on a map sprite
# to call from an enemy event:
# @> Script: $game_map.events[@event_id].collapse = true
# @> Wait:127 frame(s)
# @> Control Self Switch: A = ON
#==============================================================================
class Game_Character
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :collapse

alias collapse_init initialize

def initialize
collapse_init
@collapse = false
end
end

class Sprite_Character
alias collapse_init initialize
alias collapse_update update
def initialize(viewport, character = nil)
@collapse_duration = 0
collapse_init(viewport, character)
end
def update
collapse_update
if @character.collapse
collapse
@character.collapse = false
end
if @collapse_duration > 0
@collapse_duration -= 1
self.opacity = @collapse_duration * 2
if @collapse_duration == 0
@character.transparent = true
end
end
end
def collapse
self.blend_type = 1
self.color.set(255, 0, 0, 127)
@collapse_duration = 127
end

end


Wow thanks for all your kind replies. Anyway, I am now trying out the script. I will post the results later. Thanks! smile.gif


__________________________

Which Final Fantasy Character Are You?
Final Fantasy 7



Current Projects
First game - Shawn's Story]
Second game - TAE (Paused in order to complete Shawn's Story)

[Show/Hide] Cna uyo raed tihs?
Hleeo.Tahnk you for tkanig the tmie to raed tihs.I am bsaing tihs on the frist {oigranl} can you raed tihs?Yaeh olny smoe poelpe can sikm sneentces lkie tehse woituht hvanig to sotp.You rllaey olny hvae to konw the frist and end lttres of the wrod you are tyrnig to raed for yuor mnid to pcik tehm up esaily.Olny 55% of poelpe can raed tihs.I tihnk taht snice you konw waht you are raendig aoubt you can gesus the wrods.If you can raed tihs, palce it in yuor sgitanrue.Dnoe by Senapho.Oops.Sanehpo.


"Creative people don't say themselves as creative because they are creative." -Cheong Cheng Wen a.k.a AphidRuin
Go to the top of the page
 
+Quote Post
   



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 19th June 2013 - 08:12 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker