Page 1 of 1

(Fun Suggestion) Cloning

Posted: 03 Apr 2019, 14:19
by KINGTUT10101
Could we have a feature with fun that would allow us to clone a building, which would retain all information about it? Right now, if I wanted to have a building that can move or something that also has multiple frames, the frame it is on is not saved when I move the building using the "destroy/build" method. When I do use that method, the game just picks a random frame when it builds that building, not the same frame as the building that built it.

This means that if I want to have a building with three frames that can move in all four directions, I'll probably need to have 12 fun objects (4 directions * 3 frames) alone just to make sure it doesn't lose it's frame while moving.

Re: (Fun Suggestion) Cloning

Posted: 03 Apr 2019, 16:18
by Lobby
This is another special case that shows how limited the fun syntax actually is. It's not a programming language and you'll notice that whenever you try to do something that wasn't thought of when designing it :)

In Lua you would do something like:

Code: Select all

function script:daily(x, y)
  ...                                            -- The code that decides where to build something
  local frame = Tile.getBuildingFrame(x, y)      -- Fetching own frame
  Builder.buildBuilding(script:getDraft(), targetX, targetY, frame)   -- Building the new building with the same frame
end
And just append it to your building (could even be reused for multiple buildings)
:lua: