Forum rules - please read before posting.

Is there a way to set a local component var (int) by the value of a global var (int)?

edited August 2023 in Technical Q&A

I was trying to set a local component variable, an integer named 'Health' to be equal to a global variable integer called 'MuscleStat'

I thought it would be as simple as typing [var:0] (which is the MuscleStat replacement token) in a Variable: Set action. However, in the action's field where you can type a value in I'm unable to enter the brackets: []

It only takes numbers or letters.

Attached are screenshots of the variables and the action that I am trying to enter the variable into. Is there another way around this? Thank you for any help!

https://postimg.cc/6TjBPLYc

https://postimg.cc/060s0pzp

Comments

  • When using the Variable: Set Action to update an Integer variable, you can use its Formula method to paste in a variable token.

    However, the Variable: Copy Action is a dedicated Action for transferring values between variables.

  • Ohh ok I see - thank you for that clarification, that makes 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.