LocalArrayObject Functions?

Scripted ALFA systems & related tech discussions (ACR)

Moderators: ALFA Administrators, Staff - Technical

Locked
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

LocalArrayObject Functions?

Post 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.
User avatar
indio
Ancient Red Dragon
Posts: 2810
Joined: Sat Jan 03, 2004 10:40 am

Post 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.
Image
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post 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.
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post 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.]
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post 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?
Locked