Gw Temp

Menu

Tutorial - 'Starfield Effect' by Guest

An item about RPGMaker 2000 posted on

Blurb

Want to have the classic Windows screensaver Starfield in your game? Read this tutorial from Kusanagi to learn how!

Body

So, you want to make a starfield in your game similar to the Windows screensaver? You can use this for a cutscene, a transition between planets, or even the opening screen! I played around with the concept for my game and was able to make it work. Now, I wish to show you how to do it.

Things you need to know:
Show Picture and Move Picture commands.

For this tutorial we are going to use 3 different PNG files containing stars, all at a resolution of 320x240. You can make these images any way you want - just have all 3 slightly different. Also, keep an area in the center of each image free of stars - this will help later, trust me. An area of about 40x40 pixels in the middle without stars is alright, but feel free to use your judgement once you see how this is going to work.

Now in RPGMaker, open up your RAW materials editor and import all 3 images, setting the transparency to whatever background color you used when making the files.

Now make a new map, 20x15. Set the parallex background to a space image, like the planet or sun in the RTP. Clear the entire map so there are no tiles.

Here comes the confusing coding part that took me a while to get right. Create an event named "Starfield", set it to parallel process. We're going to make a starfield animation that looks like we are zooming out or flying away from something really fast. If you want to zoom in or fly forward, I'll show you how to do that in a little bit.

1. In the event editor under the Starfield event, click on the <> and go to the 2nd page, click on Show Picture. Select your first starfield image, and make it picture 1 (assuming you don't have anything you want to overlay the field over, like a planet or something. If you do, just substitute the 1 with the first highest unused number.) Set the magnification to 1000%, and the Transparency to Stir. Click OK. If the star picture was 320x240, you shouldn't have to mess with the coordinates at all.

2. Click on the <> again. This time, we're going to click on Move Picture. Set the pic number as 1 (or whatever pic number you used). Set the magnification to 30, movement time to .6 seconds, and make sure the Wait Until Done box is UNCHECKED.

3. Click on the <> one more time. Enter a Wait command of .2 seconds.

Now repeat steps 1-3 with the other two starfield images, making their picture numbers 2 and 3 respectively.

When you are done, the coding tree should look like this:

<>Show Picture: 1,stars1,(160,120)
<>Move Picture: 1, (160,120),0.6sec
<>Wait: 0.2sec
<>Show Picture: 2,stars2,(160,120)
<>Move Picture: 2, (160,120),0.6sec
<>Wait: 0.2sec
<>Show Picture: 3,stars3,(160,120)
<>Move Picture: 3, (160,120),0.6sec
<>Wait: 0.2sec
<>

Now you're done! This creates a smooth transition between the stars appearing and zooming that is nice to see. Here's why it works.

The event is set to parallel process and will take six tenths of a second to loop. Notice that the Move Picture commands also have a value of six tenths? The Move Picture command MUST take as long to execute as the entire event, or the starfield will look jumpy and irregular. If you want to slow the stars down, make sure that you add the values of the Wait statements together and set the Move Picture events to conver that amount of time. If you know how switches work, you can have the starfield triggered by another event on the map as opposed to simply teleporting in and having it run indefinately.

I told you I'd show you how to reverse the starfield. Simple. On the Show Picture events, set the magnification to 30% instead of 1000%, and in the Move Picture events, set the magnification to 1000% instead of 30%. Just swap the values and you're all set!

Hope some of you find my first tutorial helpful :-)

~Kusanagi