Log In  
Follow
bagelbyheart
:: Unfold ::

ok, so I'm stumped. I have a table that works fine when I make it in the command line, but is missing a value when I reference it from cart. There are no errors on load of the cart data.

Here is the table:

bomber={
 spr={33,34,35},
 val=1000,
 aspd=10,
 gun=missile,  -- table
 mov=_circles, -- function
 ebhv=function(self)
  local e=self
  if (e.elite>elitecut) then
   e.val=e.val*4
  end
 end
}

I am using the following command to check the table when loaded:

for k,v in pairs(bomber) do print(k.." "..type(v)) end

Which returns:

aspd number
ebhv function
spr table
val number
mov function

Whereas pasting the table into command line and running that again returns:

aspd number
ebhv function
spr table
gun table
val number
mov function

Finally I made a dummy cart that seems to work as expected.

function check(tbl)
 for k,v in pairs(tbl) do
  print(k.." "..type(v))
 end
end

function pew()
 return null
end

function _circles()
 return null
end

missile={}
missile.n="homing"
missile.f=pew

bomber={
 spr={33,34,35},
 val=1000,
 aspd=10,
 gun=missile, -- table
 mov=_circles, -- function
 ebhv=function(self)
  local e=self
  if (e.elite>elitecut) then
   e.val=e.val*4
  end
 end
}

Cart #yafuziyose-0 | 2021-02-28 | Code ▽ | Embed ▽ | No License

P#88307 2021-02-28 19:51

:: Unfold ::

Cart #zebozanone-0 | 2020-11-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

My first attempt at a shmup type game. Fairly basic with 3 enemy and weapon types in addition to bombs and life drops.

The code is a mess. I might go through and refactor it one day, but I'm mostly just happy to be done =)

P#83876 2020-11-06 21:08

Follow Lexaloffle:          
Generated 2022-11-26 16:40:32 | 0.065s | Q:13