How do I prevent the screen from fading in too early?

From OHRRPGCE-Wiki
Jump to: navigation, search

You may have noticed that sometimes, when you use the command "fade screen out" the command ends sooner that you would like (for the reasons explained above). There may be several reasons for this. The two most frequent are "using door" and "using teleport to map" To explain it to how to prevent it to do so, I decided to write this article.

Before we start[edit]

But first we have to check that we're in the situation in which it is not a bug 550 and of the "wantimediate" issue in bug 430. It is rather easy : check in that your script that you use the command "teleport to map" or the "use door" If so then everything is fine. It is normal that the fade command ends too early. Just remember the definition of the fade screen out command

  The screen will remain faded out until you run fade screen in, fight a battle, or use a door. 

We're in this situation here. Why does the fade command stops automatically? Well it is because the map is loaded again!

If you're not in this situation and if the screen goes back to normal then you may have bug 550 (or 430). I strongly recommend you to ask questions on the forum and check bugzilla to understand how the bug happen. Hopefully this bug have been already identified and unless you're using a very old version of Custom.exe and game.exe you are very unlikely to get this kind of problems!


Now that all what should be checked have been checked, you can read what follows and see how to make sure the fade out effect keeps as long as you teleport and as long as you need it!

Prevent early fading out[edit]

To prevent the "fade screen out" effect to stop sooner that you need, we'll use a screenshot that has EXACTLY the same color that is to say the same proportion of Red Green and Blue that the playscreen after the "fade screen out"

Now it's time to start!

1rst way: use the fade screen out command to make appear the color on the screen[edit]

With this solution, the first thing to do is to find the color you need. I know that white and black are the ones that are used in most cases, therefor, I added them at the end of the article. How nice of me huh?

But first let's make some revision. The command fade screen out transforms the screen. It fades "the screen to a slid (and unic) color. You enter the color following the rgb model. fade screen out (red,green,blue) The only exception is for black.(When you use the command without adding something between parenthesis, black is assumed)

In our example we'll use Light Yellow R=255 G=255 B=153. Why light yellow? Well because it's the color that is more likely to fit your need after black and white.


Open your hss file and include the following code in a test script

define script, test script, none

#-----------------------------
script, test script, begin

suspend player

fade screen out (255, 255, 153)
wait (32)
fade screen in

resume player
end #end of the plotscript here
#----------------------------------


Compile your hss file. Now you can go under custom and give this script to an npc. Import your scripts and save your rpg file.

Now launch your game. Go and speak to the npc. You'll see the screen fading while 32 ticks. When the screen fades press F12, it will take a screenshot. Leave the game. Import the screenshot you've just made and that has the color you need. Let's say that it's backdrop nb9.

Now you can adapt your script

#-----------------------------
script, cutesceen3, begin

suspend player

fade screen out (255, 255, 153)
show backdrop (9)
# all your stuff goes here




fade screen in
show map

resume player
end #end of the plotscript here
#----------------------------------

Eh voilà! You are ready to test the whole thing. Enjoy!

2nd way: use a screenshot with the color you like and then get the RGB code[edit]

This method is slighly different from the on above. Here, we assume that you don't know the RGB code (but would like to)

First step: take your screenshot. Launch the game/ the video/ go on the website in which you saw the nice color you would like to use. Then press "print screen". Second step save the screenshot. Launch paint.exe and past you screenshot in the new image. Now save it. I strongly advise you to save it under jpg, gif or png because these are the most current file format for images.( And paint recognise them) Feel free to resize you screen .It will prevent the jpg/ gif or png file from becaming too big and it'll also easier to find the color.

Now you can click on the picture where there is the color you would like to use for your flash. Then, click with left button to take a sample of the color. Go in the color menu and click on "define your own color" You'll see the size of the menu changing and new infos appears. What interest you here is the part in which the RGB code is given! Here is where you should go

Extract of Paint Sub Menu


Let's say that you have found a nice blue (R 134, G 166, B 213)

Now you know what to put between the parenthesis on the command "fade screen out"

The only thing that left is the screenshot. To make it add the color to Paint's palette. Then, open a new file and create a new picture. The size of the image should be 320*200. Go on the color menu and pick up the one you've just add. Fill the picture with the color using Paint's well-know option and save the whole thing under the bmp format. Your screenshot in ready to be imported and became backdrop (9).

Open your hss file and include the following code

#-----------------------------
script, cutesceen3, begin

suspend player

fade screen out (134, 166, 213)
show backdrop (9)
# all your stuff goes here



fade screen in
show map

resume player
end #end of the plotscript here
#-----------------------------

Now you can test the whole thing and you'll see that it'll work perfectly! ^_^

To conclude[edit]

With this system you can have until thirty line of code and do as many things as your want but the player won't notice anything because the screen will stay as long as you need it!

Now here are two basic screen one black and one white that may be helpful as backdrops. (Please note that those 2 are under the bmp format so that you can import them directly )

Here is the black one Basic black backdrop

And here is a white one

Basic white backdrop

Feel free to do as many tests as you need to get the color you need (and the fade screen that goes with it) Those 2 backdrops may be included in the next version of the OHRRPGCE and then may be deleted!

See Also[edit]