Kingdom Ablaze
Sponsor
ive allways wanted to screw around with the sort method to make a script to sort items in my inventory and such. could some one please exsplain to me how to use it properly, because i didnt find the help file all that helpful.
also if its not to much of a hassle is it possible to have an arrray like data = [23,1,2,3,45,....] and have the sort method put the returned array of objects in that order? just in case that makes no sence here is an example:
23= potion, 1 = super potion, 2 =extra kick ass potion, 3= antidote, 45 = super antidote
if you sort it it would be in this order: super potion, extra kick ass potion, antidoe, superantidoe, potion
but if you can control the sort it would be
potion, super potion, extra kick ass potion, antidote, super antidote
the reason i find this would be helpful is if you keep adding itens in your game the would be better fit earlier in the list.
also if its not to much of a hassle is it possible to have an arrray like data = [23,1,2,3,45,....] and have the sort method put the returned array of objects in that order? just in case that makes no sence here is an example:
23= potion, 1 = super potion, 2 =extra kick ass potion, 3= antidote, 45 = super antidote
if you sort it it would be in this order: super potion, extra kick ass potion, antidoe, superantidoe, potion
but if you can control the sort it would be
potion, super potion, extra kick ass potion, antidote, super antidote
the reason i find this would be helpful is if you keep adding itens in your game the would be better fit earlier in the list.