1 list of multiple objects

149/5000
How can I call an object in the list and put it in a room?
Is it possible to create a list containing a large object?


create ("example_room_object")

// -----------------

create ("example_data_object")

// ---------------------

create ("example_object_1")
create ("example_object_2")
create ("example_object_3")

// --------------------

example_data_object.example_objectlist_attribute = NewObjectList ()

list add (example_data_object.example_objectlist_attribute, example_object_1)
list add (example_data_object.example_objectlist_attribute, example_object_2)
list add (example_data_object.example_objectlist_attribute, example_object_3)

// ----------------

example_data_object.example_object_attribute = ObjectListItem (example_data_object.example_objectlist_attribute, 0)

example_data_object.example_object_attribute.parent = example_room_object
// the 'example_object_1' Object is placed inside of the 'example_room_object' Object

// ---------------

example_data_object.example_object_attribute = ObjectListItem (example_data_object.example_objectlist_attribute, 1)

example_data_object.example_object_attribute.parent = example_room_object
// the 'example_object_2' Object is placed inside of the 'example_room_object' Object

// ----------------

example_data_object.example_object_attribute = ObjectListItem (example_data_object.example_objectlist_attribute, 2)

example_data_object.example_object_attribute.parent = example_room_object
// the 'example_object_3' Object is placed inside of the 'example_room_object' Object

with how memory works, it doesn't matter whether you got lots of objects holding very little data values each, or one object holding lots of data values, as it's just the total size of data values that matters

1 object (data) x 10 attributes each holding a data value (data) = 10 total data being stored in memory
// is no different for the computer memory than (the above and the below are the same):
10 objects (data) x 1 attribute holding a data value (data) = 10 total data being stored in memory

the memory available/allotted is finite, so long as your total data is less or equal to the memory allotted for your list/dictionary data, it'll work fine (as it fits within the available memory space available/allotted)

also, each Object itself works the same way, it has a finite/specific max size (memory space/locations) available/allotted for its attributes and their data values too

also, each Attribute Type (String, Integer:int, Double, Boolean, List, Dictionary, Script, etc) itself works the same way, it has a finite/specific max size (memory space/locations) available/allotted for its data values too


Log in to post a reply.

Support

Forums