Calling a screen such as:
And from within the screen printing out the character's name yields me:
This is concerning as there is no reason for a single call to the screen to result in the underlying framework actually making multiple calls. At least it has the correct character though. But only on the first call to the screen. On subsequent calls to the screen I see it start to print things such as:
Code: Select all
John Smith
John Smith
Nancy Drew
Nancy Drew
John Smith
Nancy Drew
Why I am seeing John Smith again when I pass the character of Nancy Drew is beyond me, as it shouldn't be retaining parameters after the screen has been closed and recalled. Yet again at least the last entry is the right character. Another call with John Smith, while giving me a long print out with many Nancy Drew's mixed in lands on John Smith as the last entry and so displays properly. However, this is where it starts to mess up and I start to see odd behavior. The next call to the screen with Nancy Drew results in:
Code: Select all
Nancy Drew
John Smith
Nancy Drew
Nancy Drew
John Smith
Nancy Drew
John Smith
John Smith
Nancy Drew
John Smith
Nancy Drew
Nancy Drew
Nancy Drew
John Smith
The last entry being John Smith makes the screen display improperly as it is retaining the wrong character at the end. Can anyone help me understand what is going on here?
Here is the full screen code that is producing these results:
Code: Select all
screen test(character):
layer "test"
if (character is not None):
$ print (character.name)