- Jun 17, 2017
- 5,891
- 29,935
Issue resolved, leaving this here in case someone else runs itno this issue.
OK, so I'm working with lists for a project. Like so...
default profile_girls = ["Artemis", "Batgirl", "BlackCanary", "Cassie", "DonnaTroy", "Hawkgirl", "Huntress", "MissMartian", "Stargirl", "Starfire", "Supergirl", "Terra", "Vixen", "WonderWoman", "Zatanna"]
Note the default, not define.
That's my list. I THINK that I've declared this right, and in fact, Ren'Py can access these elements as if it's a list.
But when I go to do this, at some point later on in the game:
$profile_girls.append("KiteLass")
It throws me an error, saying that profile_girls is a string...
So i tried using a couple of Python functions in the console, essentially:
And the 'is str' check returns False.
I have a way to 're-compile' a list to the variable, i.e.
using a len(profile_girls) to get the list length,
and then use the len to set the 'for i in range(0, x) to get the name values out of the old list into a placeholder list individually
then append those to a 'placeholder' list,
then wipe out the contents of profile_girls, i.e. profile_girls = []
Then use the 'loop' function to append each girl in the 'placeholder' list to profile_girls one at a time...
I tried .copy, but the time I tried it the error was still there...
In any case, this works, and I can then append new names to the 'fixed' list.
So my questions are:
1) Has anyone else ran into this issue using Ren'Py,
2) If so, what' command word' works in Ren'Py to detect if my 'str' is masquerading as a list.
If I can find a 'command word' that doesn't return 'False' when I ask, then I'll know that my list isn't a 'full fledged' list and can implement the 'fix' and maybe track down at what point the 'semi-conversion' occurred.
I just don't want to have to keep re-creating the 'almost a list' each night, I'd rather keep the 'fixed' list intact instead of re-building it each time...
It 'should' transcribe perfectly each time using my method, but no sense tempting fate...
I tried:
isinstance(profile_girls, str)
That returns as False in the console.
Ren'Py 7.4.11 btw.
Any ideas?
OK, so I'm working with lists for a project. Like so...
default profile_girls = ["Artemis", "Batgirl", "BlackCanary", "Cassie", "DonnaTroy", "Hawkgirl", "Huntress", "MissMartian", "Stargirl", "Starfire", "Supergirl", "Terra", "Vixen", "WonderWoman", "Zatanna"]
Note the default, not define.
That's my list. I THINK that I've declared this right, and in fact, Ren'Py can access these elements as if it's a list.
But when I go to do this, at some point later on in the game:
$profile_girls.append("KiteLass")
It throws me an error, saying that profile_girls is a string...
So i tried using a couple of Python functions in the console, essentially:
You must be registered to see the links
And the 'is str' check returns False.
I have a way to 're-compile' a list to the variable, i.e.
using a len(profile_girls) to get the list length,
and then use the len to set the 'for i in range(0, x) to get the name values out of the old list into a placeholder list individually
then append those to a 'placeholder' list,
then wipe out the contents of profile_girls, i.e. profile_girls = []
Then use the 'loop' function to append each girl in the 'placeholder' list to profile_girls one at a time...
I tried .copy, but the time I tried it the error was still there...
In any case, this works, and I can then append new names to the 'fixed' list.
So my questions are:
1) Has anyone else ran into this issue using Ren'Py,
2) If so, what' command word' works in Ren'Py to detect if my 'str' is masquerading as a list.
If I can find a 'command word' that doesn't return 'False' when I ask, then I'll know that my list isn't a 'full fledged' list and can implement the 'fix' and maybe track down at what point the 'semi-conversion' occurred.
I just don't want to have to keep re-creating the 'almost a list' each night, I'd rather keep the 'fixed' list intact instead of re-building it each time...
It 'should' transcribe perfectly each time using my method, but no sense tempting fate...
I tried:
isinstance(profile_girls, str)
That returns as False in the console.
Ren'Py 7.4.11 btw.
Any ideas?
Last edited: