Tokenat is used as follow:
tokenat(string, index, separator)
Return the Nth token from the string by separator.
For example, tokenat("apples|oranges|bananas", 1, "|") returns oranges.
So i suppose you store on the position (1,GoldUp,0) in the array a string like "50,gold,"
Now tokenat(Array.At(1,GoldUp,0),0,",") will return the string "50"
If it is not string or the string does not contain a "," then the tokenat is totaly useless. So i assume that is what you do.
Tot make calculations with the string "50", we need to convert it to a number. Int() is the way to do that.
So ... int("50") returns 50
or in general it is int(tokenat(Array.At(1,GoldUp,0),0,","))
But, you make it yourself very very very difficult.
If GoldUP = goldproduction/tick then the array needs as many positions on the Y-axis as the maxium ever producable gold.
Again (1,GoldUp,0) means no more then a position in the array. Position 1 on the x-axis, position GoldUp (wich can be zero but also 9999999999999999999)on the Y-axis, 0 on the Z-axis.
On that postion you can store a value. But those values you will never ever find back. Because GoldUp keeps gooing and gooing. All youre values are from one second to the other second on another place in the array.
It is ofcourse up to you to find a way to make that work. And maybe one day, when you have this working you can explain this to me again. (if i am still here)
In the mean time, i suggest to look at my suggestion again. Or take some Array tutorials if you dont beleive me, all fine for me.
Example ... GOLDMINE lvl 1, for 150 gold, 150 lumber ... and lets do it as you wish with a 3D array
Make a global variable with the name 'GoldMine' = 1
Make a global variable with the name 'Gold' = 1
Make a global variable with the name 'Lumber' = 2
I assume you have a variable 'level'.
Now store the values in the array.
Array > Set at XYZ(Goldmine,level,Gold) to 150
Array > Set at XYZ(Goldmine,level,Lumber) to 150
Retreive the values from the array.
BuildCostInGold (for a Goldmine) = Array.at(Goldmine,level,Gold)
BuildCostInLumber (for a Goldmine) = Array.at(Goldmine,level,Lumber)
(and ofcourse, if GoldUP > BuildCostInGold, build the thing, substract BuildCostInGold from GoldUP)
Okay now, lets do another building.
Make a global variable with the name ''RandDunit" = 2
Now store the values in the array.
Array > Set at XYZ(RandDunit,level,Gold) to 400
Array > Set at XYZ(RandDunit,level,Lumber) to 300
And so on ..............
As you see, the value of 'level' > you change. Meaning the values for different levels are stored on a different place in the array. And they can always be found back.