rezecib Posted October 19, 2014 Share Posted October 19, 2014 (edited) So I've figured out how to convert world tiles to other types by looking at terraformer.lua, but one thing I've been trying to figure out is if I convert a non-land tile (tile type ID 1) into a land tile, how can I get the world to recalculate the borders (or "islands") without reloading the game? Currently this is the function I'm using to change the tile at the cursor:function c_setTile(newType) local pos = TheInput:GetWorldPosition() local x, y = TheWorld.Map:GetTileCoordsAtPoint(pos.x, pos.y, pos.z) local oldType = TheWorld.Map:GetTileAtPoint(pos.x, pos.y, pos.z) TheWorld.Map:SetTile(x, y, newType) TheWorld.Map:RebuildLayer(oldType, x, y) TheWorld.Map:RebuildLayer(newType, x, y) TheWorld.minimap.MiniMap:RebuildLayer(oldType, x, y) TheWorld.minimap.MiniMap:RebuildLayer(newType, x, y)end When I use this on a water tile to make it into a land one, however, it doesn't change the land border beneath it, and using TheWorld.Map:GetIslandAtPoint(point) still gives 127, which is NO_ISLAND, or water. Reloading the game seems to fix this, but I've been unable to find a way to do it without that (the reason I'd like to be able to do so is to use it with Don't Starve Together, having the host be able to dynamically change the land). I haven't found anywhere you can set the island of a point or force a rebuild or anything of that sort. Edit: I wanted to also note that I looked around and found this thread about changing turf and this thread about an out-of-game world editor, but neither of these seem to do exactly what I'm trying to do. Edited October 19, 2014 by rezecib Link to comment https://forums.kleientertainment.com/forums/topic/42442-help-creating-land-bridges-or-converting-non-ground-tiles-to-ground/ Share on other sites More sharing options...
_Q_ Posted October 20, 2014 Share Posted October 20, 2014 There is something like ground undergound, its checked for on many ocassions in things that spawn some prefabs. ground underground is on the edges of the island, you can check that by removing tiles from the edge. Link to comment https://forums.kleientertainment.com/forums/topic/42442-help-creating-land-bridges-or-converting-non-ground-tiles-to-ground/#findComment-554528 Share on other sites More sharing options...
rezecib Posted October 20, 2014 Author Share Posted October 20, 2014 Yeah, I was noticing that (I called it the "land borders" in my post), but the little edges of dirty ground that you can see below the edge. Changing the tile doesn't update that, but reloading the game does seem to, which suggests there's a point in the saving/reloading process where it does update the ground, but I haven't been able to find it... Link to comment https://forums.kleientertainment.com/forums/topic/42442-help-creating-land-bridges-or-converting-non-ground-tiles-to-ground/#findComment-554754 Share on other sites More sharing options...
_Q_ Posted October 20, 2014 Share Posted October 20, 2014 Yeah, I was noticing that (I called it the "land borders" in my post), but the little edges of dirty ground that you can see below the edge. Changing the tile doesn't update that, but reloading the game does seem to, which suggests there's a point in the saving/reloading process where it does update the ground, but I haven't been able to find it... When I was checking for it, it was something in playercontroller.lua component. But it all go to complicated to make simple bridge so I never finished that. Link to comment https://forums.kleientertainment.com/forums/topic/42442-help-creating-land-bridges-or-converting-non-ground-tiles-to-ground/#findComment-554769 Share on other sites More sharing options...
rezecib Posted October 20, 2014 Author Share Posted October 20, 2014 I've looked in playercontroller and just about every else in the lua code. From what I can tell this is being handled in the C code, and that's not something I can really look at. Any Klei help? Link to comment https://forums.kleientertainment.com/forums/topic/42442-help-creating-land-bridges-or-converting-non-ground-tiles-to-ground/#findComment-554841 Share on other sites More sharing options...
_Q_ Posted October 20, 2014 Share Posted October 20, 2014 I've looked in playercontroller and just about every else in the lua code. From what I can tell this is being handled in the C code, and that's not something I can really look at. Any Klei help? I couldn't find solution for this problem back then, it would be nice to get some help on that matter. Link to comment https://forums.kleientertainment.com/forums/topic/42442-help-creating-land-bridges-or-converting-non-ground-tiles-to-ground/#findComment-554844 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now