Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Leon

Auto-Fade Script

Recommended Posts

Okay, I am not too keen on the User Submitted Scripts area, but this is posted there as well. At any rate, here is an Auto-Fade script. Should help make the transferring of the player somewhat easier. I know not everyone uses a 'fade' mechanic, so I didn't want to just edit the original 'Transfer Player' button.

 

 

Now, the instructions are in the header of the script. Further, I included a demo as well. If I could, I'd include a screenshot, but that would do little justice, if any at all.

Without further ado, here be the script:

 

 

 

#===============================================================================
#  Auto-fade transfer script
#    by Leon_Westbrooke
#    v. 1.01
#-------------------------------------------------------------------------------
#
#  Instructions:
#    Place above main, but below all other scripts
#    Use the following commands in the 'Script' option in an event: 
#      t = Tone.new(red, green, blue, gray)
#      Move.xfer(map_id, new_x, new_y, facing, t)
#      
#      red = Red tone
#      green = Green Tone
#      blue = Blue tone
#      gray = Gray tone
#      map_id = map id
#      new_x = destination x
#      new_y = destination y
#      facing = direction to face after moving
#        2 = down
#        4 = left
#        6 = right
#        8 = up
#
#    So, a command should look like this:
#      t = Tone.new(-100, -100, -255, 0)
#      Move.xfer(1, 7, 10, 6, t)
#      
#===============================================================================

module Move
 def self.xfer(map_id, new_x, new_y, facing, tone, fade = 25)
   if $game_temp.player_transferring or
      $game_temp.message_window_showing or
      $game_temp.transition_processing
     # End
     return
   end
   $game_screen.start_tone_change(Tone.new(-255, -255, -255, 0), fade)
   $game_temp.player_transferring = true
   wait = fade * 2
   loop do
     $game_screen.update
     wait -= 2
     if wait == 0
       break
     end
   end

   $game_temp.player_new_map_id = map_id
   $game_temp.player_new_x = new_x
   $game_temp.player_new_y = new_y
   $game_temp.player_new_direction = facing

   Graphics.freeze
   # Set transition processing flag
   $game_temp.transition_processing = true
   $game_temp.transition_name = ""

   $game_screen.start_tone_change(tone, fade)
 end
end

 

 

Share this post


Link to post
Share on other sites

He can't help you unless you show him the error, hun.

 

Leon, I'm going crazy right now 'cause I can't test this out. xD

I guess I just have to wait till I get back.

Share this post


Link to post
Share on other sites

Nope. I wouldn't even know how to do that :>

 

I'm testing out the beginning of my game by having a small scene of a forest and then it transfers to another scene for a movie and then the player gets to move. But when I start the game up with the script, that error pops up and then shuts my game down lol

Share this post


Link to post
Share on other sites

What is a Syntax...? >.>

 

Alright, I'll try it out!

 

EDIT:

Now its all black. Maybe I'm doing something wrong....?

Edited by CrimsonInferno

Share this post


Link to post
Share on other sites

let me see your event code? what you are using, the entire window. (yes, redundant)

 

I forgot! I should mention in the instructions, when it says this:

# So, a command should look like this:

# t = Tone.new(-100, -100, -255, 0)

# Move.xfer(1, 7, 10, 6, t)

 

 

the t = Tone.new(x, y, z, a)

 

 

That is the Tone of the screen where you are transferring TO. It automatically fades to black.

I should have specified that, and I am sorry.

Share this post


Link to post
Share on other sites

Ah, I see :P Its cool, others probably already knew, I just don't know anything about scripting. :sweatdrop: I'm gonna learn it soon, when my game at least has a near point of a demo lol

 

How do I set up this in the script command window?

"# Move.xfer(1, 7, 10, 6, t)"

Share this post


Link to post
Share on other sites

For the command window, you use:

 t = Tone.new(r, g, b, a)
 Move.xfer(map_id, new_x, new_y, facing, t)

 

But, you define the: r, g, b, a, map_id, new_x, new_y, facing. The 't' is the tone above it. And, that tone will be the tone of the next map you go to. You need both lines, but you have to define all those variables. Sounds hard, but it is kind of simple. Like in the example:

t = Tone.new(-100, -100, -255, 0)

Move.xfer(1, 7, 10, 6, t)

 

I defined the t to be that particular tone (it will have no blue, just be a darker yellow), then the next map they move to would be the map with the id of 1, they'd be at x location 7, y location 10, and facing right. It sounds complex, I know... but when you get it down, it is quite easy.

Share this post


Link to post
Share on other sites

Oh I see. But to find the rest of the map numbers, you'd have to appoint with variables, right? To find the "X" location and the "Y" location....?

Share this post


Link to post
Share on other sites

I believe so, if i understand you correctly. You just have to put in the variables, and it will transfer.

 

I hate to get off topic, but have you an IM? If so, you can pm it to me, cuz this would be a lot easier to explain that way.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...