Gw Temp

Menu

Tutorial - 'Farming and Day/Night System' by Dimensionwyrm

An item about RPGMaker 2000 posted on

Blurb

A two-in-one tutorial about making a day and night system, and making a farming game that adheres to these day/night effects.

Body

Here I will teach you a farming system. I will also be teaching an accompanying Day/night system. First is the day/night system.

DIFFICULTY:1/5
SWITCHES:INSIDE BUILDING
VARIABLES:"Minutes", "hours", "days",(Optional)months, (Optional)Years
KNOWLEDGE REQCUIRED:
Basic knowledge of variables and forks
Basic Overall knowledge of rm2k/3

STEP 1:Creating the timer
Make a new parrallel process common event. Name it Day/Night System, no start condition.
Start by making a loop. Wait 6.0 seconds(To make the time go 10 times faster than in real life). Now increase the variable minutes by one. CODE:
<>loop
<>Wait:6.0 secs
<>Variable Oper:[0001:Minutes]+, 1
<>
:End Loop

Now make a fork to check if the variable minutes is equal to 60. On the branch case increase "Hours" by one and set minutes to zero. Within that make another fork to check for hours into days where you check if the variable hours is equal to 24. CODE:
<>FORK Opt:var.[0001:Minutes] is 60
<>Variable Oper:[0002:Hours]+,1
<>Variable Oper:[0001:Minutes] set, 0
<>FORK Opt:var.[0002:Hours] is 24
<>Variable Oper:[0002:Hours] set, 0
<>Variable Oper:[0003:Days]+, 1
<>
:ELSE case
<>
:ELSE case

Before you finish up call the event "Lighting" which we will do next. If you decided to do months and years simply do that within the "hours" fork and and years within the months fork.

STEP 2:LIGHTING
Make a new common event, call. FIRST place a fork to check if the switch Inside Building is OFF. This will ensure that it will not be dark in a lighted house at night. Within that make another fork to check if the variable hours is 0. In the branch case have it tint screen almost completely dark. Continue this for the rest of the hours. CODE:
<>FORK Opt:var.[0002:hours] is 0
Tint screen xxx red, xxx blue, xxx yellow, xxx magenta
NOTE:X is the corresponding number you want.
:ELSE case
FORK Opt:var.[0002:hours] is 2
(Insert the italicized code here)
NOTE:Repeat for each hour

DONE! Now for the farming system.
NOTE:When you enter a building turn on the in building switch after the teleport and call the lighting event as well, vice versa when leaving


FARMING SYSTEM

SWITCHES:Crop 1 start, crop 2 start, etc.
VARIABLES:Days left(1 copy for each crop), all the previously mentioned variables from the day/night system, one variable for each crop that stores the amount of seeds.

STEP 1:PLANTING CROPS
Make a common event named Plant crops. It should be a call event. Have it ask which crop to plant(We will do two in this tutorial for simplicity but you can add more). In the first one, say, "Apple" make it check if the variable that stores the apple seeds, "Apple seeds", is one or more. If it is remove one. Now set the variable days left for apple to 3. Turn on the switch crop one start. Make a new common event, call. Check if the switch crop 1 start is on and if yes also check if the variable days left is 0. In that yes case play a success sound and show a success message. Give your character the item and turn off the crop start message.

STEP 2:EDITING THE DAY/NIGHT SYSTEM TO IMPLEMENT THIS
In the day/night system after increasing day check if the switch crop 1 start is on. In the yes case lower the variable days left by 1 then find a way to shut it off using a switch.

NOTE:Sorry but I can't add code as I am leaving for dinner soon.

You can use the months/years part to change how the growing system works and this is easily be customized.
Anyway, Now it is done!