Forum rules - please read before posting.

add variables

Hi
Is it possible to add the data of two or more variables and have it displayed on the screen?
thanks

Comments

  • Yes - you can use the Variable: Set Action to increase one variable's value by another.

    If you use that Action to set the value of either an Integer or Float variable, you can set the Method to Formula, and then refer to the variables you wish to add with tokens.

    The [var:X] token allows you to refer to a Global variable with ID = X. Similarly, [localvar:X] refers to Local variables.

    For example, to add the two variables with IDs of 3 and 7, you'd type:

    [var:3] + [var:7]
    

    For more on available tokens, see the Manual's "Text tokens" chapter.

    To then display the variable on-screen, you can use another such token in a Label menu element's "Label text" box. See this tutorial for more on this topic.

  • Thanks Chris

  • Hello,
    Is it possible to get something similar but with highlighted inventory item (instead of selected)?

    I'd like to display what the stats would be if the player equiped a certain item. I currently have one variable which is the base value of the stat, and each inventory item has a set of properties which I add to make a new variable.

    It'd be nice to have a column with values showing the base value + the item property of an item that the player is highlighting/hovering over.

  • I'm not sure what you're referring to with items - there's no mention of selected items above.

    However, the currently-highlighted inventory item instance can be gotten with:

    AC.KickStarter.runtimeInventory.HoverInstance
    
  • Oh sorry, I had multiple threads opened and replied to the wrong one.
    Thanks!

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.