here is what i have in my script header:
struct ItemStats{
int buy;
int sell;
String name;
};
and this i have in my global script:
ItemStats myitems[10];
myitems[0].buy=10; //line 96
myitems[0].sell=5;
myitems[0].name="Poster";
...
when i want to save my game i get this error:
error (line96): parse error: unexpected 'myitems'
i have done it like in the manual but it doesn't work. what am i doing wrong?
AFAIK, you can't set the values outside of a function - try moving the:
myitems[0].buy=10; //line 96
myitems[0].sell=5;
myitems[0].name="Poster";
// ... Etc
... into game_start.
EDITED: Since apparently you CAN have Strings in Structs now. Which is nice.
Yes, same reason why you can't do
int myvariable;
myvariable = 10;
outside of any functions. Outside you can define variables, but not set them to any value. The only exception is when you combine the two:
int myvariable = 10;
So just do as Ashen suggests.
didn't know that... :D
i thought i am god and i can do everything...but i found my master in ags... :D
thx