Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 27

Thread: Repository

  1. #11
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    Are you sure? All in all, SimpleEntity inherits from Listener.

  2. #12
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    True, so only complex entities are allowed to spawn before level waittill spawn, since they needed to be able to be pre-rendered.

  3. #13
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    Do you get any warning or error message when you try to do so? Maybe I could skip that limitation..

  4. #14
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    No, just that trying to spawn a listener before level waittill spawn doesn't work; it returns NULL or NIL (can' remember).
    For me, it's not that big of a deal. I use SimpleEntity before level waittill spawn and for data structs I want to targetname anyway.

  5. #15
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    Ok. But I think we shouldn't use SimpleEntities. I may take a look at this, and let us create pure Listeners in pre-spawn. If I find it too difficult, we'll stick to SimpleEntites then.

  6. #16

    Default

    I thought maybe this would be useful. I'm not sure what to put it into though. I thought about maybe an array.scr and putting this and other array stuff from strings.scr into it??

    PHP Code:
    ///////////////////////////////////////////////////////////
    // NumberSort - ArMaGedDoN (Insertion Sort)
    // sorts an array of numbers
    // returns the sorted array
    // Optional parameter "desc" for descending order
    // Best Case O(N) - Worst Case O(N^2)
    ///////////////////////////////////////////////////////////
    NumberSort local.array local.direction:

        if(
    local.direction == "desc")
        {
            for(
    local.1;local.local.array.size;local.x++)
            {
                
    local.tmp local.array[local.x]
                for(
    local.y=local.x;local.&& local.array[local.y-1] < local.tmplocal.y--)
                    
    local.array[local.y] = local.array[local.y-1]
                
    local.array[local.y] = local.tmp
            
    }
        }
        else
        {
            for(
    local.1;local.local.array.size;local.x++)
            {
                
    local.tmp local.array[local.x]
                for(
    local.y=local.x;local.&& local.array[local.y-1] > local.tmplocal.y--)
                    
    local.array[local.y] = local.array[local.y-1]
                
    local.array[local.y] = local.tmp
            
    }
        }

    end local.array 

  7. #17
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    I'd write some more sorting stuff + some array search stuff like binary tree search and place it in sort.scr or something like that

  8. #18
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    Am working on a similar thing as well. If you need inspiration:
    getHiValuefromArray -> get highest value from specified array
    getLowValuefromArray -> get lowest value from specified array
    getExtValuefromArray -> get lowest & highest value from specified array
    arrayTo3DVector -> convert specified array of 3 values to vector array
    convertHashtoConstArray -> convert a single-column hasharray to a one-dimensional constant array
    updateArray -> updates arrays with dynamic slots so there are no gaps between entries
    concatenateArrays -> merge/connect two existing arrays
    shuffleArray -> randomly shuffle the data in that array.
    sortArray -> sorts array numerically or alphabetically, ascending or descending
    bubbleSortArray -> special sort function for multiple criteria (e.g. player scoreboard)
    convertToHashArray -> convert constant array to hash array
    addtoConstArray -> convert a series of individual variables into a constant array of values
    removeFromArray -> remove specific entry from array and close the gap
    deleteArray -> special delete function that detects and removes potential entities in the array before deleting it
    arrayToInt -> convert array values to integer format
    arrayToStr -> convert array values to string format
    arrayToFloat -> convert array values to float format
    Will share my functions when they're done and tweaked.

  9. #19
    Über Prodigy & Developer Razo[R]apiD's Avatar
    Join Date
    May 2010
    Location
    Poland, Lublin
    Posts
    3,257

    Default

    What about linked lists, maps, stack, fifo? Would they be useful?

    We could write a scripting engine inside of the scripting engine ;p

  10. #20

    Default

    Quote Originally Posted by Sor View Post
    Am working on a similar thing as well. If you need inspiration:

    Will share my functions when they're done and tweaked.
    awesome!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •