View Single Post
  #11  
Old 03-29-2012, 11:23 PM
Devil_Lord2 Devil_Lord2 is offline
David K?
Devil_Lord2's Avatar
Join Date: Apr 2011
Location: PA, MD.
Posts: 643
Devil_Lord2 can only hope to improve
Quote:
Originally Posted by ffcmike View Post
Do you realise you have 2 conditions which are exactly the same?
If you were to remove the first line of player.account in this.tempStaff, it would still work.
Yes, I did that so if the first part didn't check, it wouldn't have to do the for loop, I assumed it would speed up what ever else it is doing if the first part was not correct.

The second part is only to add +1 to whatever the i is for the level, which I believe I could do with .index() but don't know how...


Quote:
Originally Posted by ffcmike View Post
player.level is an object rather than a string, the correct value to check is 'player.level.name'.
I have been told this many times, and I still don't quite understand it since the results are always the same. :[

Quote:
Originally Posted by ffcmike View Post
It's a bad practise to loop through non-changing arrays and use .size(); for every cycle, as the function will occur every time rather than once, this can generate a lot of overhead with very large arrays. The array size can be defined as a temporary variable beforehand, which can then be used in the loop condition.
for instance temp.num = something.size(); and stick that in the loop?
I shall do that!

Quote:
Originally Posted by ffcmike View Post
onTimeout(); occuring within function onTimeout(){} without any specification for it would run infinitely until cancelled by the engine/NPC-Server.
I'll ask you later, he says it does not work but I don't know what he had done. All I know is he had many loops inside of his and said it kept maxing out or something...

He is not on for me to ask. :[

-Correction-
He gave it to me to see, but I don't know if I have the right to expose it. :X
So I must ask.
__________________

Digital Media Artist - David K? </3 (UnLoved)
www.davidkrout.com
www.twitch.com/DavidKkz



Reply With Quote