Forum rules - please read before posting.

Log event to then impact an action

Hi! I'm a newbie and I've scrawled through the tutorials but maybe I'm missing something obvious so apologies if this is a silly question, and I'm not even sure how to ask but here goes!!

Basically I would like to be able to 'record' somehow if something has happened to then use within an action.

And example would be:

There's a broken bottle. I don't need to pick it up yet because I have no need for it.
Then I click on a tangled rope. My character now 'knows' that they need to find something sharp to cut it.
When I go back to the bottle I can now pick it up because I now know that I need something sharp.

Any advice would be appreciated :) Thank you :)

Comments

  • edited July 3

    Welcome to the community, @heavygrit.

    Variables are the core way to keep track of actions and events that have taken place.

    In this case, I'd say you want a Boolean variable, which can be True or False. A Bool named "Learnt about Rope" could be set to False by default, and set to True once the Player has clicked on it.

    Variables can be Global (game-wide), Local (per-scene), or Component (per-GameObject). Global and Local variables are defined in the AC Game Editor's Variables tab.

    At runtime, you can then use the Variable: Set Action to change its value to True in your Rope interaction, and the Variable: Check Action in your Bottle interaction to adjust the Player's behaviour based on its value.

    More details on this topic can be found in the Manual's Variables chapter.

  • Thanks so much, this is PERFECT! Makes total sense!!

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.