Page 1 of 1

[0.17.79] get_associated_characters() returns empty table on new game with character

Posted: Mon Dec 23, 2019 10:12 am
by Honktown
I was testing unrelated things with console commands in a new single player game, and using

Code: Select all

game.players[1].get_associated_characters()
returns an empty table, but

Code: Select all

game.players[1].character
returns my character.

I don't know if that's intentional behavior or not, that the starting character is not "associated". Honestly I'm not sure what being associated means if this is expected behavior. I got the impression a player "owned" characters, and may be assigned multiple, so they could switch them without searching/keeping track of the individual character entities. In that sense, I'd expect the starting character to be associated.

Example command:

Code: Select all

/c game.print(#game.players[1].get_associated_characters())
prints 0

Code: Select all

/c game.print(game.players[1].character.name)
prints character

(searched forum but didn't find much of anything on the topic, and not this particular example)

Re: [0.17.79] get_associated_characters() returns empty table on new game with character

Posted: Tue Dec 24, 2019 12:11 am
by Rseding91
Thanks for the report. That's intended: associated characters is not the character entity the player is currently controlling.

Moving to modding help.