Jump to content
Sign in to follow this  
Followers 1
Tungstène

luaNext: first parameter is not a table

Recommended Posts

I'm trying to develop a new cartridge (named cartIloveStrasbourg). On cartridge start and restore events, it scans all the zones and modifies some properties...

 

First, it ran perfectly with the webwigo emulator. This was the code:

function InitZones()
  for k,z in pairs(cartIloveStrasbourg:GetAllOfType('Zone')) do
    if string.sub(z.Name, 1, 3) == "TA " then
      z.Visible = false
      z.Active = false
      function z:OnEnter()
        AddToPassport(self)
      end
    end
  end
end

When I tried it IRL, WhereYouGo crashed with an error. I understood that OpenWIG doesn't implement the GetAllOfType method. I corrected my code with this new one:

function InitZones()
  for k,z in pairs(cartIloveStrasbourg.AllZObjects) do
    if Wherigo.Zone:made(z) then
      if string.sub(z.Name, 1, 3) == "TA " then
        z.Visible = false
        z.Active = false
        function z:OnEnter()
          AddToPassport(self)
        end
      end
    end
  end
end

This code is working both with the emulator (webwigo) and the Android players (WhereYouGo and Wherigeooh).

I asked a friend of mine to test with his iPhone and the cartridge crashes with this error message:

 

Quote

 

LUA Alert

luaNext: first parameter is not a table

 

 

There is nothing else displayed (no line number, nothing).

 

Did I make something wrong? It's hard to test without an iPhone at hand... Any help would be appreciated.

Share this post


Link to post
Posted (edited)

I wrote a test cartridge. My friend tried it with his iPhone. This cartridge just shows the type of the cartridge's property AllZObjects using different ways to access it.

  • cartridge.AllZObjects is not a table but nil.
  • _G["cartridge"]["AllZObjects"] is not a table either but nil too.

I found an old thread on this forum saying that iPhone Wherigo Player wasn't able to use this property but I looked at the code of some open source cartridge known to work with iPhones and they use this property.

 

What could be wrong?

Edited by Tungstène
English is not my native language...

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 1

×