Forum rules - please read before posting.

[Feature request] Set variable IDs from editor

Hi,
there's 3 developers on a project I'm working on. Unity is a git nightmare all by itself but one problem keeps popping up related to AC. As global variable IDs are generated automatically and sequentially whenever we add a variable in two concurrent feature branches, we run into a conflict.
If the variable is used in multiple places, it's really difficult (and thus error-prone) to resolve it via editing files since you'd have to be careful to find all references, whether in action list assets or in scenes. It doesn't help that finding references automatically via editor is not always reliable and sometimes gives incomplete results.
We often end up doing one of the features all again.

I know you probably want to keep the sequential order of variable IDs since it's convenient for users. Would it be possible to add an option when creating a new variable to set it's ID manually? Or is there a better solution you can think of?

Comments

  • It doesn't help that finding references automatically via editor is not always reliable and sometimes gives incomplete results.

    Can you provide steps to reproduce this issue?

    Once a new Variable is created, you can manually change its ID value by viewing the Inspector of the Variables Manager asset file - though this should not be done once anything else references it.

    I don't know the context of how your variables are being used, but another option is to rely on the Variables component, which allows you to create sets of Variables in a GameObject or prefab. Where possible, it's best to move your game logic to prefabs and asset files when collaborating - see this tutorial for more on this topic.

  • edited January 2021

    I don't know how to reproduce this reliably, I just noticed that sometimes not all references get reported - I tried it now in our real project with a variable where I remember there was a problem. I got one reference in action list placed in a scene but I didn't get one from an action list asset. Both are used in the project.
    However, when I tried it on a small example project, I got all the refences that I expected, even when some of them were in scenes and some of them in assets for the same variable.
    Thanks for the suggestion on moving game logic to assets. As we are wrapping up with our project in a few weeks I don't think we'll implement it at this stage but I'll definitely keep that in mind in the future.

  • You got a bug into my head about reproducing this and I think I got it. :)
    From my observation if a variable is used in action list asset that is used as On start cutscene in a scene, the reference doesn't get reported.

  • edited January 2021

    Thanks for the report. Which Action, specifically, references it?

  • Never mind. Recreated - this'll be addressed.

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.