Forum rules - please read before posting.

Day/Night Cycle

Hi!

Very new to AC and game dev in general, I've seen a few posts on here about Day/Night Cycles but don't really understand them. I basically want the rounds to last from the start of the day and end at the start of the night, and then your score to be tallyed.

Any help would be greatly appreciated and if there is any other info I can give please ask.

Thank you,

Spam xoxo

Comments

  • Welcome to the community, @SpamSavage.

    What do you mean by "rounds", and what are you measuring with a score?

    You can create a Global Integer variable to keep track of the Player's score - a tutorial on this topic can be found here.

    Day/night cycles aren't typical of the adventure game genre that AC is intended for. If you can share as much detail as you can about what your exact intent is, though, I'll be able to offer more specific advice.

  • Hi Chris, Thanks for getting back to me. Not sure if I am fully utilizing AC to its full potential, in fairness.

    The basic principle of the game I'm making is that you are looking at a busy street and trying to spot particular people. You have a list of people you are trying to spot in the crowd and you have to find them all before the time runs out (this is where the day/night cycle would come in, not so much an actual day/night cycle more of a visual to represent a timer). Each person is worth a different score and if you score high enough you can move on to the next "Round". So by Rounds I mean once you find all the people or get enough points, within the time frame, you can move on to the next "Round", stage, or scene.

    Hopefully that is enough info, let me know if you'd like any more.

    Thanks again,

    Spam xoxo

  • edited May 2022

    You can use a Global Variable to represent how much time in the day is left, but it's cleaner to rely on a custom script to have it count-down, rather than looping an ActionList on itself.

    A script to handle this can be found on the AC wiki here:
    https://adventure-creator.fandom.com/wiki/Global_Timer

    So far as the game logic of spotting people in a crowd goes, you'd want a setup along the lines of:

    • Create a Global Integer (e.g. "Score") to keep track of your score
    • Each NPC has a Hotspot and Interaction that - when run - uses the Variable: Set Action to increase the Score value by 1, and the Hotspot: Enable or disable Action to disable the NPC's Hotspot so that they can't be interacted with again. This could be replaced by a Hotspot: Change interaction Action if you wanted them to still be interactive, but not increase score.

    Since each Interaction ActionList would essentially be the same set of Actions, you'll want to eventually rely on "ActionList parameters" so that you can use a single ActionList that gets recycled for each NPC. A tutorial on this topic can be found here, though I'd recommend getting the game logic working without them with 2 or 3 NPCs first.

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.