[Rseding91] [for 0.16] fast replace player spills all items

This subforum contains all the issues which we already resolved.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

[Rseding91] [for 0.16] fast replace player spills all items

Post by bobingabout »

Not sure if this is a bug, or a feature request, but I'm taking it as a bug for now.

I've been working on a mod that adds classes to the game, allowing the player slightly different playstyles.
Here is the mod so far https://www.dropbox.com/s/1ynlcf7ej1bkv ... P.rar?dl=0
as it stands, when the player chooses a class, the current character entity is fast replaced with the entity of the chosen class.
This works, except the items the player was carrying get spilled out on the floor, even though there is room in the player's inventory.

one would expect the items to be added to the new entity's inventory.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16030
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: fast replace player spills all items

Post by Rseding91 »

Thanks for the report. The player entity is not fast replaceable which is why you're seeing that happen.

I'll look into making it fast replaceable for 0.16.
If you want to get ahold of me I'm almost always on Discord.
User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: fast replace player spills all items

Post by bobingabout »

Rseding91 wrote:The player entity is not fast replaceable...
by default. I had to add fast replace for the player entity in to the mod :P

Thanks for looking into it.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.
Rseding91
Factorio Staff
Factorio Staff
Posts: 16030
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: fast replace player spills all items

Post by Rseding91 »

bobingabout wrote:
Rseding91 wrote:The player entity is not fast replaceable...
by default. I had to add fast replace for the player entity in to the mod :P

Thanks for looking into it.
I meant the C++ logic in the entity doesn't handle fast replace. You can mark an entity in the prototype as fast replaceable but that just allows you to perform the action in-game. It doesn't handle things like "copy the settings from A to B, move the items, ..." - that's all done on the C++ side inside a given entity.

The character entity was never setup to do any of that :)
If you want to get ahold of me I'm almost always on Discord.
Post Reply

Return to “Resolved Problems and Bugs”