var uRate= new Array();
uRate[0]=5000/expIncrement;
uRate[1]=10000/expIncrement;
uRate[2]=25000/expIncrement;
uRate[3]=75000/expIncrement;
uRate[4]=10000/expIncrement;
uRate[5]=250000/expIncrement;
uRate[6]=500000/expIncrement;
uRate[7]=1000000/expIncrement;
var uName=0;
var uNameString=“”;
if(num>=0&&num<uRate[0])
{
uName=(uRate[0]-num);
uNameString=“RoadSide Trader”;
}
any idea?
Loius
2
Don’t ever use Array for anything ever. List is far superior (and has all the same functions).
Try changing your var line to be:
var uRate : List.< float > new List.< float >();
You may need to .Add your values instead of just setting them, I’m not certain.
Democre
3
You’ll have to cast uRate[0] (or any other access) to an int
if(num>=0&&num<(int)uRate[0])
{
uName=(((int)uRate[0])-num);
uNameString="RoadSide Trader";
}
I would also recommend using a typed array (or list as mentioned in the other answer)
var uRate = new int[8];
//---or---
var uRate = new List.<int> ( );
Either of those would avoid the need for casting.