AtomicTorch Studio Forums

VoidExpanse => Help section => Topic started by: ninekorn on May 19, 2018, 12:16:05 AM

Title: discontinued 2023 july 29th . by ninekorn
Post by: ninekorn on May 19, 2018, 12:16:05 AM
discontinued 2023 july 29th . by ninekorn
Title: Re: variables in xml files? can we set them from inside the xml or script only?
Post by: ai_enabled on May 19, 2018, 02:20:32 AM
Hello!

No, you cannot define variable values there.
It's used just to define which variables should be saved for the script instance. So if your script has a global variable (defined in the root of the script file) of name "price", the game will store it in a savegame for this script.
The names of variables in XML should match the names of variables in the corresponding
script file.
If you want to set default values to such variables, just define them with assigning right in the script file. For example:

// in the root of the JS file
var price = 123;


Regards!