Forum rules - please read before posting.

[param:2] - [var:3]. Is this possible in an ActionList?

I want a global variable to be subtracted from a Componant Variable parameter through a formula. This isn't working so I assume I have to pass the parameter to a global variable, do the subtraction, then pass it back to the parameter.

Is that the most convenient way?

Comments

  • Currently. The Variable: Set Action does allow use of tokens inside formula calculations, but passing [param:2] would refer to the component variable's ID - not the value.

    I should like it to be possible to pass the value itself as a token - I'll see if this is something that can be implemented.

  • edited April 2020

    For my purposes I'd need the value to still be reading through the parameter and not the Component Variable itself, since I will change which GameObject's Component Variable will be passed into the Parameter depending on the situation.

  • The token won't change, but I'll look into an alternative, i.e. [paramval:2] that will return the linked-variable's value.

  • More on this.
    An example in an Asset List;

    When using Action List: Set Parameter and setting [param:2] to [param:3], I notice that the node states New Value is: Copied From Parameter.

    Does this mean that later on that a node with a formula [paramval:3] - 5 will only subtract from this parameter copy of the initial component variable or will it subtract all the way back from the original component variable?

  • If I'm reading you right, copying a parameter won't link the two together - it'll take the same value at that moment, but further changes to the copy won't affect the original.

  • Could it be possible to pass whichever variable is linked in a parameter to another parameter?

    or in this situation is it better to copy the parameter value to a new variable, then after changes copy it back to that same parameter and so to the linked original variable?

  • I don't know what your situation actually is.

    Can you elaborate on the specifics? I'm not sure what it is you're ultimately trying to do.

  • Yes I wasn't very clear.

    I can currently set parameter y to hold variable x.

    Is in it possible to pass variable x from parameter y to parameter z so that parameter z then holds variable x and any changes made to parameter z affect the original variable x?

  • I'll need even more clarity, I'm afraid.

    What's the parameter's actual type? Are you storing a reference to the variable (i.e. the parameter type is "Global Variable"), or storing the variable's value (i.e. parameter type is "Float")?

    If the former, then yes - this should be possible. Sharing some screenshots of the ActionLists's Actions and properties would likely be best.

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.