obj
InventBox
var
free
icon = 'inventBox.dmi'
layer = 2
free = "TRUE"
box1
icon_state = "r1c1"
screen_loc ="Imap:1:13,6:21"
//box 2 blabla
//box 3 blabla etc
mob
proc
UpdateInvent()
var
num
for(num=1,num<=24, num++) //loops through each invent box
var/obj/InventBox/box[num]
if(box[num].free = "TRUE")
Problem description:
"if(box[num].free = "TRUE")" gives me an error of: 122:error: .: missing comma ',' or right-paren ')'
I am trying to loop through each inventBox obj to check if they are "free". if they are, then I replace box[num] obj with a different obj, by setting box[num].screen_loc = null (so it doesn't show up on the map) and put the new obj in its screen_loc
but the if statement is giving me a syntax error it seems.. so I'm not sure how to get around that yet
I have even tried this: and still get the error
if(var/obj/InventBox/box[num].free = "TRUE")
That loops through every object of that type that exists. Narrow down your search from there. You can also create a list before you search if you know exactly where you need to search, and search through that list rather than every instance.