Player getting stuck in deep water
Re: Player getting stuck in deep water
Maybe that broke when they added passenger support or I simply remember wrong.
Re: Player getting stuck in deep water
It is an exact copy. As you can see in the screenshot, the car still is damaged, the contents of the trunk still is arranged in that peculiar way, and the fuel is the same as before cloning. (Originally, there were 50 solid fuel, but I drove a tiny bit so it would start to use one piece. After cloning, I drove again on the new surface, and it still had the 49 pieces of solid fuel in storage and was driving on the 50th.) I even inserted some blueprints and a Factorissimo building into the trunk, and they've been cloned as well -- without any need for LuaItemStack.transfer_stack().eradicator wrote: ↑Fri Oct 04, 2019 5:32 pmHaven't used clone() yet. I'd assume that it's an exact copy except for the entity unit_number. I'm not sure what it does to the inventory content though. Some items have unique indexes/tags too (blueprints, modded items like factorissimo factories!, etc). So it might be nessecarry to clone the car, but LuaItemStack.transfer_stack() the items.
Doing that right now. So far, it's working. I still need to detach the characters from the players, though … But tomorrow is another day!If you go that far you might as well all pack it up in a generic function that autodecides which method to use ofc...
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Player getting stuck in deep water
Never mind. It's almost working now, and of course I've implemented the check for uncharted chunks you suggested.
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!
Re: Player getting stuck in deep water
Correct. I've been wasting time lately with using teleport() for moving the vehicle on the same surface, and clone() for moving it on another surface. Just using set_driver()/set_passenger() on the cloned vehicle would make the player appear to be in the car but leave the character outside, which was weird.
However, those pesky Wube guys have gotten into my way and made that new function obsolete before I could upload the new version of my mod!
(@Devs: Thanks a lot for making it possible to teleport cars to other surfaces now -- it really makes things much easier!)
A good mod deserves a good changelog. Here's a tutorial (WIP) about Factorio's way too strict changelog syntax!