Multiple Characters


Allows you to place and switch between multiple characters. This mechanic is taken from Nullius

Utilities
a month ago
1.1 - 2.0
316
Transportation

b Crash in on_configuration_changed

1 year, 2 months ago

Hi! I've just loaded a saved game where your mod was active but hadn't been used yet to switch characters. This resulted in a crash:

 355.129 Error AppManagerStates.cpp:1662: The mod Multiple Characters (0.3.4) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event multiple-characters::on_configuration_changed
__multiple-characters__/control.lua:358: attempt to index field 'character_tag' (a nil value)
stack traceback:
  __multiple-characters__/control.lua:358: in function 'unregister_character'
  __multiple-characters__/control.lua:373: in function <__multiple-characters__/control.lua:370>

Changing line 358 to

if global.character_tag and global.character_tag[character.unit_number] ~= nil then

will fix this. So far, I didn't get another crash yet, but line 364 also looks like it could break. Better make sure that a valid tag exists before trying to destroy it:

if tag and tag.valid then
  tag.destroy()
end
1 year, 2 months ago

Same here. Thanks for fix hint, will change on my side and wait for update

1 year, 2 months ago

Thanks for the reports! It should be fixed in 0.3.5

1 year, 2 months ago

Yes, it's working now. Thanks for the quick fix! :-)

New response