I just try to work on that event on Varanas bridge, where you have to throw off these animals.
I try to gather some attributes of the objects around me, manipulate them and work with changed and unchanged attributes.
But this drives me kinda crazy.
Just for a test exsample I use this function
Code: Select all
function printList()
local objectList = CObjectList()
objectList:update()
local objSize = objectList:size()
for i=0,objSize do
obj = objectList:getObject(i)
if obj.Id == 120386 or obj.Id == 120385 or obj.Id == 120384 then
if obj.Marker == nil then obj.Marker = false end
cprintf_ex(" ID: %s, Attk: %s, Marker: %s \n", obj.Id, obj.Attackable, obj.Marker)
obj.Marker = true
cprintf_ex(" ID: %s, Attk: %s, Marker: %s \n", obj.Id, obj.Attackable, obj.Marker)
cprintf_ex(" ------\n")
end
end
end
- look if there is a member "Marker", if not defined sets it to false
- print out some information about it
- sets "Marker" to true
- print out the changed info
But when running the function once again, all changed information about an object is lost and the added member "Marker" no longer exists, so that I can not ask for the information I changed, when I called the function last time.
Has someone an idea how to keep information about an object?
... some thing comes to my mind right now: building an own table to keep objects info ... will give that a try, but I am curious about your ideas.
Minor thing is, the Attackable flag is always false at the animals, although I can throw at them. Maybe its because its not realy fighting them, but using a special atack.
But I also see, that objects like direction signs in Silverspring have Attackable set to true ... strange thing and not realy helpful for finding objects to realy fight against ... not only in the above case.
Ric