iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!

> Note for Tutorial Threads

New threads (tutorials) here will go into a moderation queue. You will not see your thread appear when you create it. A moderator will decide if it will be approved or denied.

4 Pages V   1 2 3 > »   
Reply to this topicStart new topic
> [-Eventing-] Create an underwater effect, A nominee for Best Tutorial 2010.
Rating 4 V
CrayDragon
post Oct 19 2010, 02:23 AM
Post #1


RMVX > Social life
Group Icon


Type: Designer
Alignment: Neutral Evil




It's time to make....
An underwater map effect!

Any tiles welcome!

With this here tutorial, you'll get a product similar to this:


Step 1: Create a map.
Spoiler:

I'm sorry, this isn't a mapping tutorial D: So the only thing I can say here is DON'T ADD ANYTHING TO YOUR MAP THAT WOULDN'T MAKE SENSE UNDERWATER.
I.e. fire, lava, full-grown trees, etc.


Step 2: Variable Bits and Bobs.
Spoiler:

If you already have variables labeled these from flashlight effects, etc. you can disregard all of the following step.
So, go to your variables editor, and select two variables you believe you will remember.
I chose my last two.
Label them:
Player's Screen X
Player's Screen Y

(Or anything you can remember that will suggest that. For future notice.)


Step 3: Pictures and Tints
Spoiler:

Let me show you these images:
Spoiler:



These will be necessary for the full effect.

Event commands will be necessary for it too.
So yeah, import those to Graphics/Pictures in your game.
Then.
You are going to have to grab woratana's Multiple Fogs for the next bit.
Fortunately, I have it right here biggrin.gif
(Credit to woratana)
CODE
#===============================================================
# ● [VX] ◦ Multiple Fogs ◦ □
# * Use unlimited layers of fog *
#--------------------------------------------------------------
# ◦ by Woratana [woratana@hotmail.com]
# ◦ Thaiware RPG Maker Community
# ◦ Released on: 13/05/2008
# ◦ Version: 1.0
#--------------------------------------------------------------

#==================================================================
# ** HOW TO USE **
# * use event command 'Script...' for the any script line below~
#-----------------------------------------------------------------
#
#---------------------------------------------------------------
# ** SETUP FOG PROPERTIES & SHOW FOG **
# * You have to setup fog properties, before show fog~
#-------------------------------------------------------------
# * There are 3 ways to setup fog properties:
# >> Setup Fog [Custom]:
# $fog.name = 'image_name' # Image file name, must be in fog image path (setup path below).
# $fog.hue = (integer) # Fog's hue. 0 - 360, 0 for no hue.
# $fog.tone = [red, green, blue, gray] # Fog's tone color.
# $fog.opacity = (integer) # Fog's opacity. 0 - 255, you will not see fog in 0.
# $fog.blend = (0, 1, or 2) # Fog's blend type. 0 for Normal, 1 for Add, 2 for Subtract.
# $fog.zoom = (integer) # Fog's size (in %). 100 for normal size.
# $fog.sx = (+ or - integer) # Fog's horizontal move speed.
# $fog.sy = (+ or - integer) # Fog's vertical move speed.
#
# >> Setup Fog [From Preset]:
# (You can setup fog presets, in part FOG PRESET SETUP below)
# $fog.load_preset(preset_id)
#
# >> Setup Fog [From Fog that showing]:
# $fog.load_fog(fog_id)
#
#--------------------------------------------------------------
# ** SHOW FOG **
#-------------------------------------------------------------
# After setup the fog, show fog by call script:
# $fog.show(fog_id)
#
# In case you want to show new fog on same ox, oy, tone as old fog. Call Script:
# $fog.show(old_fog_id, false)
#
# * fog_id: the ID number you want to put this fog in.
# (It can be any positive number or zero)
#
# After you show fog, the fog properties you've set will replace with default setting.
# (You can setup default setting, in part FOG DEFAULT SETTING below)
#
#--------------------------------------------------------------
# ** DELETE FOG **
#-------------------------------------------------------------
# You can delete 1 or more fog(s) at a time by call script:
# $fog.delete(fog_id, fog_id, fog_id, ...)
#
#---------------------------------------------------------------
# ** OLD FOG CONTROL EVENT COMMANDS **
#-------------------------------------------------------------
# Change Fog Tone:
# $game_map.fogtone(fog_id, [red, green, blue, gray], duration)
# e.g. $game_map.fogtone(1, [100,200,-100,0], 10)

# Change Fog Opacity:
# $game_map.fogopac(fog_id, new_opacity, duration)
# e.g. $game_map.fogopac(2, 200, 10)
#
#---------------------------------------------------------------
# ** ADDITIONAL SETTINGS **
#-------------------------------------------------------------
# Change Fog Image's Path:
# $game_map.fog_path = 'image_path'
# e.g. $game_map.fog_path = 'Graphics/Pictures/'

# Turn ON/OFF [Automatically clear all fogs when transfer player]:
# $game_map.fog_reset = (true / false)
#
#===============================================================

#==================================================================
# START ** MULTIPLE FOG SETUP **
#==================================================================
class Game_Map
alias wora_mulfog_gammap_ini initialize
def initialize
wora_mulfog_gammap_ini

#==================================================================
# ** MULTIPLE FOG SETUP ** SETTINGS
#--------------------------------------------------------------
@fog_path = 'Graphics/Pictures/'
# Fog image's path
@fog_reset = true # (true or false)
# Automatically clear all multiple fogs when transfer player
#==================================================================

@mulfog_name = []
@mulfog_hue = []
@mulfog_opacity = []
@mulfog_blend_type = []
@mulfog_zoom = []
@mulfog_sx = []
@mulfog_sy = []
@mulfog_ox = []
@mulfog_oy = []
@mulfog_tone = []
@mulfog_tone_target = []
@mulfog_tone_duration = []
@mulfog_opacity_duration = []
@mulfog_opacity_target = []
end
end
class Wora_Multiple_Fog
def set_default
#==================================================================
# ** MULTIPLE FOG SETUP ** FOG DEFAULT SETTING
#--------------------------------------------------------------
@name = ''
@hue = 0
@opacity = 64
@blend = 0
@zoom = 200
@sx = 0
@sy = 0
@tone = [0,0,0,0]
#==================================================================
end

def load_preset(preset_id)
case preset_id
#==================================================================
# ** MULTIPLE FOG SETUP ** FOG PRESET SETUP
#--------------------------------------------------------------
when 1 # Preset ID 1
@name = '001-Fog01'
@hue = 0
@tone = [100,-255,20,0]
@opacity = 60
@blend = 0
@zoom = 200
@sx = 10
@sy = 0
when 2 # Preset ID 2
@name = '002-Clouds01'
@hue = 0
@tone = [0,0,0,0]
@opacity = 200
@blend = 1
@zoom = 200
@sx = -2
@sy = -2
#==================================================================
end
end
#==================================================================
# END ** MULTIPLE FOG SETUP **
# * Don't change anything below unless you know what you're doing.
#==================================================================

attr_accessor :name, :hue, :opacity, :blend, :zoom, :sx, :sy, :tone
def initialize
set_default
end

def load_fog(id)
@name = $game_map.mulfog_name[id].sub($game_map.fog_path, '')
@hue = $game_map.mulfog_hue[id]
@opacity = $game_map.mulfog_opacity[id]
@blend = $game_map.mulfog_blend_type[id]
@zoom = $game_map.mulfog_zoom[id]
@sx = $game_map.mulfog_sx[id]
@sy = $game_map.mulfog_sy[id]
tn = $game_map.mulfog_tone[id]
@tone = [tn.red, tn.blue, tn.green, tn.gray]
end

def show(id, reset_all = true)
$game_map.mulfog_name[id] = $game_map.fog_path + @name
$game_map.mulfog_hue[id] = @hue
$game_map.mulfog_opacity[id] = @opacity
$game_map.mulfog_blend_type[id] = @blend
$game_map.mulfog_zoom[id] = @zoom
$game_map.mulfog_sx[id] = @sx
$game_map.mulfog_sy[id] = @sy
$game_map.mulfog_tone[id] = Tone.new(@tone[0], @tone[1], @tone[2], @tone[3])
if $game_map.mulfog_ox[id].nil? or reset_all
$game_map.mulfog_ox[id] = 0
$game_map.mulfog_oy[id] = 0
$game_map.mulfog_tone_target[id] = Tone.new(0, 0, 0, 0)
$game_map.mulfog_tone_duration[id] = 0
$game_map.mulfog_opacity_duration[id] = 0
$game_map.mulfog_opacity_target[id] = 0
end
set_default
end

def delete(*args)
args.each do |id|
$game_map.mulfog_name[id] = ''
end
end
end

class Game_Interpreter
alias wora_mulfog_interpret_com201 command_201
#--------------------------------------------------------------------------
# * Transfer Player
#--------------------------------------------------------------------------
def command_201
if $game_map.fog_reset
if @params[0] == 0; id_map = @params[1]
else; id_map = $game_variables[@params[1]]
end
$game_map.clear_mulfog if id_map != @map_id
end
wora_mulfog_interpret_com201
end
end

class Game_Map
attr_accessor :mulfog_name, :mulfog_hue, :mulfog_opacity, :mulfog_blend_type,
:mulfog_zoom, :mulfog_sx, :mulfog_sy, :mulfog_ox, :mulfog_oy, :mulfog_tone,
:mulfog_tone_target, :mulfog_tone_duration, :mulfog_opacity_duration,
:mulfog_opacity_target, :fog_reset, :fog_path

alias wora_mulfog_gammap_upd update
def update
wora_mulfog_gammap_upd
@mulfog_name.each_index do |i|
next if @mulfog_name[i].nil? or @mulfog_name[i] == ''
# Manage fog scrolling
@mulfog_ox[i] -= @mulfog_sx[i] / 8.0
@mulfog_oy[i] -= @mulfog_sy[i] / 8.0
# Manage change in fog color tone
if @mulfog_tone_duration[i] >= 1
d = @mulfog_tone_duration[i]
target = @mulfog_tone_target[i]
@mulfog_tone[i].red = (@mulfog_tone[i].red * (d - 1) + target.red) / d
@mulfog_tone[i].green = (@mulfog_tone[i].green * (d - 1) + target.green) / d
@mulfog_tone[i].blue = (@mulfog_tone[i].blue * (d - 1) + target.blue) / d
@mulfog_tone[i].gray = (@mulfog_tone[i].gray * (d - 1) + target.gray) / d
@mulfog_tone_duration[i] -= 1
end
# Manage change in fog opacity level
if @mulfog_opacity_duration[i] >= 1
d = @mulfog_opacity_duration[i]
@mulfog_opacity[i] = (@mulfog_opacity[i] * (d - 1) + @mulfog_opacity_target[i]) / d
@mulfog_opacity_duration[i] -= 1
end
end
end
#--------------------------------------------------------------------------
# * Start Changing Fog Color Tone
#--------------------------------------------------------------------------
def fogtone(i, tone, duration)
duration = duration * 2
tone = Tone.new(tone[0], tone[1], tone[2], tone[3])
@mulfog_tone_target[i] = tone.clone
@mulfog_tone_duration[i] = duration
if @mulfog_tone_duration[i] == 0
@mulfog_tone[i] = @mulfog_tone_target[i].clone
end
end
#--------------------------------------------------------------------------
# * Start Changing Fog Opacity Level
#--------------------------------------------------------------------------
def fogopac(i, opacity, duration)
duration = duration * 2
@mulfog_opacity_target[i] = opacity * 1.0
@mulfog_opacity_duration[i] = duration
if @mulfog_opacity_duration[i] == 0
@mulfog_opacity[i] = @mulfog_opacity_target[i]
end
end

def clear_mulfog
@mulfog_name.each_index {|i| @mulfog_name[i] = '' }
end
end
$worale = {} if !$worale
$worale['MutipleFog'] = true
$fog = Wora_Multiple_Fog.new
class Spriteset_Map
alias wora_mulfog_sprmap_crepal create_parallax
alias wora_mulfog_sprmap_updpal update_parallax
alias wora_mulfog_sprmap_dispal dispose_parallax

def create_parallax
@mulfog = []
@mulfog_name = []
@mulfog_hue = []
wora_mulfog_sprmap_crepal
end

def update_parallax
wora_mulfog_sprmap_updpal
$game_map.mulfog_name.each_index do |i|
next if $game_map.mulfog_name[i].nil?
# If fog is different than current fog
if @mulfog_name[i] != $game_map.mulfog_name[i] or @mulfog_hue[i] != $game_map.mulfog_hue[i]
@mulfog_name[i] = $game_map.mulfog_name[i]
@mulfog_hue[i] = $game_map.mulfog_hue[i]
if @mulfog[i].nil?
@mulfog[i] = Plane.new(@viewport1)
@mulfog[i].z = 3000
end
if @mulfog[i].bitmap != nil
@mulfog[i].bitmap.dispose
@mulfog[i].bitmap = nil
end
if @mulfog_name[i] != ''
@mulfog[i].bitmap = Cache.load_bitmap('', @mulfog_name[i], @mulfog_hue[i])
end
Graphics.frame_reset
end
next if @mulfog[i].bitmap.nil?
# Update fog plane
@mulfog[i].zoom_x = ($game_map.mulfog_zoom[i] / 100.0) if @mulfog[i].zoom_x != ($game_map.mulfog_zoom[i] / 100.0)
@mulfog[i].zoom_y = ($game_map.mulfog_zoom[i] / 100.0) if @mulfog[i].zoom_y != ($game_map.mulfog_zoom[i] / 100.0)
@mulfog[i].opacity = $game_map.mulfog_opacity[i] if @mulfog[i].opacity != $game_map.mulfog_opacity[i]
@mulfog[i].blend_type = $game_map.mulfog_blend_type[i] if @mulfog[i].blend_type != $game_map.mulfog_blend_type[i]
@mulfog[i].ox = ($game_map.display_x / 8.0 + $game_map.mulfog_ox[i]) if @mulfog[i].ox != ($game_map.display_x / 8.0 + $game_map.mulfog_ox[i])
@mulfog[i].oy = ($game_map.display_y / 8.0 + $game_map.mulfog_oy[i]) if @mulfog[i].oy != ($game_map.display_y / 8.0 + $game_map.mulfog_oy[i])
@mulfog[i].tone = $game_map.mulfog_tone[i] if @mulfog[i].tone != $game_map.mulfog_tone[i]
end
end

def dispose_parallax
@mulfog.each_index do |i|
next if @mulfog[i].nil?
@mulfog[i].bitmap.dispose if !@mulfog[i].bitmap.nil?
@mulfog[i].dispose
end
wora_mulfog_sprmap_dispal
end
end
#==================================================================
# [END] VX Multiple Fog by Woratana [woratana@hotmail.com]
#==================================================================

Once that's imported, along with my and Pentagonbuddy's picture graphics, make a Parallel Process event.
Event the following in a Script Call (commands page 3 bottom-left):
Spoiler:
CODE
$fog.name = 'wareflec'
$fog.hue = 0
$fog.tone = [0,0,0,0]
$fog.opacity = 70
$fog.blend = 0
$fog.zoom = 225
$fog.sx = 10
$fog.sy = 0

$fog.show(1)

And below it:

CODE
$fog.name = 'wareflec'
$fog.hue = 0
$fog.tone = [0,0,0,0]
$fog.opacity = 35
$fog.blend = 0
$fog.zoom = 225
$fog.sx = -5
$fog.sy = 0

$fog.show(2)
So now you can kiss the scripting part goodbye.
Here's a good tint you can use for our little effect:
CODE
R: -102
G: -17
B: 85
G: 0
You can meddle around with that, but I wouldn't suggest it. It's either too green or too red X( A pain for the eyes.
Put the tint after the Script Call bit.

Now do a Show Picture command (commands page 2) that should look like this in the event menu:
Show Picture: 2, 'beam1_ani1', Upper Left, (0,0), (100%,100%), 100, Add

Are you wondering why the picture ID is 2? Well.
Make another Parallel Process event right next to this one (position doesn't matter, but it must be made.)
Event the following:
Control Variables: [Variable you picked for player's X] = Player's Screen X
Control Variables: [Variable you picked for player's Y] = Player's Screen Y

Show Picture: 1, 'waterfog', Center (Variable [PlayerX][PlayerY]), (205%,205%), 245, Normal
This bit is to make the blue mist follow the player around. It'll be centered on the player.
The size is big because otherwise it looks damned weird ,:/


Step 4: Move Pictures
Spoiler:

Create a Loop (Ev commands page 1).
Within the Loop, you can place a command for Move Picture:
Loop
Move Picture: 2, Upper Left, (0,0), However transparent you want it to fade to, Add, amount of frames you want this to take.
For opacity, I used 175, and it took 80 frames.
Wait how many frames the first transition took, like 80 frames.
Move Picture: 2, Upper Left, (0,0), Transparency in it's final instance, Add, your used amount of wait frames.
Wait once again, your used amount of frames.
Repeat Above


Whew...oh my damn. I need some sleep.
Well, you know the drill now, post up a screenshot of your result, and any bugs you encountered with this.
First thing to do with a bug is MAKE SURE YOU READ IT CAREFULLY.

Credit to Pentagonbuddy for the light beam graphic, and woratana for the script I made you add
Also, me and photographer Raul Touzon for the water reflection image.


Support? Keh.
CODE
[url="http://www.rpgmakervx.net/index.php?showtopic=37847"][img]http://www.majhost.com/gallery/B-CrayDragon/Sigs/ueebar.png[/img][/url]


Cheese,
~Your local dragon of crayon.


--------------------
I order you to click these.






>>deviantART!<<
Go to the top of the page
 
+Quote Post
   
Terra-chan
post Oct 19 2010, 05:00 AM
Post #2


~Crazy Lazy Workaholic~
Group Icon


Type: Spriter
Alignment: Chaotic Neutral




I request that you remove the unrelated image. >_< It's a real turn-off.


--------------------
Go to the top of the page
 
+Quote Post
   
Inkstand
post Oct 19 2010, 05:35 AM
Post #3


Awww... you guys made me ink! U_U;
Group Icon


Type: Undisclosed
Alignment: Unaligned




Eeeeeeeeeeh. Stopped reading after the dog.


--------------------
Go to the top of the page
 
+Quote Post
   
Identity_Crisis
post Oct 19 2010, 08:32 AM
Post #4


Cooler than Mudkipz
Group Icon


Type: Writer
Alignment: True Neutral




Yeah, get rid of that dog :/
Go to the top of the page
 
+Quote Post
   
CrayDragon
post Oct 19 2010, 05:58 PM
Post #5


RMVX > Social life
Group Icon


Type: Designer
Alignment: Neutral Evil




*sigh* fine. Done. Now can you read what I have to say? laugh.gif
I'm sorry, it's my strange humor acting up at random times...unsure.gif


--------------------
I order you to click these.






>>deviantART!<<
Go to the top of the page
 
+Quote Post
   
Burning Mamoth
post Oct 19 2010, 06:37 PM
Post #6



Group Icon


Type: Designer
Alignment: Chaotic Neutral




Darn, I missed the dog... Now, even though I've never been too fond of the sun effects, but I love the final result for this underwater scene. Good work!

This post has been edited by Burning Mamoth: Oct 19 2010, 06:38 PM


--------------------


Go to the top of the page
 
+Quote Post
   
CrayDragon
post Oct 19 2010, 06:59 PM
Post #7


RMVX > Social life
Group Icon


Type: Designer
Alignment: Neutral Evil




@Mam: Here.
Spoiler:


--------------------
I order you to click these.






>>deviantART!<<
Go to the top of the page
 
+Quote Post
   
Leridan
post Oct 19 2010, 08:08 PM
Post #8



Group Icon


Type: Designer
Alignment: Neutral Good




It looks pretty good, but I think you could sell the illusion better if you added random, animated bubbles around the map.


--------------------


I support:

Go to the top of the page
 
+Quote Post
   
CrayDragon
post Oct 19 2010, 08:31 PM
Post #9


RMVX > Social life
Group Icon


Type: Designer
Alignment: Neutral Evil




Yeah, I have the means, but there are script incompatibilities I can't figure out when I summon them X(


--------------------
I order you to click these.






>>deviantART!<<
Go to the top of the page
 
+Quote Post
   
Joerao
post Oct 19 2010, 08:45 PM
Post #10


...
Group Icon


Type: Musician
Alignment: Neutral Evil




I read the tutorial and I think I liked it. I'm not sure though since when I saw the dog I fainted and awoke several hours later.


--------------------
Go to the top of the page
 
+Quote Post
   
Leridan
post Oct 19 2010, 08:46 PM
Post #11



Group Icon


Type: Designer
Alignment: Neutral Good




QUOTE (CrayDragon @ Oct 19 2010, 05:31 PM) *
Yeah, I have the means, but there are script incompatibilities I can't figure out when I summon them X(

I'd personally just use animated sprites.


--------------------


I support:

Go to the top of the page
 
+Quote Post
   
CrayDragon
post Oct 23 2010, 03:53 PM
Post #12


RMVX > Social life
Group Icon


Type: Designer
Alignment: Neutral Evil




...bump?


--------------------
I order you to click these.






>>deviantART!<<
Go to the top of the page
 
+Quote Post
   
CrayDragon
post Oct 29 2010, 01:21 AM
Post #13


RMVX > Social life
Group Icon


Type: Designer
Alignment: Neutral Evil




Hmm...This really wasn't a hit, huh? unsure.gif


--------------------
I order you to click these.






>>deviantART!<<
Go to the top of the page
 
+Quote Post
   
Pentagonbuddy
post Oct 29 2010, 03:01 AM
Post #14


Obligated To Love <3
Group Icon


Type: Undisclosed
Alignment: Unaligned




For things like tutorials, the amount of comments doesn't really reflect if it was successful or not. Keep track of your views, and that oughta give you an idea of how many people checked it out. <3

That being said, you don't need to bump a tutorial. They're meant for informing, really. And besides that, I've added this to the master list, so users who look at that will be able to find it easily. Feel free to drop a link in your sig if you want more exposure, too~!


--------------------
Go to the top of the page
 
+Quote Post
   
Bo-Jangle
post Dec 5 2010, 12:12 AM
Post #15



Group Icon






One stupid question:
What's a variables editor?
Go to the top of the page
 
+Quote Post
   
CrayDragon
post Dec 5 2010, 01:22 AM
Post #16


RMVX > Social life
Group Icon


Type: Designer
Alignment: Neutral Evil




Event Commands Page 1 > Control Variables > Single "_" (should be at the top)


--------------------
I order you to click these.






>>deviantART!<<
Go to the top of the page
 
+Quote Post
   
MessedUpPro
post Dec 5 2010, 06:26 PM
Post #17


"Make the Lord laugh, Timmy."
Group Icon


Type: Undisclosed
Alignment: Neutral Good




I think on the tint,you meant for Blue to be set to positive 85. -85 makes it too green.


--------------------
Currently Working on
Legend of Argonath 2
I support
Spoiler:







Go to the top of the page
 
+Quote Post
   
CrayDragon
post Dec 5 2010, 07:29 PM
Post #18


RMVX > Social life
Group Icon


Type: Designer
Alignment: Neutral Evil




You're right. Fixed wink.gif


--------------------
I order you to click these.






>>deviantART!<<
Go to the top of the page
 
+Quote Post
   
MagicKid
post Dec 6 2010, 02:50 PM
Post #19


I walk into walls.
Group Icon


Type: Writer
Alignment: Chaotic Evil




It doesn't look underwater.


--------------------
QUOTE (CUTmayne @ Aug 4 2010, 01:20 AM) *
paying for rm resources is like paying for porn.

I'm back! And I'm more mature than the last time you saw me. I hope.
Go to the top of the page
 
+Quote Post
   
Kaptain J
post Dec 6 2010, 05:26 PM
Post #20


Death says "Hi"
Group Icon


Type: Writer
Alignment: Lawful Evil




QUOTE (MagicKid @ Dec 6 2010, 08:50 AM) *
It doesn't look underwater.


It does to me...


--------------------


Come join Team Smash today!


Other stuffz:
Spoiler:






RPGMakerVX.net Awards:
Spoiler:




Check out my tutorial and articles:
How to Write a Story
The Kaptain's Article Dump

Go to the top of the page
 
+Quote Post
   

4 Pages V   1 2 3 > » 
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: 22nd September 2014 - 03:22 PM

RPGMakerVX.net is an Privacy Policy, Legal.