BGO confusion

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
no1
Shy Guy
Shy Guy
Posts: 8
Joined: Wed Jul 06, 2016 8:32 am

BGO confusion

Postby no1 » Sat Jul 09, 2016 1:44 am

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?

lotus006
Spike
Spike
Posts: 284
Joined: Thu Sep 24, 2015 12:59 am

Re: BGO confusion

Postby lotus006 » Sat Jul 09, 2016 2:17 am

try maybe with this ?

Code: Select all

Text.print(tostring(#sand), 0 ,30);

no1
Shy Guy
Shy Guy
Posts: 8
Joined: Wed Jul 06, 2016 8:32 am

Re: BGO confusion

Postby no1 » Sat Jul 09, 2016 2:37 am

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

MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6422
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
Contact:

Re: BGO confusion

Postby MECHDRAGON777 » Sat Jul 09, 2016 3:26 am

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?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9890
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: BGO confusion

Postby Emral » Sat Jul 09, 2016 6:39 am

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

Code: Select all

#table

no1
Shy Guy
Shy Guy
Posts: 8
Joined: Wed Jul 06, 2016 8:32 am

Re: BGO confusion

Postby no1 » Sat Jul 09, 2016 7:10 am

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


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari