Are you sure? All in all, SimpleEntity inherits from Listener.
True, so only complex entities are allowed to spawn before level waittill spawn, since they needed to be able to be pre-rendered.
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.
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.x = 1;local.x < local.array.size;local.x++)
{
local.tmp = local.array[local.x]
for(local.y=local.x;local.y > 0 && local.array[local.y-1] < local.tmp; local.y--)
local.array[local.y] = local.array[local.y-1]
local.array[local.y] = local.tmp
}
}
else
{
for(local.x = 1;local.x < local.array.size;local.x++)
{
local.tmp = local.array[local.x]
for(local.y=local.x;local.y > 0 && local.array[local.y-1] > local.tmp; local.y--)
local.array[local.y] = local.array[local.y-1]
local.array[local.y] = local.tmp
}
}
end local.array
Am working on a similar thing as well. If you need inspiration:
Will share my functions when they're done and tweaked.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