Εγκατάσταση Steam
Σύνδεση
|
Γλώσσα
简体中文 (Απλοποιημένα κινεζικά)
繁體中文 (Παραδοσιακά κινεζικά)
日本語 (Ιαπωνικά)
한국어 (Κορεατικά)
ไทย (Ταϊλανδικά)
Български (Βουλγαρικά)
Čeština (Τσεχικά)
Dansk (Δανικά)
Deutsch (Γερμανικά)
English (Αγγλικά)
Español – España (Ισπανικά – Ισπανία)
Español – Latinoamérica (Ισπανικά – Λατινική Αμερική)
Français (Γαλλικά)
Italiano (Ιταλικά)
Bahasa Indonesia (Ινδονησιακά)
Magyar (Ουγγρικά)
Nederlands (Ολλανδικά)
Norsk (Νορβηγικά)
Polski (Πολωνικά)
Português (Πορτογαλικά – Πορτογαλία)
Português – Brasil (Πορτογαλικά – Βραζιλία)
Română (Ρουμανικά)
Русский (Ρωσικά)
Suomi (Φινλανδικά)
Svenska (Σουηδικά)
Türkçe (Τουρκικά)
Tiếng Việt (Βιετναμικά)
Українська (Ουκρανικά)
Αναφορά προβλήματος μετάφρασης
local pos = object.position()
because you don't need it
"noAutomaticDoors" : true
"scripts" : ["scripts/weaver/inc_door.lua", "scripts/weaver/hiddenDoor.lua"]
hiddenDoor.lua could be nothing more than this
function initMaterialSpaces()
local bMats = {}
local pos = object.position()
for s, space in ipairs(storage.realSpaces) do
bMats[s] = world.material( space , "background") or "metamaterial:empty"
end
storage.matTableClosed = { {}, {} }
storage.matTableOpen = { {}, {} }
for i, spaces in ipairs(storage.spaces) do
table.insert(storage.matTableClosed[1], {spaces, bMats[i]})
end
storage.matTableClosed[2] = storage.matTableClosed[1]
end
Now that's gonna be hard to read without the indentation(thanks Steam) but it should do the job. And that should still work even if the automatic doors script changes a bit down the road.
Although it isn't a bad idea to use "metamaterial:empty" but I have a slicker way to use it than they did.
The bigger stumbling block was I couldn't locate a function to get the matitem for a given material name, so I went with the mining-damage-to-blocks thing to skip that step.
I do think I needed to get rid of the background blocks in some fasion though, since the point is to toggle between nothing/nothing and foreground/nothing. Ideally I'd be able to set the object to allow placing it on top of foreground blocks, turn the foreground blocks into a door, and just leave the background up to the user, but...
I'm already doing that for my chameleon doors(blocks and objects mod). Feel free to borrow the code for your own implementation if you like. Although you're doing something a bit different with the background blocks instead of foreground.
Anyhow to make a table of the background blocks for later spawning
bMats = {}
local mat
local i = 1
local pos = object.position()
for s, space in ipairs(objects.spaces()) do
mat = world.material( {space[1] + pos[1], space[2] + pos[2] } , "background")
if mat then
bMats[i] = mat
i = i + 1
end
The thing is though Starbound will never save that table between sessions. So you're gonna loose your blocks if you don't destroy the door before quitting.