Data handling in animations
List Processing
- tofirst moves the list pointer back to the first item
- current retrieves the current value
- next retrieves the next value in the list
- prev retrieves the previous value in the list
- select retrieves a random value from the list
- pluck retrieves a random value from the list, and will not retrieve that value again.
Changing Lists
- push will add a value at the end of the list.(ex: update data NAME push "Value")
- pop will remove the value at the end of the list and return it. (ex: update var NAME set data.LISTNAME.pop)
- fush will add a value to the beginning of the list.
- fop will remove the value from the beginning of the list and return it.
- remove will remove the first instance of the given value from the list(ex: update data BList remove _sprite)
remove _all will remove all items from the list
- reset will reset the list to its original state (as given by its 'create' statement).
- renew will re-randomize the list.
- set will set a particular list item value.
Example: update data MyData set 3="some value"
Getting List Information
Data also supports some information requests in the form data.LISTNAME.request
- contains({test value}) returns the current item in the list without changing where you are in the list. Example data.MyList.contains("happy dog")
- count returns the number of items in the list
- current returns the current item in the list without changing where you are in the list.
- first returns the value of the first item in the list
- fopped returns the value that was most recently returned using fop
- get({position in list}) get the value at the given position in the list (1-based indexing). Example data.MyList.get(7)
- last returns the value of the last item in the list
- popped returns the value that was most recently returned using pop
- position returns a number from 1 to {n} indicating at what position you are in the list as you move through it.
- remaining returns the number of items left as you move through it
- tofirst move the pointer back to the first item in the list
Example update data MyList tofirst