Sorting Items in Shop Window - Printable Version +- Save-Point (https://www.save-point.org) +-- Forum: Games Development (https://www.save-point.org/forum-4.html) +--- Forum: Code Support (https://www.save-point.org/forum-20.html) +--- Thread: Sorting Items in Shop Window (/thread-7208.html) Pages:
1
2
|
Sorting Items in Shop Window - Mel - 01-16-2018 I'm looking for a way to sort the items in the shop window individually like it was in RM2k and not by ID. Maybe a simple scriptcall would be enough, but at this point I'm not sure how to do it. RE: Sorting Items in Shop Window - kyonides - 01-16-2018 It would require a custom script because all items or weapons or armors are hashes that store ID's and amounts, not items per se. Even if you separate every potion or bronze sword, they will be identical, you may pick any of them or the next one that it would not matter at all. Before anybody offers a solution, you would need to specify how you pretend to use it and where you need it, i.e. a bag menu, a shop menu, etc. RE: Sorting Items in Shop Window - Mel - 01-16-2018 Just the normal shop window but with a custom order instead of sorted by ID. Maybe you know the Call Shop command from RPG Maker 2000. There the items in the shop windows were sorted by the order how you put it into the command windows in the editor. So you could have it like this: [1] Bronze Sword [5] Bronze Spear [9] Bronze Axe [2] Iron Sword [6] Iron Spear [10] Iron Axe Without rearranging the whole database. RE: Sorting Items in Shop Window - BeJeremiah - 01-17-2018 Try this. Not sure if this is what you are looking for but trying replacing refresh method in Shop Buy with this. Code: def refresh RE: Sorting Items in Shop Window - Mel - 01-17-2018 That helps alot. Thank you! At least as long as the alphabetical order does the trick.^^ RE: Sorting Items in Shop Window - BeJeremiah - 01-17-2018 (01-17-2018, 12:55 AM)Melana Wrote: That helps alot. if not, change .name to the attribute you need. You can sort by name, occasion, price, etc. As long as it is shared by items, weapons, and armor. Otherwise you have to edit a little more to specify when to apply the sorting and what to sort by. RE: Sorting Items in Shop Window - Mel - 01-17-2018 Yes, that works fine. The only complicated thing is to have a complete uncommon order without a specific sorting. Like adding weapon[67],weapon[64] and weapon[70], and then weapon[5], weapon[8] and weapon[2] just because you want them in that specific order without a reason. Might be very unlikely though. RE: Sorting Items in Shop Window - BeJeremiah - 01-17-2018 (01-17-2018, 01:35 AM)Melana Wrote: Yes, that works fine. Im not sure why it changes the natural order of the array in the first place other than it is creating a new one that is referencing the original $game_temp.shop_goods but not directly using it. Maybe someone a little more experienced than I would know. RE: Sorting Items in Shop Window - kyonides - 01-17-2018 I don't recall quite clearly, but I thought the event command window tries to order them once you close the add goods subwindow, or was it during the addition of new goods? If there's no order implied by the maker itself, it should be showed the way they were added. If that's not the case, then it's obvious you'd need to check the corresponding Interpreter command that handles the shop option, there you may find if there is a sort method at some point. Keep in mind it stores info like this: [[0,1],[1,2],[2,4]] RE: Sorting Items in Shop Window - Mel - 01-17-2018 Yes the event command sorts them already in the editor by ID. If you put in the Iron Sword first and then the Bronze Sword, the Bronze Sword will stay on top. |