Level12Teleport wrote:So I have been trying to utilize an "Insert proper item in alcove" type section in a mod I'm working on using a script I found on here
The only problem is when I place an air essence on the beacon it just disappears entirely, the sound and light changes as if it is hovering on the pedestal but my door doesn't open and the essence disappears. I tried again on a beacon without the script attached and the essence just disappears every time I try placing it on any beacon, is this a problem in using beacons specifically? what is a way around this?
EDIT: I fixed the script problem, I just switched every word surface in the scrip to the word socket because the beacons appear to not actually have a surface, instead they have sockets and it worked, however the essence still disappears upon placing in socket instead of floating above it like expected. anyone know why?
If you read the beacon definition, you see this hook:
Code: Select all
onUpdate = function(self)
local socket = self.go.socket
if socket:count() > 0 then
local it = socket:getItem()
if it.go.name == "essence_fire" then
it.go:setWorldPositionY(0.85 + math.sin(Time.currentTime()) * 0.05)
elseif it:hasTrait("essence") then
it.go:setWorldPositionY(0.75)
end
end
end,
setWorldposition is used with a value between 0.8 and 0.9; each elevation take place between 0 and 3, so the essence appears above the socket ONLY if elevation is 0! If your beacon is by exemple at elevation 3, make a clone object like this:
(sorry! here, in a castle elevation, count 4 by elevation, not 3 )
Code: Select all
cloneObject{
name = "beacon_balance_elev3",
baseObject = "beacon_balance",
components = {
{
class = "Light",
onUpdate = function(self)
local socket = self.go.socket
if socket:count() > 0 then
local it = socket:getItem()
if it.go.name == "essence_balance" then
it.go:setWorldPositionY(12.85 + math.sin(Time.currentTime()) * 0.05)
elseif it:hasTrait("essence") then
it.go:setWorldPositionY(12.75)
end
end
end,
},
},
}
and it's done!
PS. for clone object, see JKos thread