Page 1 of 1
LocalArrayObject Functions?
Posted: Mon Mar 05, 2007 6:54 pm
by AcadiusLost
Anyone have experience with these? My impression is that they are something Ronan coded, but I haven't come across their documentation anywhere yet, was hoping for some guidance, since they are used in several places in the spawn system code.
Thanks in advance.
Posted: Mon Mar 05, 2007 8:59 pm
by indio
Maybe not relevant, but here are a couple of links:
http://nwn.bioware.com/forums/viewtopic ... m=63&sp=75
http://nwn.bioware.com/forums/viewcodep ... st=4557732
Mr. Figglesworth seems to have written some stuff on them, but maybe it's a different function. Not sure.
Posted: Mon Mar 05, 2007 11:04 pm
by ç i p h é r
Yeah Ronan did code them, but I'm not sure how useful they really are. They're simply abstractions of the basic Set* and Get* primitives, which you could just call directly. Either way, you still have to manage the indexes, counts, and whatever else you require to insert then extract the proper data record. A hash is usually much easier to work with than an array since lookups are done by keys, not indexes. But, it all depends on what you're trying to do. So what are you trying to do or what is your question?
I've got string based array handler functions somewhere on my PC, which store records on a single string using a delimiter. The advantage there is that pushing, popping, and computing array length can be handled by the array functions. The disadvantage is it requires more overhead than simple local data reads/writes. And you can't create arrays of objects.
Posted: Tue Mar 06, 2007 12:33 am
by AcadiusLost
In this case it's (as far as I could tell in my testing last night) generating an array of pointers on each spawn waypoint, which point at each spawned child. When the waypoint is ordered to despawn due to time, inactivity, or other conditionals, it queries the length of the array, and then iterates through it, using DestroyObject on each to phsyically despawn.
The arrays will always be reasonably short (one per spawn waypoint), so shouldn't need hashing or other higher-efficiency sorts. We'll be needing to remove members of such arrays as well though, to reflect spawn children being killed. I'm remembering a acr_storageobject_i.nss somewhere, I'll look into that to get started.
[edit: nevermind, found it in acr_array_i.nss, just wasn't in the #include.]
Posted: Tue Mar 06, 2007 3:10 am
by ç i p h é r
AcadiusLost wrote:We'll be needing to remove members of such arrays as well though, to reflect spawn children being killed.
Yeah all of that is left to the application to deal with from what I could see, which is what really makes me question the value of using those functions at all. Do you see any benefits to them, AL?