Forum rules - please read before posting.

how to make environment effects in Adventure Creator? and a day & night system?

edited May 2014 in Technical Q&A
hey guys its me again... im halfway through my game.. im trying to do a harvest moon inspired game

here are my questions

1.)How to make a day and night system? can anyone guide me through this..

2.)How to make it rain atleast...

3.)How can i buy from an NPc?
 
that is all

thanks and cheers to all to those who will answer.. you've been great help to me so far thanks :D

Comments

  • edited May 2014
    1) You can make a day and night system by setting up a timer. This is the way I did it:

    When the scene start cutscene runs, you can have it finish by running a new cutscene which runs in the background, which I call "timer", where the first action is an engine: pause game action (or, alternatively, you can have the cutscene delayed by 1 second). Then, you would have a variable: set action which adds 1 to a "seconds" variable. 

    After that action, you can have a new cutscene run (I call it clock) which checks to see if an arbitrary number of seconds has gone by (I chose 300, meaning 5 minutes of real time) and if seconds = 300, I then go to an action which adds 1 to the variable "hour". After that, you can check if hour = 24, and if so change it back to 0, or 1, thus starting a new day. Be sure to end the clock cutscene with an action which runs the timer cutscene again so that they loop. 

    You can then add more actions throughout the game which turn off sunlight if hour = 18 (just an example) or have people start sleeping if hour = 20. One thing I haven't yet figured out is a way to change the skybox in the camera, so that it looks like it's becoming night time when you look at the sky, but that is a Unity issue, not an AC issue. 

    2) Rain can be done with pretty simple particle effects. Try to look up a Unity particle tutorial. You can then add a "particle switch" script to the particle so that it can function in AC using actions. The appropriate action in AC would be object:send message- turn on. You can use that action to turn on the rain particle system at any point in the game. 

    You can also even have a random variable be set and checked every hour to simulate a random weather pattern: at any time (for instance each time the hour is increased by 1), you can set a variable (Rain, for instance) as a random number between 0 and 20. You can then immediately check the variable to see if it is, for instance, between 0 and 5. If so, you can then turn on the particle system so that it's raining, and turn it off the next hour. If it is above 5, then it won't rain for the next hour. Any type of weather can be done this way!

    3) I haven't set up anything like this just yet, but I believe it's fairly straightforward. First, set up a "shop" menu with the relevant buttons and labels. Have a dialogue option in a conversation with said NPC run an action to turn on the menu (or, if you use a "money" item on the NPC, have the menu turn on). 

    Each button in the menu can be an item the player can buy, so set up a menu action list for each button in which the actionlist checks to see if the player has the right amount of money (inventory: check), and if so, bring up a menu prompt to confirm the purchase. If the player says yes, have the appropriate amount of money removed from the inventory (inventory:add or remove) and then add the purchased item (again, inventory: add or remove). 


  • thank you for the very detailed answer this would be great help thank you very much again :D
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.