Forum Discussion
Romans_I_XVI
11 years agoRoku Guru
Thanks!
There are a couple of solid ideas here.
Creating an roAssociativeArray object every loop through is just stupid and I'm sure it's eating a few milliseconds. I didn't even realize I was doing it, it is not necessary.
The last suggestion is probably the best one, instead of having an array of associative arrays, I could have an associative array of associative arrays. Then I'm guessing I could just do a check like...
It would be a lot faster than looping through the array of players I'm sure, thanks a bunch! It does mean some changes to my code, but that's why I asked this question now before I got too far along 😄
There are a couple of solid ideas here.
Creating an roAssociativeArray object every loop through is just stupid and I'm sure it's eating a few milliseconds. I didn't even realize I was doing it, it is not necessary.
The last suggestion is probably the best one, instead of having an array of associative arrays, I could have an associative array of associative arrays. Then I'm guessing I could just do a check like...
id = params.id 'or something like this
If this.players.id <> invalid
'then do all of the movements for the player
else
'add the player to the array
end if
It would be a lot faster than looping through the array of players I'm sure, thanks a bunch! It does mean some changes to my code, but that's why I asked this question now before I got too far along 😄