• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Error wall banshee quest

nefinoo

Carnage.flv
Joined
Sep 11, 2010
Messages
549
Solutions
1
Reaction score
58
Location
Lo Mochis, Sinaloa
error banshee.png

Lua:
local config = {
    [1110] = {position = Position(32259, 31891, 10), revert = true},
    [1111] = {position = Position(32259, 31890, 10), revert = true},
    [1112] = {position = Position(32259, 31891, 10), revert = true},
    [1113] = {position = Position(32259, 31890, 10), revert = true},
    [1114] = {position = Position(32266, 31860, 11)},
    time = 100
}

local function revertWall(wallPosition, leverPosition)
    local leverItem = Tile(leverPosition):getItemById(1946)
    if leverItem then
        leverItem:transform(1945)
    end

    Game.createItem(1498, 1, wallPosition)
end

local function removeWall(position)
    local tile = position:getTile()
    if not tile then
        return
    end

    local thing = tile:getItemById(1498)
    if thing then
        thing:remove()
        position:sendMagicEffect(CONST_ME_MAGIC_RED)
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid ~= 1945 then
        player:sendCancelMessage('The lever has already been used.')
        return true
    end

    local wall = config[item.uid]
    removeWall(wall.position)
    if wall.revert then
        addEvent(revertWall, config.time * 1000, wall.position, toPosition)
    end
    item:transform(1946)
    return true
end
 
Solution
[1110] = {position = Position(32259, 31891, 10), revert = true},
[1111] = {position = Position(32259, 31890, 10), revert = true},
[1112] = {position = Position(32259, 31891, 10), revert = true},
[1113] = {position = Position(32259, 31890, 10), revert = true},
[1114]
these numbers 1110-1114 are the uniqueid, which should be in the .xml too? because in the .xml they are different.
xml should have all 5, yes.

and all levers should have those unique id's as well.
View attachment 48850

Lua:
local config = {
    [1110] = {position = Position(32259, 31891, 10), revert = true},
    [1111] = {position = Position(32259, 31890, 10), revert = true},
    [1112] = {position = Position(32259, 31891, 10), revert = true},
    [1113] = {position = Position(32259, 31890, 10), revert = true},
    [1114] = {position = Position(32266, 31860, 11)},
    time = 100
}

local function revertWall(wallPosition, leverPosition)
    local leverItem = Tile(leverPosition):getItemById(1946)
    if leverItem then
        leverItem:transform(1945)
    end

    Game.createItem(1498, 1, wallPosition)
end

local function removeWall(position)
    local tile = position:getTile()
    if not tile then
        return
    end

    local thing = tile:getItemById(1498)
    if thing then
        thing:remove()
        position:sendMagicEffect(CONST_ME_MAGIC_RED)
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if item.itemid ~= 1945 then
        player:sendCancelMessage('The lever has already been used.')
        return true
    end

    local wall = config[item.uid]
    removeWall(wall.position)
    if wall.revert then
        addEvent(revertWall, config.time * 1000, wall.position, toPosition)
    end
    item:transform(1946)
    return true
end
local wall = config[item.uniqueid]

Maybe try with the full thing? uniqueid vs uid
 
Ok, let me try
No, stay the same

Lua:
Lua Script Error: [Action Interface]
data/actions/scripts/quests/the_queen_of_the_banshees/the_first_seal.lua:onUse
...ipts/quests/the_queen_of_the_banshees/the_first_seal.lua:39: attempt to index local 'wall' (a nil value)
stack traceback:
        [C]: in function '__index'
        ...ipts/quests/the_queen_of_the_banshees/the_first_seal.lua:39: in function <...ipts/quests/the_queen_of_the_banshees/the_first_seal.lua:32>
 
Ok, let me try
No, stay the same

Lua:
Lua Script Error: [Action Interface]
data/actions/scripts/quests/the_queen_of_the_banshees/the_first_seal.lua:onUse
...ipts/quests/the_queen_of_the_banshees/the_first_seal.lua:39: attempt to index local 'wall' (a nil value)
stack traceback:
        [C]: in function '__index'
        ...ipts/quests/the_queen_of_the_banshees/the_first_seal.lua:39: in function <...ipts/quests/the_queen_of_the_banshees/the_first_seal.lua:32>
Well, we can definitely say that the issue is with the table.
So either the table doesn't have the correct uniqueid.. or the switch doesn't.
 
Well, we can definitely say that the issue is with the table.
So either the table doesn't have the correct uniqueid.. or the switch doesn't.

[1110] = {position = Position(32259, 31891, 10), revert = true},
[1111] = {position = Position(32259, 31890, 10), revert = true},
[1112] = {position = Position(32259, 31891, 10), revert = true},
[1113] = {position = Position(32259, 31890, 10), revert = true},
[1114]
these numbers 1110-1114 are the uniqueid, which should be in the .xml too? because in the .xml they are different.
 
[1110] = {position = Position(32259, 31891, 10), revert = true},
[1111] = {position = Position(32259, 31890, 10), revert = true},
[1112] = {position = Position(32259, 31891, 10), revert = true},
[1113] = {position = Position(32259, 31890, 10), revert = true},
[1114]
these numbers 1110-1114 are the uniqueid, which should be in the .xml too? because in the .xml they are different.
xml should have all 5, yes.

and all levers should have those unique id's as well.
 
Solution
Back
Top