Forum rules - please read before posting.

Day/Night Cycle - Time System (No Timer)

Hello Everyone! Im new to AC and unity, also my english is bad, so please be patient : )

I want to create a game that is regulated by day and night (cycle), which consists of four stages: morning / noon / afternoon / night.

This allows the player for example to go to work only from morning to afternoon, or the bar is only open from afternoon to night, and so on. So the only way to reset the day is to go home and sleep (since eventually there will be no actions left to do), and this marks the switch to a new day, changing the day of the week (Monday, Tuesday, etc).

And then how do you spend from morning to noon? With a timer or clock? No, the passage of time is measured by events (I put events to differentiate it from interactions or simply the movement of the character). Events are for example doing office work, an important dialogue sequence,etc.

Is this posible? Im really bad at programming. But maybe someone could guide me on at least the basics of how to develope such game mechanic.

Thanks and cheers to all to those who will answer. And again im sorry for my broken english haha. : D

Comments

  • Welcome to the community, @Gonzo.

    At least from what you've described, you shouldn't have to involve any programming - AC's Actions and Variables system should be enough.

    What you can do is create a Global variable that is used to store which of the four stages the game is currently in. You can then update this variable, and access it from anywhere, as necessary.

    In the Variables Manager, make sure the Global sub-tab is selected, and create a new Variable of type "Pop Up". A Pop Up lets you pre-define a fixed number of strings, so enter in four separate values of morning, noon, afternoon and night.

    If you want to also keep track of which day the player is in, you can use a separate PopUp variable that stores the current day of the week.

    Then, when determining what the player can do at any time, you can use the Variable: Check or Variable: PopUp switch Action to read these variable values and choose what happens next.

    I'm not sure how much you want to change the appearance of scenes based on their time / day, but you can either use separate scenes (e.g. "Office night" and "Office day") that get swapped in and out, or modify the same scene in its OnStart / OnLoad cutscenes, based on these variable values.

    When the player has completed an event that change the day / time of day, you can then use the Variable: Set Action to update these variable values.

  • Hello Chris! Thank you so much! I made it work.

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.
Do NOT follow this link or you will be banned from the site!