Difference between revisions of "Dynamic Storage"

113 bytes removed ,  15:06, 23 June 2012
Byline removed - Error tag removed (added a note to solve it) - Unfinished tag removed (seems finished to me)
imported>Haama
(Updated warning)
imported>QQuix
(Byline removed - Error tag removed (added a note to solve it) - Unfinished tag removed (seems finished to me))
 
Line 1: Line 1:
{{Errors}}
{{Unfinished}}
{{Byline}}


'''Better warning''' The following does not work - The [[PlaceAtMe]] objects used here cannot be reliably referenced later. It is much easier to use arrays (either [[Introduction_to_Pluggy_Arrays|Pluggy]] or upcoming OBSE arrays) or even [[AddToLeveledList|leveled lists]] (using OBSE functions) to store the necessary information.


----
Preamble note: Since OBSE (not to mention Pluggy) has added array manipulation to Oblivion script language, the implementation described in this article is only meaningful for modders that don't want to use OBSE in their mods.


By: [[User:Tegid|Tegid]] 18:15, 4 May 2006 (EDT)
This Page and subsequent pages are currently unfinished, but included because I think the information already contained is useful.


==Warning==
==Warning==
Line 76: Line 69:
So, if this code actually compiled, it would create a list with 20 elements, each element having a reference to the next element in the list, and since there has to be a front of the list, the first element's reference is stored in the Head reference variable.  So if we write the list out starting from the head and using Node# where # is the Number stored in the node, we would see that the list looks like this:
So, if this code actually compiled, it would create a list with 20 elements, each element having a reference to the next element in the list, and since there has to be a front of the list, the first element's reference is stored in the Head reference variable.  So if we write the list out starting from the head and using Node# where # is the Number stored in the node, we would see that the list looks like this:
Head->Node0->Node1->Node2-> . . . ->Node18->Node19.  Where -> is shorthand for "Has a reference to" so Head has a reference to Node0 who has a reference to Node1 and so on.  If we wanted to print out the Number of every node in the list we would write that code like this (let's assume we have already built the list with Head as the first element):
Head->Node0->Node1->Node2-> . . . ->Node18->Node19.  Where -> is shorthand for "Has a reference to" so Head has a reference to Node0 who has a reference to Node1 and so on.  If we wanted to print out the Number of every node in the list we would write that code like this (let's assume we have already built the list with Head as the first element):
Note that the above is just a simplified, conceptual code, as you cannot access script variables the way it is coded (set Curr.Number to count", etc). Check [[Linked List Tutorial]] for a more realistic approach.
<pre>
<pre>
long count
long count
Anonymous user