- Jun 10, 2017
- 11,099
- 16,552
It come from the inside mechanism.And also that if you put a second copy of a .rpyc file in another location, Ren'py will have a conniption, since now it will see anything in that file as being declared twice. Been there, been bitten by that... LOL
Basically speaking, in addition of its AST, Ren'py have a name map of the whole code. It's a dictionary indexed by the labels, when it's a label statement, or a tuple containing the full path, an integer and the line number where the statement was, for all the other lines. And it have the statement object (perhaps the whole Node with the later optimization change) as value.
You can have a quick look from the console with this :
Code:
renpy.game.script.namemap.keys()
And for an example of the value :
Code:
renpy.game.script.namemap["start"]
And the answer is simple, both the full path and line number are part of a node, and so included in all the .rpyc files. It's wonderful for a modder and it's also why un.rpyc sometimes generate files with so many blank lines ; it place each statement at the exact line number where they are supposed to be.
That's the reason why you had this problem. The .rpyc aren't in the same place and don't necessarily have the same content ; you can even rename one afterwards. But for Ren'py you'll still have two "myComputer/myGameDirectory/myGame/game/someFile.rpy, line 12" and... well, it's not supposed to happen.
You're welcome.Thanks for the expert insight, anne!