Jump to content




Probably missing something so obvious...


  • You cannot reply to this topic
1 reply to this topic

#1 secret6timb1

  • Members
  • 78 posts

Posted 06 September 2015 - 02:18 PM

local xx,yy = obj[2],obj[3]
local f1 = project_objects[xx-1,yy]
local f2 = project_objects[xx+1,yy]
local f3 = project_objects[xx,yy-1]
local f4 = project_objects[xx,yy+1]

project_objects and obj are tables by the way.

on line local f1 = project_objects[xx-1,yy] it says ']' expected near ','

Iv stared at this for 5 minutes and dont see anything wrong.

In the lua command I just did

obj = {}
project_objects = {}
xx,yy = 0,0
local f1 = project_objects[xx-1,yy]

f1 should just be nil but it still says ] expected near ','. I must be stupid if I'm missing something.

EDIT : Sorry, Delete this thread, I meant to put it like [xx-1..','..yy]

I'm stupid o.e.

#2 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 06 September 2015 - 02:18 PM

Is "project_objects" a function you wish to call?:

local f1 = project_objects(xx-1,yy)

... or a table with a sub-table you wish to index?:

local f1 = project_objects[xx-1][yy]






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users