Jump to content


Photo

Ds Control Extension


  • Please log in to reply
1 reply to this topic

#1 IceMetalPunk

IceMetalPunk

    InfiniteIMPerfection

  • GMC Elder
  • 9603 posts
  • Version:GM:Studio

Posted 02 January 2008 - 09:22 AM

Trust me, I made this before I saw the ds_point topic. Not that it matters, because I don't have any ds_point functions in this extension :P .

Anyway, let's get to it!

The DS Control extension is designed to give you a bit more control over your data structures. It adds the following functions:

-ds_grid_clip: Allows you to crop a ds_grid down, removing extraneous borders of a single supplied value. For example, you can clear the grid with 0's, then fill it as necessary. Then this function can remove the bordering 0's and return only the useful part of the grid.

-ds_list_pad: Pad the beginning, end, or both of a ds_list with a specified value.

-ds_list_trim: Trim a specified value off the beginning, end, or both of a ds_list, leaving all other values (as well as "trapped" values of the specified one surrounded by other values) intact.

-ds_stack_insert: Inserts a specified value into a ds_stack at the specified position from the bottom of the stack (bottom=position 0).

-ds_stack_delete: Deletes the value at a specified position in a ds_stack.

-ds_queue_delete and ds_queue_insert: Same as their "stack" equivalents, only the position is from the head, the head being position 0.


These are all useful no doubt, especially the stack and queue insertion and deletion scripts. Bet you never thought you could treat stacks and queues like lists when you needed to, huh :D ?

As an added bonus, an optional argument called "destroy" in all of these functions allows you to specify whether the original data structure should be modified, or a modified copy should be returned (default behavior).

Without further ado, here is the .GEX (along with the .GML for those who like scripts better):

http://icemetalpunk..../DS_Control.zip

If you use the .GEX, be sure to read the help file! If you use the .GML scripts, be sure to read the README script!

Comments are appreciated ;) .

-IMP ;) :GM127:

Edited by IceMetalPunk, 02 January 2008 - 09:22 AM.

  • 0

:GM123: Are you an artist who likes creating original creature designs? Maybe you can help out with Elementa here! Give it a look; you might like the idea :)

:bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny: :excl: :bunny:


#2 leif902

leif902

    GreenMan Games

  • New Member
  • 748 posts

Posted 02 January 2008 - 10:05 PM

Nice idea, but it needs expansion, good job :D
(If you would like some more scripts to add to it PM me, I have a large supply of similar scripts that I use regularly)
  • 0
Sam Whited (Leif902)
YoYo Games Wiki | SamWhited.com (blog)