Forum rules - please read before posting.

Global Variable Linking - Expected results?

edited July 14 in Technical Q&A

Unity ver: 2018.2.2f1
AC ver: 1.68.3

Hello folks,

I've just updated to the latest version of AC and thought I'd give linked variables a whirl. They seem to be working great, but I'm getting some output in my console which I wanted to check is expected / correct.

Here's the setup:

We've got our global variable setup.

We've got our script (which is basically a copy of the VariableLinkingExample.cs)

We've got an Action List which changes the value of the variable.

Now, when the value is changed from true to false, I'm seeing the follow output in the console:

I'm seeing triplets in the console. Is it expected that the OnDownloadVariable event should be called twice before OnUploadVariable is fired?

Thanks!

Comments

  • Are you certain that both "OnDownload" messages are coming from the ActionList? One should display on startup.

    Let's see the full stacktrace of each message.

  • edited July 15

    Hey Chris.

    Indeed, I see one OnDownload at startup. The three mentioned however appear in the same instant during gameplay; when that action list above is triggered.

    Bit of context, that action list is attached to the appearance of conversation options (basically when conversation options are on screen I disable player movement and prevent them from opening the inventory):

    Here's the stack trace:

  • This is because - for separate reasons - all Actions within an asset file have their AssignValues method called before the ActionList as a whole is run. The behaviour is expected, though perhaps not ideal.

    I would classify this as safe to ignore - since the variable is being downloaded from your script to AC twice, and not the other way around. Or is this causing an issue?

  • Hey Chris. No issue, like I say, just a result I wanted to double check was ok. Everything is otherwise working fine. :)

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.