iFAction游戏制作工具

iFAction游戏制作工具

评价数不足
Day/Night System
由 PorkChip 制作
Adding a day to night system is a very easy way of creating a sense of realism to your game and submersing your players into the atmosphere of the environments you create. In this guide I will outline how to make a basic day/night system.
   
奖励
收藏
已收藏
取消收藏
Dusk 'til Dawn
Don't worry, no vampires here... we haven't made it dark yet for a start.
Ok, so first off we want to select Trigger tool from the taskbar at the top.
You'll now want to right click anywhere on your map and select Create/Change Trigger.
This is just an event handler, so you can leave the image blank. You want to change the Trigger Condition to Auto-Run.
Make sure both of the Reiterative and Parallel checkboxes are checked. This ensures the event loops but does not affect other processes.
Beneath where it says Contents: Double click to Add, do this and select the Effect (Sun icon) tab, then choose Flash Screen.
Click on the colour to select colour. Now, you can play about with the colours as you wish, but for this guide I will keep it very basic.
So, I wish to start out with the game in the evening time, slightly darker than the normal screen.
Set the Red, Blue and Green sliders all at 0 and set the Opacity to 100 and Confirm.
Now we will set the Duration(f) to 999, the maximum value. This will make it more of a tint than a flash, the effect we want. Confirm.
We now want to have the effect of it getting darker towards night time.
To do this, Double Click to Add and select Logic (Light bulb) tab and then Wait.
Again, you can select whatever time you wish, but I'm going to go with 300 for now.
Ok, so underneath you can now repeat the above steps exactly the same (you can Copy and Paste) only this time set the Opacity to 200.
This is going to be our night time. Scary ****!
Remember to add the Wait function underneath too.
Now, we want the effect of moving towards dawn.
Repeat exactly the first step and set Opacity to 100 again so from 200 to 100 it will give the effect of getting lighter.
Add Wait function again exactly as before.
Lastly, we want the whole cycle to be complete by setting the daytime, which would be a normal iFAction screen.
Exactly same, only this time set Opacity to 0, or the effect of no tint.
Now, playtest your game and watch the magic unfold.
50 Shades of Day...
Ok, well more like 3. But you can add more by inputting extra Wait commands and setting 150 and 50 in Opacity, for instance.
One method would be to lighen/darken by each game hour, a little extra work but more realistic.
Anyway, using my instructions, your game screen effects should appear in the following order...

Dusk - 100 Opacity (Dim Effect)
Night - 200 Opacity (Dark Effect)
Dawn - 100 Opacity (Dim Effect)
Day - 0 Opacity (Regular Effect, no tint)

The most important thing to remember is the Reiterative. If you don't activate it, this event will only fire the once and you will be forever stuck in the daytime after that. No sleep? Waaahhh!
This is a very basic time function. You can further utilise this system by spawning enemies that only come out at night time, adding music that only plays during dawn to daylight hours, the list is virtually endless.

That concludes this short guide. Thanks for reading and hope it has been of use, please give it a thumbs up if it has. :P