(Fun Suggestion) Cloning

Plug-in related stuff can be discussed here.

Moderator: Plugin Moderators

User avatar
KINGTUT10101
1,000,000 inhabitants
Reactions:
Posts: 2220
Joined: 07 Jul 2016, 22:50
Location: 'Merica
Plugins: Showcase Store
Version: Beta
Contact:

Plugin Creator

Platform

(Fun Suggestion) Cloning

#1

Post 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.

User avatar
Lobby
Developer
Reactions:
Posts: 3705
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

Re: (Fun Suggestion) Cloning

#2

Post 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:

Post Reply Previous topicNext topic

Return to “Plug-In Discussion”