Search the Community
Showing results for tags 'null-object'.
Found 1 result
-
ooookayy Im having trouble understanding why this isn't working .. a = objectList; b = a select 0; c = b select 0; d = c find guy1; where objectList is a global array that holds a bunch of different objects. These objects are suppose to be removed from this array as they are interacted with. In this instance, I have 2 objects (both AI) objectList = [[[guy1]],[[guy2]]]; The problem is, when I interact with the object, it fails to be removed. The object can't be found in the array. d returns -1. Here's my confusion, and Im sure it has something to do with global arrays (though I cant modify it if I cant find the item in the index). When I manually delcare the array: a = [[[guy1]],[[guy2]]]; b = a select 0; c = b select 0; d = c find guy1; d returns the correct index. what the hell am I doing wrong? ._. When I manually declare, the debug console output shows a as this a [[[<NULL-object>]],[[<NULL-object>]]] despite declaring it edit: I worked around this by setting the object's vehvarname in the array instead of the actual object. This allowed me to access the value and remove it at any point in the multidimensional array.
- 1 reply
-
- global array
- find
-
(and 1 more)
Tagged with: