Page 1 of 1
BGO confusion
Posted: Sat Jul 09, 2016 1:44 am
by no1
local sand = BGO.get();
function onLoop()
Text.print(tostring(BGO.count()), 0 ,15);
Text.print(tostring(table.getn(sand)), 0 ,30);
end
count prints 1 but table prints 0 WTF?
Re: BGO confusion
Posted: Sat Jul 09, 2016 2:17 am
by lotus006
try maybe with this ?
Code: Select all
Text.print(tostring(#sand), 0 ,30);
Re: BGO confusion
Posted: Sat Jul 09, 2016 2:37 am
by no1
same prints 0 and if i add more the count goes up but the table doesnt grow
just tried different ones and it wont get anything
Re: BGO confusion
Posted: Sat Jul 09, 2016 3:26 am
by MECHDRAGON777
no1 wrote:same prints 0 and if i add more the count goes up but the table doesnt grow
just tried different ones and it wont get anything
Did you open/initialize the table?
Re: BGO confusion
Posted: Sat Jul 09, 2016 6:39 am
by Enjl
Move the first line into onLoop. As of now you're grabbing the BGOs becore the level finished loading. Also to get the number of elements in a table you can just do
Re: BGO confusion
Posted: Sat Jul 09, 2016 7:10 am
by no1
ahh thanks man..why didnt i think of that, there was only one variable left to trial and error
turns out there's already a quicksand but good to know for other things ill want to code