• 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!

Can't use Pick.. TFS 1.3

Simonalina

Member
Joined
May 10, 2008
Messages
180
Solutions
1
Reaction score
15
Location
Sweden
So.. i just got this bug...

when trying to use my Pick ID:2553 Nothing hapens...

I checked on my "Tiles" and it says "Action ID:110".
so.. then i changed it to 105 that i searched on this forum they said it should be?... BUT.. where do i change so it works on 110 also?? i don't wanna fix all "pick" holes on mapeditor.. :O

Please help haha!
 
Solution
actionIds = {
sandHole = 100, -- hidden sand hole
pickHole = {105, 142, 152}, -- hidden mud hole
levelDoor = 1000, -- level door
}
You currently have:
Lua:
pickHole = {105, 142, 152}, -- hidden mud hole
but it's looking for:
Lua:
pickHoles

so simply rename pickHole to pickHoles
If I understood you correctly, you wish to add another actionId for picks to open holes on ground.

You could do the following:

in data/lib/core/actionids.lua
replace
Lua:
pickHole = 105,
with
Lua:
pickHoles = {105, 110},

After that open data/actions/lib/actions.lua
find
Lua:
if table.contains(groundIds, ground.itemid) and ground.actionid == actionIds.pickHole then
replace with
Lua:
if table.contains(groundIds, ground.itemid) and table.contains(actionIds.pickHoles, ground.actionid) then
 
If I understood you correctly, you wish to add another actionId for picks to open holes on ground.

You could do the following:

in data/lib/core/actionids.lua
replace
Lua:
pickHole = 105,
with
Lua:
pickHoles = {105, 110},

After that open data/actions/lib/actions.lua
find
Lua:
if table.contains(groundIds, ground.itemid) and ground.actionid == actionIds.pickHole then
replace with
Lua:
if table.contains(groundIds, ground.itemid) and table.contains(actionIds.pickHoles, ground.actionid) then
This was really helpful! thank you, really.. thank you! :D

If I understood you correctly, you wish to add another actionId for picks to open holes on ground.

You could do the following:

in data/lib/core/actionids.lua
replace
Lua:
pickHole = 105,
with
Lua:
pickHoles = {105, 110},

After that open data/actions/lib/actions.lua
find
Lua:
if table.contains(groundIds, ground.itemid) and ground.actionid == actionIds.pickHole then
replace with
Lua:
if table.contains(groundIds, ground.itemid) and table.contains(actionIds.pickHoles, ground.actionid) then
data/actions/scripts/tools/pick.lua:eek:nUse
data/global.lua:73: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:

you know why is that?


Lua:
i changed this:     if table.contains(groundIds, ground.itemid) and ground.actionid == actionIds.pickHole then

Into this:

Code:
if table.contains(groundIds, ground.itemid) and table.contains(actionIds.pickHoles, ground.actionid) then
        ground:transform(392)
        ground:decay()
        toPosition:sendMagicEffect(CONST_ME_POFF)


        toPosition.z = toPosition.z + 1
        tile:relocateTo(toPosition)
    end
 
data/actions/scripts/tools/pick.lua:eek:nUse
data/global.lua:73: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:

you know why is that?


Lua:
i changed this:     if table.contains(groundIds, ground.itemid) and ground.actionid == actionIds.pickHole then

Into this:

Code:
if table.contains(groundIds, ground.itemid) and table.contains(actionIds.pickHoles, ground.actionid) then
        ground:transform(392)
        ground:decay()
        toPosition:sendMagicEffect(CONST_ME_POFF)


        toPosition.z = toPosition.z + 1
        tile:relocateTo(toPosition)
    end

Code:
data/global.lua:73: bad argument #1 to 'pairs' (table expected, got nil)
Assuming line 73 is this:
Lua:
if table.contains(groundIds, ground.itemid) and table.contains(actionIds.pickHoles, ground.actionid) then

Either groundIds is nil or actionIds.pickHoles is nil.
to figure out which one, simply move the 2nd part to a new line and let the error happen again.
Lua:
if table.contains(groundIds, ground.itemid)
and table.contains(actionIds.pickHoles, ground.actionid) then

After you figure out in which line the error is happening make sure the first parameter passed into table.contains exists & is accessible.
 
Code:
data/global.lua:73: bad argument #1 to 'pairs' (table expected, got nil)
Assuming line 73 is this:
Lua:
if table.contains(groundIds, ground.itemid) and table.contains(actionIds.pickHoles, ground.actionid) then

Either groundIds is nil or actionIds.pickHoles is nil.
to figure out which one, simply move the 2nd part to a new line and let the error happen again.
Lua:
if table.contains(groundIds, ground.itemid)
and table.contains(actionIds.pickHoles, ground.actionid) then

After you figure out in which line the error is happening make sure the first parameter passed into table.contains exists & is accessible.
Lua:
Lua Script Error: [Action Interface]
data/actions/scripts/tools/pick.lua:onUse
data/global.lua:73: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
        [C]: at 0x7ff71e876ef0
        [C]: in function 'pairs'
        data/global.lua:73: in function 'contains'
        data/actions/lib/actions.lua:434: in function <data/actions/lib/actions.lua:281>

So:
Code:
and table.contains(actionIds.pickHoles, ground.actionid) then
 
Lua:
Lua Script Error: [Action Interface]
data/actions/scripts/tools/pick.lua:onUse
data/global.lua:73: bad argument #1 to 'pairs' (table expected, got nil)
stack traceback:
        [C]: at 0x7ff71e876ef0
        [C]: in function 'pairs'
        data/global.lua:73: in function 'contains'
        data/actions/lib/actions.lua:434: in function <data/actions/lib/actions.lua:281>

So:
Code:
and table.contains(actionIds.pickHoles, ground.actionid) then
(table expected, got nil)

first parameter passed is this:
Lua:
actionIds.pickHoles
pickHoles is missing from data/lib/core/actionids.lua
 
(table expected, got nil)

first parameter passed is this:
Lua:
actionIds.pickHoles
pickHoles is missing from data/lib/core/actionids.lua
actionIds = {
sandHole = 100, -- hidden sand hole
pickHole = {105, 142, 152}, -- hidden mud hole
levelDoor = 1000, -- level door
}
 
actionIds = {
sandHole = 100, -- hidden sand hole
pickHole = {105, 142, 152}, -- hidden mud hole
levelDoor = 1000, -- level door
}
You currently have:
Lua:
pickHole = {105, 142, 152}, -- hidden mud hole
but it's looking for:
Lua:
pickHoles

so simply rename pickHole to pickHoles
 
Solution
Back
Top