- Aug 4, 2017
- 16
- 21
I need some advice from someone who really knows their shit in Ren'Py and Python. I've asked this question on the lemmasoft forums and didn't get a reply so here's hoping that somebody here can help me out.
I'm working on developing a hierarchical map system that uses a four digit number to express relative location within that hierarchy. I'm also developing a dynamic menu system that generates a menu based on which areas you can move to.
The locations are stored in a list called 'map', so for example the overworld is map[0000] = "overworld" and one level down is map[1000]. In map[1000], you can move up to map[0000] and down to map[1100] and map[1200] and so on and so forth.
I'm totally new to both Python and Ren'Py so forgive if I'm making some bonehead mistakes.
My problem is that whenever I show my navigation screen is the script, I get an IndexError. I've confirmed that the value being used that induces the error is 9000 and the maximum index of map is 4222.
My problems are almost definitely coming from some strange language quirk that I didn't catch in the documentation. I could spend some time writing a bruteforce solution to my problem, but dynamic generation seems much better for the long term.
I've included what I believe to the the relevant code as well as the traceback for the error. If anyone has an idea but needs the rest of the code, please feel free to ask me for it. Thank you for your help.
I'm working on developing a hierarchical map system that uses a four digit number to express relative location within that hierarchy. I'm also developing a dynamic menu system that generates a menu based on which areas you can move to.
The locations are stored in a list called 'map', so for example the overworld is map[0000] = "overworld" and one level down is map[1000]. In map[1000], you can move up to map[0000] and down to map[1100] and map[1200] and so on and so forth.
I'm totally new to both Python and Ren'Py so forgive if I'm making some bonehead mistakes.
My problem is that whenever I show my navigation screen is the script, I get an IndexError. I've confirmed that the value being used that induces the error is 9000 and the maximum index of map is 4222.
My problems are almost definitely coming from some strange language quirk that I didn't catch in the documentation. I could spend some time writing a bruteforce solution to my problem, but dynamic generation seems much better for the long term.
I've included what I believe to the the relevant code as well as the traceback for the error. If anyone has an idea but needs the rest of the code, please feel free to ask me for it. Thank you for your help.