Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> 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
   
Redd
post Mar 28 2011, 04:41 AM
Post #2


:<
Group Icon

Group: Revolutionary
Posts: 2,310
Type: Developer
RM Skill: Advanced




What game maker are you needing help with?


__________________________
Go to the top of the page
 
+Quote Post
   
AphidRuin
post Mar 29 2011, 01:56 AM
Post #3


Level 9
Group Icon

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




Sorry. Forgot to mention the engine I am using. I am using RPG Maker XP.


__________________________

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
   
brewmeister
post Mar 29 2011, 10:01 AM
Post #4


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




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


This post has been edited by brewmeister: Mar 29 2011, 10:02 AM


__________________________
Go to the top of the page
 
+Quote Post
   
Lurvid
post Mar 29 2011, 04:32 PM
Post #5


Level 8
Group Icon

Group: Revolutionary
Posts: 113
Type: Developer
RM Skill: Intermediate




Uh, wouldn't it be easier just to make a spriteset of the enemy fading out and have the event switch to that spriteset? It would also give you control of what the color of their fadeout would be.


__________________________

Everybody look at my signature this meaningless website says I'm smart look at the size of my e-peen
Go to the top of the page
 
+Quote Post
   
stripe103
post Mar 30 2011, 12:47 AM
Post #6


PHP ERROR: Couldn't get value from UInteger. Value too large
Group Icon

Group: Revolutionary
Posts: 737
Type: Mapper
RM Skill: Intermediate




The script brewmeister posted can do that as well, it just to change the colors to variables instead and they can be changed throughout the game as well. You can use the normal RMXP variables, or you can use ruby variables ( such as $red = 15 or $color = ([160, 0, 255]) )


__________________________

By Axerax

The rest of my sig



Go to the top of the page
 
+Quote Post
   
brewmeister
post Mar 30 2011, 05:42 AM
Post #7


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




Lurvid, sometimes we can't see the forest for the trees. Good suggestion.

If it's a limited application, You could make the whole effect into an animation, Play the animation & change the event to transparent.
(If you need more frames)


__________________________
Go to the top of the page
 
+Quote Post
   
AphidRuin
post Apr 1 2011, 06:20 AM
Post #8


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: 20th May 2013 - 05:05 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker