Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

It's in the documentation. The value="" always expects an integer value, and will interpret it as an integer.

:set_integer var="prev_val" value="current_val"; 

To set based on the result of an expression (which can reference an integer variable) use:

:set_integer var="prev_val" {(current_val)}
(1 edit)

Ahh!  OK.  The first one was what I was trying, and it just kept saying invalid integer "current_val", as you'd expect.

I think my attempts to do the second one failed because of a bug elsewhere in the subroutines block, but the error always seemed to gravitate to the "}" at the end of the block...  Thanks again!  I've removed my shonky iterative setter. :)

Perhaps a concrete example of setting a variable equal to another variable in the documentation might help new users?

(+1)

I might just add a : copyvar; command even though it's technically redundant. Might be good for users that don't want to go into the EXPRESSION FORM rabbit hole.