Page 1 of 1
Character corpse arbitrary color support
Posted: Wed Mar 24, 2021 12:41 am
by Xorimuth
Currently you can only set the color of a "character-corpse" by setting
character_corpse_player_index (or with player_index in create_entity). This only allows them to be color the same color as an existing player. I'd like to be able to set a corpse to any color using entity.color.
Why? I'm creating spidertron corpses using "character-corpse" so that their inventories are not lost when they are killed.
Re: Character corpse arbitrary color support
Posted: Mon Apr 19, 2021 6:51 pm
by asher_sky
+1, bump. I would like to have a rainbow of character corpses scattered about

Re: Character corpse arbitrary color support
Posted: Fri Jul 15, 2022 7:56 pm
by PrestonLeeC
Bump. I still want this functionality for spider-vehicle corpses.
Re: Character corpse arbitrary color support
Posted: Fri Jul 15, 2022 9:41 pm
by PrestonLeeC
Okay, so I figured how to do this pretty easily.
The default spidertron corpse already keeps the color it had before it died.
So, in
corpse.lua, change
pictures to
Code: Select all
picture = {
filename = "__core__/graphics/empty.png",
height = 1,
priority = "extra-high",
width = 1
}
and get rid of
Code: Select all
--data.raw.corpse["spidertron-remnants"].animation = nil
Re: Character corpse arbitrary color support
Posted: Fri Jul 15, 2022 10:59 pm
by Xorimuth
Thanks for the suggestion, that is genius! It needs some scripting to remove the corpse once the (invisible) character corpse has been emptied, but that should be straightforward. I’ll release the update tonight

Re: Character corpse arbitrary color support
Posted: Sat Jul 16, 2022 3:50 am
by Xorimuth