Code: Select all
surface.create_entity{name="assembling-machine-2", position=ent.position, force="neutral", fast_replace=true, spill=true, raise_built=true, create_build_effect_smoke=true, recipe = ent.get_recipe().name}
So I have a script that grabs an entity (ent) which is an assembling machine 1
The upgrade detailed above works. Machine data (speeds name etc) update correctly. The machine becomes a 2 that looks like a 1.
Is there a reason im missing why a fast replace doesn't update the sprite? Further, GUI side the sprite is updated. So My first thought is that both sprites might remain, but attempts to destroy ent didnt help much.
Several of the properties above and on the entity seem to have no real effect. player, force, variation, spill, fast_replace, entity.color etc. - so im likely missing something.
Any help would be great.