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

TFS 0.X [Error - Action Interface]

tiago cysneiros

New Member
Joined
Apr 23, 2017
Messages
23
Reaction score
2
TFS 0.4
when I try to move the liquid from one bucket to another bucket inside my backpack I get this error:

[03/09/2018 18:02:38] [Error - Action Interface]
[03/09/2018 18:02:38] data/actions/scripts/liquids/containers.lua:eek:nUse
[03/09/2018 18:02:38] Description:
[03/09/2018 18:02:38] (luaDoDecayItem) Item not found

Containers.lua

Lua:
local DISTILLERY = {5513, 5514, 5469, 5470}
local ITEM_RUM_FLASK = 5553
local ITEM_POOL = 2016
local TYPE_EMPTY = 0
local TYPE_WATER = 1
local TYPE_BLOOD = 2
local TYPE_BEER = 3
local TYPE_SLIME = 4
local TYPE_MANA_FLUID = 7
local TYPE_LIFE_FLUID = 10
local TYPE_OIL = 11
local TYPE_WINE = 15
local TYPE_MUD = 19
local TYPE_LAVA = 26
local TYPE_RUM = 27
local TYPE_SWAMP = 28

local oilLamps = {[2046] = 2044}
local casks = {[1771] = TYPE_WATER, [1772] = TYPE_BEER, [1773] = TYPE_WINE, [1369] = TYPE_WATER, [1368] = TYPE_WATER}
local alcoholDrinks = {TYPE_BEER, TYPE_WINE, TYPE_RUM}
local poisonDrinks = {TYPE_SLIME, TYPE_SWAMP}
local drunk = createConditionObject(CONDITION_DRUNK)

setConditionParam(drunk, CONDITION_PARAM_TICKS, 60000)
local poison = createConditionObject(CONDITION_POISON)

setConditionParam(poison, CONDITION_PARAM_DELAYED, true)
setConditionParam(poison, CONDITION_PARAM_MINVALUE, -50)
setConditionParam(poison, CONDITION_PARAM_MAXVALUE, -120)
setConditionParam(poison, CONDITION_PARAM_STARTVALUE, -5)
setConditionParam(poison, CONDITION_PARAM_TICKINTERVAL, 4000)
setConditionParam(poison, CONDITION_PARAM_FORCEUPDATE, true)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(itemEx.uid == cid) then
if(item.type == TYPE_EMPTY) then
doPlayerSendCancel(cid, "It is empty.")
return true
end
if(item.type == TYPE_MANA_FLUID) then
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if(not doPlayerAddMana(cid, math.random(80, 160))) then
return false
end
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doAddCondition(cid, exhaust)
elseif(item.type == TYPE_LIFE_FLUID) then
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if(not doCreatureAddHealth(cid, math.random(40, 75))) then
return false
end
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doAddCondition(cid, exhaust)
elseif(isInArray(alcoholDrinks, item.type)) then
if(not doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)) then
return false
end
doCreatureSay(cid, "Aaah...", TALKTYPE_ORANGE_1)
elseif(isInArray(poisonDrinks, item.type)) then
if(not doTargetCombatCondition(0, cid, poison, CONST_ME_NONE)) then
return false
end
doCreatureSay(cid, "Urgh!", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "Gulp.", TALKTYPE_ORANGE_1)
end
doChangeTypeItem(item.uid, TYPE_EMPTY)
return true
end
if(not isCreature(itemEx.uid)) then
if(item.type == TYPE_EMPTY) then
if(item.itemid == ITEM_RUM_FLASK and isInArray(DISTILLERY, itemEx.itemid)) then
if(itemEx.actionid == 100) then
doItemEraseAttribute(itemEx.uid, "description")
doItemEraseAttribute(itemEx.uid, "aid")
doChangeTypeItem(item.uid, TYPE_RUM)
else
doPlayerSendCancel(cid, "You have to process the bunch into the distillery to get rum.")
end
return true
end
if(isItemFluidContainer(itemEx.itemid) and itemEx.type ~= TYPE_EMPTY) then
doChangeTypeItem(item.uid, itemEx.type)
doChangeTypeItem(itemEx.uid, TYPE_EMPTY)
return true
end
if(casks[itemEx.itemid] ~= nil) then
doChangeTypeItem(item.uid, casks[itemEx.itemid])
return true
end
local fluidEx = getFluidSourceType(itemEx.itemid)
if(fluidEx ~= false) then
doChangeTypeItem(item.uid, fluidEx)
return true
end
doPlayerSendCancel(cid, "It is empty.")
return true
end
if(item.type == TYPE_OIL and oilLamps[itemEx.itemid] ~= nil) then
doTransformItem(itemEx.uid, oilLamps[itemEx.itemid])
doChangeTypeItem(item.uid, TYPE_NONE)
return true
end
if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
return false
end
end
doDecayItem(doCreateItem(ITEM_POOL, item.type, toPosition))
doChangeTypeItem(item.uid, TYPE_EMPTY)
return true
end
 
Last edited:
when I try to move the liquid from one bucket to another bucket inside my backpack I get this error:

[03/09/2018 18:02:38] [Error - Action Interface]
[03/09/2018 18:02:38] data/actions/scripts/liquids/containers.lua:eek:nUse
[03/09/2018 18:02:38] Description:
[03/09/2018 18:02:38] (luaDoDecayItem) Item not found

Containers.lua

Lua:
local DISTILLERY = {5513, 5514, 5469, 5470}
local ITEM_RUM_FLASK = 5553
local ITEM_POOL = 2016
local TYPE_EMPTY = 0
local TYPE_WATER = 1
local TYPE_BLOOD = 2
local TYPE_BEER = 3
local TYPE_SLIME = 4
local TYPE_MANA_FLUID = 7
local TYPE_LIFE_FLUID = 10
local TYPE_OIL = 11
local TYPE_WINE = 15
local TYPE_MUD = 19
local TYPE_LAVA = 26
local TYPE_RUM = 27
local TYPE_SWAMP = 28

local oilLamps = {[2046] = 2044}
local casks = {[1771] = TYPE_WATER, [1772] = TYPE_BEER, [1773] = TYPE_WINE, [1369] = TYPE_WATER, [1368] = TYPE_WATER}
local alcoholDrinks = {TYPE_BEER, TYPE_WINE, TYPE_RUM}
local poisonDrinks = {TYPE_SLIME, TYPE_SWAMP}
local drunk = createConditionObject(CONDITION_DRUNK)

setConditionParam(drunk, CONDITION_PARAM_TICKS, 60000)
local poison = createConditionObject(CONDITION_POISON)

setConditionParam(poison, CONDITION_PARAM_DELAYED, true)
setConditionParam(poison, CONDITION_PARAM_MINVALUE, -50)
setConditionParam(poison, CONDITION_PARAM_MAXVALUE, -120)
setConditionParam(poison, CONDITION_PARAM_STARTVALUE, -5)
setConditionParam(poison, CONDITION_PARAM_TICKINTERVAL, 4000)
setConditionParam(poison, CONDITION_PARAM_FORCEUPDATE, true)

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(itemEx.uid == cid) then
if(item.type == TYPE_EMPTY) then
doPlayerSendCancel(cid, "It is empty.")
return true
end
if(item.type == TYPE_MANA_FLUID) then
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if(not doPlayerAddMana(cid, math.random(80, 160))) then
return false
end
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doAddCondition(cid, exhaust)
elseif(item.type == TYPE_LIFE_FLUID) then
if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end
if(not doCreatureAddHealth(cid, math.random(40, 75))) then
return false
end
doCreatureSay(cid, "Aaaah...", TALKTYPE_ORANGE_1)
doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
doAddCondition(cid, exhaust)
elseif(isInArray(alcoholDrinks, item.type)) then
if(not doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)) then
return false
end
doCreatureSay(cid, "Aaah...", TALKTYPE_ORANGE_1)
elseif(isInArray(poisonDrinks, item.type)) then
if(not doTargetCombatCondition(0, cid, poison, CONST_ME_NONE)) then
return false
end
doCreatureSay(cid, "Urgh!", TALKTYPE_ORANGE_1)
else
doCreatureSay(cid, "Gulp.", TALKTYPE_ORANGE_1)
end
doChangeTypeItem(item.uid, TYPE_EMPTY)
return true
end
if(not isCreature(itemEx.uid)) then
if(item.type == TYPE_EMPTY) then
if(item.itemid == ITEM_RUM_FLASK and isInArray(DISTILLERY, itemEx.itemid)) then
if(itemEx.actionid == 100) then
doItemEraseAttribute(itemEx.uid, "description")
doItemEraseAttribute(itemEx.uid, "aid")
doChangeTypeItem(item.uid, TYPE_RUM)
else
doPlayerSendCancel(cid, "You have to process the bunch into the distillery to get rum.")
end
return true
end
if(isItemFluidContainer(itemEx.itemid) and itemEx.type ~= TYPE_EMPTY) then
doChangeTypeItem(item.uid, itemEx.type)
doChangeTypeItem(itemEx.uid, TYPE_EMPTY)
return true
end
if(casks[itemEx.itemid] ~= nil) then
doChangeTypeItem(item.uid, casks[itemEx.itemid])
return true
end
local fluidEx = getFluidSourceType(itemEx.itemid)
if(fluidEx ~= false) then
doChangeTypeItem(item.uid, fluidEx)
return true
end
doPlayerSendCancel(cid, "It is empty.")
return true
end
if(item.type == TYPE_OIL and oilLamps[itemEx.itemid] ~= nil) then
doTransformItem(itemEx.uid, oilLamps[itemEx.itemid])
doChangeTypeItem(item.uid, TYPE_NONE)
return true
end
if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
return false
end
end
doDecayItem(doCreateItem(ITEM_POOL, item.type, toPosition))
doChangeTypeItem(item.uid, TYPE_EMPTY)
return true
end
Can you see if this works?
It's a fairly complex script and you seem to be having the same issue as another person I helped quite awhile ago.
I'd rather not read through the script again if I don't need to. xP
Problems with vials, bucket (Liquids)
 
Can you see if this works?
It's a fairly complex script and you seem to be having the same issue as another person I helped quite awhile ago.
I'd rather not read through the script again if I don't need to. xP
Problems with vials, bucket (Liquids)

well, you really solve my problem, but another appears when I use your script. Now I can't throw liquids at the ground, the error appears again:

[03/09/2018 21:58:55] [Error - Action Interface]
[03/09/2018 21:58:55] data/actions/scripts/liquids/containers.lua:eek:nUse
[03/09/2018 21:58:55] Description:
[03/09/2018 21:58:55] (luaDoDecayItem) Item not found

This code kill me and save me at the same time...

Code:
if(isItemFluidContainer(itemEx.itemid) and itemEx.type == TYPE_EMPTY) then
            doChangeTypeItem(itemEx.uid, itemEx.type)
            doChangeTypeItem(item.uid, TYPE_EMPTY)
            return true
        end
 
Last edited:
well, you really solve my problem, but another appears when I use your script. Now I can't throw liquids at the ground, the error appears again:

[03/09/2018 21:58:55] [Error - Action Interface]
[03/09/2018 21:58:55] data/actions/scripts/liquids/containers.lua:eek:nUse
[03/09/2018 21:58:55] Description:
[03/09/2018 21:58:55] (luaDoDecayItem) Item not found

This code kill me and save me at the same time...

Code:
if(isItemFluidContainer(itemEx.itemid) and itemEx.type == TYPE_EMPTY) then
            doChangeTypeItem(itemEx.uid, itemEx.type)
            doChangeTypeItem(item.uid, TYPE_EMPTY)
            return true
        end
Alright, I want you to try this code.. (It's from TFS 0.3.7, and as far as I'm aware it is fully functional.)
Whether this code works or not, please post your TFS version.
Lua:
local ITEM_RUM_FLASK = 5553

local TYPE_EMPTY = 0
local TYPE_WATER = 1
local TYPE_BLOOD = 2
local TYPE_BEER = 3
local TYPE_SLIME = 4
local TYPE_LEMONADE = 5
local TYPE_MILK = 6
local TYPE_MANA_FLUID = 7
local TYPE_LIFE_FLUID = 10
local TYPE_OIL = 11
local TYPE_URINE = 13
local TYPE_COCONUT_MILK = 14
local TYPE_WINE = 15
local TYPE_MUD = 19
local TYPE_FRUIT_JUICE = 21
local TYPE_LAVA = 26
local TYPE_RUM = 27
local TYPE_SWAMP = 28
local TYPE_TEA = 35

local distillery = {[5513] = 5469, [5514] = 5470}
local oilLamps = {[2046] = 2044}
local casks = {[1771] = TYPE_WATER, [1369] = TYPE_WATER, [1368] = TYPE_WATER, [1772] = TYPE_BEER, [1773] = TYPE_WINE}
local alcoholDrinks = {TYPE_BEER, TYPE_WINE, TYPE_RUM}
local poisonDrinks = {TYPE_SLIME, TYPE_SWAMP}

local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 60000)

local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, true) -- Condition will delay the first damage from when it's added
setConditionParam(poison, CONDITION_PARAM_MINVALUE, -50) -- Minimum damage the condition can do at total
setConditionParam(poison, CONDITION_PARAM_MAXVALUE, -120) -- Maximum damage
setConditionParam(poison, CONDITION_PARAM_STARTVALUE, -5) -- The damage the condition will do on the first hit
setConditionParam(poison, CONDITION_PARAM_TICKINTERVAL, 4000) -- Delay between damages
setConditionParam(poison, CONDITION_PARAM_FORCEUPDATE, true) -- Re-update condition when adding it(ie. min/max value)

local burn = createConditionObject(CONDITION_FIRE)
setConditionParam(burn, CONDITION_PARAM_DELAYED, true) -- Condition will delay the first damage from when it's added
setConditionParam(burn, CONDITION_PARAM_MINVALUE, -70) -- Minimum damage the condition can do at total
setConditionParam(burn, CONDITION_PARAM_MAXVALUE, -150) -- Maximum damage
setConditionParam(burn, CONDITION_PARAM_STARTVALUE, -10) -- The damage the condition will do on the first hit
setConditionParam(burn, CONDITION_PARAM_TICKINTERVAL, 10000) -- Delay between damages
setConditionParam(burn, CONDITION_PARAM_FORCEUPDATE, true) -- Re-update condition when adding it(ie. min/max value)

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(isPlayer(itemEx.uid)) then
        if(item.type == TYPE_EMPTY) then
            doPlayerSendCancel(cid, "It is empty.")
            return true
        end

        if(item.type == TYPE_MANA_FLUID) then
            if(not doPlayerAddMana(itemEx.uid, math.random(80, 160))) then
                return false
            end

            doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_MONSTER)
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
        elseif(item.type == TYPE_LIFE_FLUID) then
            if(not doCreatureAddHealth(itemEx.uid, math.random(40, 75))) then
                return false
            end

            doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_MONSTER)
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
        elseif(itemEx.uid == cid) then
            if(isInArray(alcoholDrinks, item.type)) then
                if(not doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)) then
                    return false
                end

                doCreatureSay(cid, "Aaah...", TALKTYPE_MONSTER)
            elseif(isInArray(poisonDrinks, item.type)) then
                if(not doTargetCombatCondition(0, cid, poison, CONST_ME_NONE)) then
                    return false
                end

                doCreatureSay(cid, "Urgh!", TALKTYPE_MONSTER)
            elseif(item.type == TYPE_LAVA) then
                if(not doTargetCombatCondition(0, cid, burn, CONST_ME_NONE)) then
                    return false
                end

                doCreatureSay(cid, "Urgh!", TALKTYPE_MONSTER)
            else
                doCreatureSay(cid, "Gulp.", TALKTYPE_MONSTER)
            end
        else
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            return true
        end

        doChangeTypeItem(item.uid, TYPE_EMPTY)
        return true
    end

    if(not isCreature(itemEx.uid)) then
        if(item.type == TYPE_EMPTY) then
            if(item.itemid == ITEM_RUM_FLASK) then
                local tmp = distillery[itemEx.itemid]
                if(tmp ~= nil) then
                    doTransformItem(itemEx.uid, tmp)
                    doChangeTypeItem(item.uid, TYPE_RUM)
                else
                    doPlayerSendCancel(cid, "You have to process the bunch into the distillery to get rum.")
                end

                return true
            end

            if(isItemFluidContainer(itemEx.itemid) and itemEx.type ~= TYPE_EMPTY) then
                doChangeTypeItem(item.uid, itemEx.type)
                doChangeTypeItem(itemEx.uid, TYPE_EMPTY)
                return true
            end

            local tmp = casks[itemEx.itemid]
            if(tmp == nil) then
                tmp = getFluidSourceType(itemEx.itemid)
            end

            if(tmp) then
                doChangeTypeItem(item.uid, tmp)
                return true
            end

            doPlayerSendCancel(cid, "It is empty.")
            return true
        end

        local tmp = oilLamps[itemEx.itemid]
        if(item.type == TYPE_OIL and tmp ~= nil) then
            doTransformItem(itemEx.uid, tmp)
            doChangeTypeItem(item.uid, TYPE_NONE)
            return true
        end

        if(isItemFluidContainer(itemEx.itemid) and itemEx.type == TYPE_EMPTY) then
            doChangeTypeItem(itemEx.uid, item.type)
            doChangeTypeItem(item.uid, TYPE_EMPTY)
            return true
        end

        if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
            return false
        end
    end

    doDecayItem(doCreateItem(POOL, item.type, toPosition))
    doChangeTypeItem(item.uid, TYPE_EMPTY)
    return true
end

Here is all the different things I can think of for you to test.

I want you to try as many things as you can.
Bucket, trough, empty vials.
Empty, water, beer, poison, lava, oil.

Code:
Using a full container.. from Ground on a wall.
Using a full container.. from Ground on a fluid source. (like a well or a cask)
Using a full container.. from Ground to ground.
Using a full container.. from Ground to empty container on ground.
Using a full container.. from Ground to full container on ground.
Using a full container.. from Ground to empty space in backpack.
Using a full container.. from Ground to empty container in backpack.
Using a full container.. from Ground to full container in backpack.
Using a full container.. from Ground on self.
Using a full container.. from Ground on self with empty container underneath.
Using a full container.. from Ground on self with full container underneath.
Using a full container.. from Ground to player.
Using a full container.. from Ground to player with empty container underneath.
Using a full container.. from Ground to player with full container underneath.
Using a full container.. from Ground to npc.
Using a full container.. from Ground to npc with empty container underneath.
Using a full container.. from Ground to npc with full container underneath.
Using a full container.. from Ground to monster.
Using a full container.. from Ground to monster with empty container underneath.
Using a full container.. from Ground to monster with full container underneath.

Using a full container.. from Backpack on a wall.
Using a full container.. from Backpack on a fluid source. (like a well or a cask)
Using a full container.. from Backpack to ground.
Using a full container.. from Backpack to empty container on ground.
Using a full container.. from Backpack to full container on ground.
Using a full container.. from Backpack to empty space in backpack.
Using a full container.. from Backpack to empty container in backpack.
Using a full container.. from Backpack to full container in backpack.
Using a full container.. from Backpack on self.
Using a full container.. from Backpack on self with empty container underneath.
Using a full container.. from Backpack on self with full container underneath.
Using a full container.. from Backpack to player.
Using a full container.. from Backpack to player with empty container underneath.
Using a full container.. from Backpack to player with full container underneath.
Using a full container.. from Backpack to npc.
Using a full container.. from Backpack to npc with empty container underneath.
Using a full container.. from Backpack to npc with full container underneath.
Using a full container.. from Backpack to monster.
Using a full container.. from Backpack to monster with empty container underneath.
Using a full container.. from Backpack to monster with full container underneath.

Using an empty container.. from Ground on a wall.
Using an empty container.. from Ground on a fluid source. (like a well or a cask)
Using an empty container.. from Ground to ground.
Using an empty container.. from Ground to empty container on ground.
Using an empty container.. from Ground to full container on ground.
Using an empty container.. from Ground to empty space in backpack.
Using an empty container.. from Ground to empty container in backpack.
Using an empty container.. from Ground to full container in backpack.
Using an empty container.. from Ground on self.
Using an empty container.. from Ground on self with empty container underneath.
Using an empty container.. from Ground on self with full container underneath.
Using an empty container.. from Ground to player.
Using an empty container.. from Ground to player with empty container underneath.
Using an empty container.. from Ground to player with full container underneath.
Using an empty container.. from Ground to npc.
Using an empty container.. from Ground to npc with empty container underneath.
Using an empty container.. from Ground to npc with full container underneath.
Using an empty container.. from Ground to monster.
Using an empty container.. from Ground to monster with empty container underneath.
Using an empty container.. from Ground to monster with full container underneath.

Using an empty container.. from Backpack on a wall.
Using an empty container.. from Backpack on a fluid source. (like a well or a cask)
Using an empty container.. from Backpack to ground.
Using an empty container.. from Backpack to empty container on ground.
Using an empty container.. from Backpack to full container on ground.
Using an empty container.. from Backpack to empty space in backpack.
Using an empty container.. from Backpack to empty container in backpack.
Using an empty container.. from Backpack to full container in backpack.
Using an empty container.. from Backpack on self.
Using an empty container.. from Backpack on self with empty container underneath.
Using an empty container.. from Backpack on self with full container underneath.
Using an empty container.. from Backpack to player.
Using an empty container.. from Backpack to player with empty container underneath.
Using an empty container.. from Backpack to player with full container underneath.
Using an empty container.. from Backpack to npc.
Using an empty container.. from Backpack to npc with empty container underneath.
Using an empty container.. from Backpack to npc with full container underneath.
Using an empty container.. from Backpack to monster.
Using an empty container.. from Backpack to monster with empty container underneath.
Using an empty container.. from Backpack to monster with full container underneath.

If you are still getting errors with the ABOVE script..
If possible, I'd like for you to try every combination above using the script BELOW.

Do not be discouraged if the error is contantly the same, or even if a new error pops up!
The more information you provide, the more we can narrow down the exact issue (or issues!)
And once we know what those issues are, we can start fixing them.

I'll need you to tell me exactly what you are trying to do in-game when you are getting the error(s).
And!
I need you to tell me what prints to your console.

Example;

Code:
Container used: Bucket
item_id: 2005
fluid: None.
usage: Using an empty container.. from Ground to ground.
Prints: 1, 2, 4, 21, 42
What happens?
Gives error:
[03/09/2018 21:58:55] [Error - Action Interface]
[03/09/2018 21:58:55] data/actions/scripts/liquids/containers.lua:onUse
[03/09/2018 21:58:55] Description:
[03/09/2018 21:58:55] (luaDoDecayItem) Item not found

Example 2;

Code:
Container used: trough
item_id: 1775
fluid: water
usage: Using a full container.. from Ground to empty space in backpack.
Prints: 1, 22, 23, 24, 25, 26, 28
What happens? : Throws liquid on ground.
Is this the expected result? : Yes
(if no, what should be happening?)

Script to test with;
(I'm using more prints then is normally necessary because I don't want you to have to test this twice, if at all possible.)
Lua:
local ITEM_RUM_FLASK = 5553

local TYPE_EMPTY = 0
local TYPE_WATER = 1
local TYPE_BLOOD = 2
local TYPE_BEER = 3
local TYPE_SLIME = 4
local TYPE_LEMONADE = 5
local TYPE_MILK = 6
local TYPE_MANA_FLUID = 7
local TYPE_LIFE_FLUID = 10
local TYPE_OIL = 11
local TYPE_URINE = 13
local TYPE_COCONUT_MILK = 14
local TYPE_WINE = 15
local TYPE_MUD = 19
local TYPE_FRUIT_JUICE = 21
local TYPE_LAVA = 26
local TYPE_RUM = 27
local TYPE_SWAMP = 28
local TYPE_TEA = 35

local distillery = {[5513] = 5469, [5514] = 5470}
local oilLamps = {[2046] = 2044}
local casks = {[1771] = TYPE_WATER, [1369] = TYPE_WATER, [1368] = TYPE_WATER, [1772] = TYPE_BEER, [1773] = TYPE_WINE}
local alcoholDrinks = {TYPE_BEER, TYPE_WINE, TYPE_RUM}
local poisonDrinks = {TYPE_SLIME, TYPE_SWAMP}

local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 60000)

local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, true) -- Condition will delay the first damage from when it's added
setConditionParam(poison, CONDITION_PARAM_MINVALUE, -50) -- Minimum damage the condition can do at total
setConditionParam(poison, CONDITION_PARAM_MAXVALUE, -120) -- Maximum damage
setConditionParam(poison, CONDITION_PARAM_STARTVALUE, -5) -- The damage the condition will do on the first hit
setConditionParam(poison, CONDITION_PARAM_TICKINTERVAL, 4000) -- Delay between damages
setConditionParam(poison, CONDITION_PARAM_FORCEUPDATE, true) -- Re-update condition when adding it(ie. min/max value)

local burn = createConditionObject(CONDITION_FIRE)
setConditionParam(burn, CONDITION_PARAM_DELAYED, true) -- Condition will delay the first damage from when it's added
setConditionParam(burn, CONDITION_PARAM_MINVALUE, -70) -- Minimum damage the condition can do at total
setConditionParam(burn, CONDITION_PARAM_MAXVALUE, -150) -- Maximum damage
setConditionParam(burn, CONDITION_PARAM_STARTVALUE, -10) -- The damage the condition will do on the first hit
setConditionParam(burn, CONDITION_PARAM_TICKINTERVAL, 10000) -- Delay between damages
setConditionParam(burn, CONDITION_PARAM_FORCEUPDATE, true) -- Re-update condition when adding it(ie. min/max value)

function onUse(cid, item, fromPosition, itemEx, toPosition)
    print(1)
    if(isPlayer(itemEx.uid)) then
        print(2)
        if(item.type == TYPE_EMPTY) then
            print(3)
            doPlayerSendCancel(cid, "It is empty.")
            return true
        end
        print(4)
        if(item.type == TYPE_MANA_FLUID) then
            print(5)
            if(not doPlayerAddMana(itemEx.uid, math.random(80, 160))) then
                print(6)
                return false
            end
            print(7)
            doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_MONSTER)
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
            print(8)
        elseif(item.type == TYPE_LIFE_FLUID) then
            print(9)
            if(not doCreatureAddHealth(itemEx.uid, math.random(40, 75))) then\
                print(10)
                return false
            end
            print(11)
            doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_MONSTER)
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
            print(12)
        elseif(itemEx.uid == cid) then
            print(13)
            if(isInArray(alcoholDrinks, item.type)) then
                print(14)
                if(not doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)) then
                    print(15)
                    return false
                end
                print(16)
                doCreatureSay(cid, "Aaah...", TALKTYPE_MONSTER)
                print(17)
            elseif(isInArray(poisonDrinks, item.type)) then
                print(18)
                if(not doTargetCombatCondition(0, cid, poison, CONST_ME_NONE)) then
                    print(19)
                    return false
                end
                print(20)
                doCreatureSay(cid, "Urgh!", TALKTYPE_MONSTER)
                print(21)
            elseif(item.type == TYPE_LAVA) then
                print(22)
                if(not doTargetCombatCondition(0, cid, burn, CONST_ME_NONE)) then
                    print(23)
                    return false
                end
                print(24)
                doCreatureSay(cid, "Urgh!", TALKTYPE_MONSTER)
                print(25) 
            else
                print(26)
                doCreatureSay(cid, "Gulp.", TALKTYPE_MONSTER)
                print(27)
            end
        else
            print(28)
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            print(29)
            return true
        end
        print(30)
        doChangeTypeItem(item.uid, TYPE_EMPTY)
        print(31)
        return true
    end
    print(32)
    if(not isCreature(itemEx.uid)) then
        print(33)
        if(item.type == TYPE_EMPTY) then
            print(34)
            if(item.itemid == ITEM_RUM_FLASK) then
                print(35)
                local tmp = distillery[itemEx.itemid]
                if(tmp ~= nil) then
                    print(36)
                    doTransformItem(itemEx.uid, tmp)
                    doChangeTypeItem(item.uid, TYPE_RUM)
                    print(37)
                else
                    print(38)
                    doPlayerSendCancel(cid, "You have to process the bunch into the distillery to get rum.")
                    print(39)
                end
                print(40)
                return true
            end
            print(41)
            if(isItemFluidContainer(itemEx.itemid) and itemEx.type ~= TYPE_EMPTY) then
                print(42)
                doChangeTypeItem(item.uid, itemEx.type)
                doChangeTypeItem(itemEx.uid, TYPE_EMPTY)
                print(43)
                return true
            end
            print(44)
            local tmp = casks[itemEx.itemid]
            if(tmp == nil) then
                print(45)
                tmp = getFluidSourceType(itemEx.itemid)
            end
            print(46)
            if(tmp) then
                print(47)
                doChangeTypeItem(item.uid, tmp)
                print(48)
                return true
            end
            print(49)
            doPlayerSendCancel(cid, "It is empty.")
            print(50)
            return true
        end
        print(51)
        local tmp = oilLamps[itemEx.itemid]
        if(item.type == TYPE_OIL and tmp ~= nil) then
            print(52)
            doTransformItem(itemEx.uid, tmp)
            doChangeTypeItem(item.uid, TYPE_NONE)
            print(53)
            return true
        end
        print(54)
        if(isItemFluidContainer(itemEx.itemid) and itemEx.type == TYPE_EMPTY) then
            print(55)
            doChangeTypeItem(itemEx.uid, item.type)
            doChangeTypeItem(item.uid, TYPE_EMPTY)
            print(56)
            return true
        end
        print(57)
        if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
            print(58)
            return false
        end
    end
    print(59)
    doDecayItem(doCreateItem(POOL, item.type, toPosition))
    doChangeTypeItem(item.uid, TYPE_EMPTY)
    print(60)
    return true
end

Well, hopefully there is no errors and your testing goes well.

If not, well we will cross that bridge when we get there. xP

Good luck!

Xikini
 
Last edited:
Alright, I want you to try this code.. (It's from TFS 0.3.7, and as far as I'm aware it is fully functional.)
Whether this code works or not, please post your TFS version.
Lua:
local ITEM_RUM_FLASK = 5553

local TYPE_EMPTY = 0
local TYPE_WATER = 1
local TYPE_BLOOD = 2
local TYPE_BEER = 3
local TYPE_SLIME = 4
local TYPE_LEMONADE = 5
local TYPE_MILK = 6
local TYPE_MANA_FLUID = 7
local TYPE_LIFE_FLUID = 10
local TYPE_OIL = 11
local TYPE_URINE = 13
local TYPE_COCONUT_MILK = 14
local TYPE_WINE = 15
local TYPE_MUD = 19
local TYPE_FRUIT_JUICE = 21
local TYPE_LAVA = 26
local TYPE_RUM = 27
local TYPE_SWAMP = 28
local TYPE_TEA = 35

local distillery = {[5513] = 5469, [5514] = 5470}
local oilLamps = {[2046] = 2044}
local casks = {[1771] = TYPE_WATER, [1369] = TYPE_WATER, [1368] = TYPE_WATER, [1772] = TYPE_BEER, [1773] = TYPE_WINE}
local alcoholDrinks = {TYPE_BEER, TYPE_WINE, TYPE_RUM}
local poisonDrinks = {TYPE_SLIME, TYPE_SWAMP}

local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 60000)

local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, true) -- Condition will delay the first damage from when it's added
setConditionParam(poison, CONDITION_PARAM_MINVALUE, -50) -- Minimum damage the condition can do at total
setConditionParam(poison, CONDITION_PARAM_MAXVALUE, -120) -- Maximum damage
setConditionParam(poison, CONDITION_PARAM_STARTVALUE, -5) -- The damage the condition will do on the first hit
setConditionParam(poison, CONDITION_PARAM_TICKINTERVAL, 4000) -- Delay between damages
setConditionParam(poison, CONDITION_PARAM_FORCEUPDATE, true) -- Re-update condition when adding it(ie. min/max value)

local burn = createConditionObject(CONDITION_FIRE)
setConditionParam(burn, CONDITION_PARAM_DELAYED, true) -- Condition will delay the first damage from when it's added
setConditionParam(burn, CONDITION_PARAM_MINVALUE, -70) -- Minimum damage the condition can do at total
setConditionParam(burn, CONDITION_PARAM_MAXVALUE, -150) -- Maximum damage
setConditionParam(burn, CONDITION_PARAM_STARTVALUE, -10) -- The damage the condition will do on the first hit
setConditionParam(burn, CONDITION_PARAM_TICKINTERVAL, 10000) -- Delay between damages
setConditionParam(burn, CONDITION_PARAM_FORCEUPDATE, true) -- Re-update condition when adding it(ie. min/max value)

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(isPlayer(itemEx.uid)) then
        if(item.type == TYPE_EMPTY) then
            doPlayerSendCancel(cid, "It is empty.")
            return true
        end

        if(item.type == TYPE_MANA_FLUID) then
            if(not doPlayerAddMana(itemEx.uid, math.random(80, 160))) then
                return false
            end

            doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_MONSTER)
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
        elseif(item.type == TYPE_LIFE_FLUID) then
            if(not doCreatureAddHealth(itemEx.uid, math.random(40, 75))) then
                return false
            end

            doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_MONSTER)
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
        elseif(itemEx.uid == cid) then
            if(isInArray(alcoholDrinks, item.type)) then
                if(not doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)) then
                    return false
                end

                doCreatureSay(cid, "Aaah...", TALKTYPE_MONSTER)
            elseif(isInArray(poisonDrinks, item.type)) then
                if(not doTargetCombatCondition(0, cid, poison, CONST_ME_NONE)) then
                    return false
                end

                doCreatureSay(cid, "Urgh!", TALKTYPE_MONSTER)
            elseif(item.type == TYPE_LAVA) then
                if(not doTargetCombatCondition(0, cid, burn, CONST_ME_NONE)) then
                    return false
                end

                doCreatureSay(cid, "Urgh!", TALKTYPE_MONSTER)
            else
                doCreatureSay(cid, "Gulp.", TALKTYPE_MONSTER)
            end
        else
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            return true
        end

        doChangeTypeItem(item.uid, TYPE_EMPTY)
        return true
    end

    if(not isCreature(itemEx.uid)) then
        if(item.type == TYPE_EMPTY) then
            if(item.itemid == ITEM_RUM_FLASK) then
                local tmp = distillery[itemEx.itemid]
                if(tmp ~= nil) then
                    doTransformItem(itemEx.uid, tmp)
                    doChangeTypeItem(item.uid, TYPE_RUM)
                else
                    doPlayerSendCancel(cid, "You have to process the bunch into the distillery to get rum.")
                end

                return true
            end

            if(isItemFluidContainer(itemEx.itemid) and itemEx.type ~= TYPE_EMPTY) then
                doChangeTypeItem(item.uid, itemEx.type)
                doChangeTypeItem(itemEx.uid, TYPE_EMPTY)
                return true
            end

            local tmp = casks[itemEx.itemid]
            if(tmp == nil) then
                tmp = getFluidSourceType(itemEx.itemid)
            end

            if(tmp) then
                doChangeTypeItem(item.uid, tmp)
                return true
            end

            doPlayerSendCancel(cid, "It is empty.")
            return true
        end

        local tmp = oilLamps[itemEx.itemid]
        if(item.type == TYPE_OIL and tmp ~= nil) then
            doTransformItem(itemEx.uid, tmp)
            doChangeTypeItem(item.uid, TYPE_NONE)
            return true
        end

        if(isItemFluidContainer(itemEx.itemid) and itemEx.type == TYPE_EMPTY) then
            doChangeTypeItem(itemEx.uid, item.type)
            doChangeTypeItem(item.uid, TYPE_EMPTY)
            return true
        end

        if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
            return false
        end
    end

    doDecayItem(doCreateItem(POOL, item.type, toPosition))
    doChangeTypeItem(item.uid, TYPE_EMPTY)
    return true
end

Here is all the different things I can think of for you to test.

I want you to try as many things as you can.
Bucket, trough, empty vials.
Empty, water, beer, poison, lava, oil.

Code:
Using a full container.. from Ground on a wall.
Using a full container.. from Ground on a fluid source. (like a well or a cask)
Using a full container.. from Ground to ground.
Using a full container.. from Ground to empty container on ground.
Using a full container.. from Ground to full container on ground.
Using a full container.. from Ground to empty space in backpack.
Using a full container.. from Ground to empty container in backpack.
Using a full container.. from Ground to full container in backpack.
Using a full container.. from Ground on self.
Using a full container.. from Ground on self with empty container underneath.
Using a full container.. from Ground on self with full container underneath.
Using a full container.. from Ground to player.
Using a full container.. from Ground to player with empty container underneath.
Using a full container.. from Ground to player with full container underneath.
Using a full container.. from Ground to npc.
Using a full container.. from Ground to npc with empty container underneath.
Using a full container.. from Ground to npc with full container underneath.
Using a full container.. from Ground to monster.
Using a full container.. from Ground to monster with empty container underneath.
Using a full container.. from Ground to monster with full container underneath.

Using a full container.. from Backpack on a wall.
Using a full container.. from Backpack on a fluid source. (like a well or a cask)
Using a full container.. from Backpack to ground.
Using a full container.. from Backpack to empty container on ground.
Using a full container.. from Backpack to full container on ground.
Using a full container.. from Backpack to empty space in backpack.
Using a full container.. from Backpack to empty container in backpack.
Using a full container.. from Backpack to full container in backpack.
Using a full container.. from Backpack on self.
Using a full container.. from Backpack on self with empty container underneath.
Using a full container.. from Backpack on self with full container underneath.
Using a full container.. from Backpack to player.
Using a full container.. from Backpack to player with empty container underneath.
Using a full container.. from Backpack to player with full container underneath.
Using a full container.. from Backpack to npc.
Using a full container.. from Backpack to npc with empty container underneath.
Using a full container.. from Backpack to npc with full container underneath.
Using a full container.. from Backpack to monster.
Using a full container.. from Backpack to monster with empty container underneath.
Using a full container.. from Backpack to monster with full container underneath.

Using an empty container.. from Ground on a wall.
Using an empty container.. from Ground on a fluid source. (like a well or a cask)
Using an empty container.. from Ground to ground.
Using an empty container.. from Ground to empty container on ground.
Using an empty container.. from Ground to full container on ground.
Using an empty container.. from Ground to empty space in backpack.
Using an empty container.. from Ground to empty container in backpack.
Using an empty container.. from Ground to full container in backpack.
Using an empty container.. from Ground on self.
Using an empty container.. from Ground on self with empty container underneath.
Using an empty container.. from Ground on self with full container underneath.
Using an empty container.. from Ground to player.
Using an empty container.. from Ground to player with empty container underneath.
Using an empty container.. from Ground to player with full container underneath.
Using an empty container.. from Ground to npc.
Using an empty container.. from Ground to npc with empty container underneath.
Using an empty container.. from Ground to npc with full container underneath.
Using an empty container.. from Ground to monster.
Using an empty container.. from Ground to monster with empty container underneath.
Using an empty container.. from Ground to monster with full container underneath.

Using an empty container.. from Backpack on a wall.
Using an empty container.. from Backpack on a fluid source. (like a well or a cask)
Using an empty container.. from Backpack to ground.
Using an empty container.. from Backpack to empty container on ground.
Using an empty container.. from Backpack to full container on ground.
Using an empty container.. from Backpack to empty space in backpack.
Using an empty container.. from Backpack to empty container in backpack.
Using an empty container.. from Backpack to full container in backpack.
Using an empty container.. from Backpack on self.
Using an empty container.. from Backpack on self with empty container underneath.
Using an empty container.. from Backpack on self with full container underneath.
Using an empty container.. from Backpack to player.
Using an empty container.. from Backpack to player with empty container underneath.
Using an empty container.. from Backpack to player with full container underneath.
Using an empty container.. from Backpack to npc.
Using an empty container.. from Backpack to npc with empty container underneath.
Using an empty container.. from Backpack to npc with full container underneath.
Using an empty container.. from Backpack to monster.
Using an empty container.. from Backpack to monster with empty container underneath.
Using an empty container.. from Backpack to monster with full container underneath.

If you are still getting errors with the ABOVE script..
If possible, I'd like for you to try every combination above using the script BELOW.

Do not be discouraged if the error is contantly the same, or even if a new error pops up!
The more information you provide, the more we can narrow down the exact issue (or issues!)
And once we know what those issues are, we can start fixing them.

I'll need you to tell me exactly what you are trying to do in-game when you are getting the error(s).
And!
I need you to tell me what prints to your console.

Example;

Code:
Container used: Bucket
item_id: 2005
fluid: None.
usage: Using an empty container.. from Ground to ground.
Prints: 1, 2, 4, 21, 42
What happens?
Gives error:
[03/09/2018 21:58:55] [Error - Action Interface]
[03/09/2018 21:58:55] data/actions/scripts/liquids/containers.lua:onUse
[03/09/2018 21:58:55] Description:
[03/09/2018 21:58:55] (luaDoDecayItem) Item not found

Example 2;

Code:
Container used: trough
item_id: 1775
fluid: water
usage: Using a full container.. from Ground to empty space in backpack.
Prints: 1, 22, 23, 24, 25, 26, 28
What happens? : Throws liquid on ground.
Is this the expected result? : Yes
(if no, what should be happening?)

Script to test with;
(I'm using more prints then is normally necessary because I don't want you to have to test this twice, if at all possible.)
Lua:
local ITEM_RUM_FLASK = 5553

local TYPE_EMPTY = 0
local TYPE_WATER = 1
local TYPE_BLOOD = 2
local TYPE_BEER = 3
local TYPE_SLIME = 4
local TYPE_LEMONADE = 5
local TYPE_MILK = 6
local TYPE_MANA_FLUID = 7
local TYPE_LIFE_FLUID = 10
local TYPE_OIL = 11
local TYPE_URINE = 13
local TYPE_COCONUT_MILK = 14
local TYPE_WINE = 15
local TYPE_MUD = 19
local TYPE_FRUIT_JUICE = 21
local TYPE_LAVA = 26
local TYPE_RUM = 27
local TYPE_SWAMP = 28
local TYPE_TEA = 35

local distillery = {[5513] = 5469, [5514] = 5470}
local oilLamps = {[2046] = 2044}
local casks = {[1771] = TYPE_WATER, [1369] = TYPE_WATER, [1368] = TYPE_WATER, [1772] = TYPE_BEER, [1773] = TYPE_WINE}
local alcoholDrinks = {TYPE_BEER, TYPE_WINE, TYPE_RUM}
local poisonDrinks = {TYPE_SLIME, TYPE_SWAMP}

local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 60000)

local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, true) -- Condition will delay the first damage from when it's added
setConditionParam(poison, CONDITION_PARAM_MINVALUE, -50) -- Minimum damage the condition can do at total
setConditionParam(poison, CONDITION_PARAM_MAXVALUE, -120) -- Maximum damage
setConditionParam(poison, CONDITION_PARAM_STARTVALUE, -5) -- The damage the condition will do on the first hit
setConditionParam(poison, CONDITION_PARAM_TICKINTERVAL, 4000) -- Delay between damages
setConditionParam(poison, CONDITION_PARAM_FORCEUPDATE, true) -- Re-update condition when adding it(ie. min/max value)

local burn = createConditionObject(CONDITION_FIRE)
setConditionParam(burn, CONDITION_PARAM_DELAYED, true) -- Condition will delay the first damage from when it's added
setConditionParam(burn, CONDITION_PARAM_MINVALUE, -70) -- Minimum damage the condition can do at total
setConditionParam(burn, CONDITION_PARAM_MAXVALUE, -150) -- Maximum damage
setConditionParam(burn, CONDITION_PARAM_STARTVALUE, -10) -- The damage the condition will do on the first hit
setConditionParam(burn, CONDITION_PARAM_TICKINTERVAL, 10000) -- Delay between damages
setConditionParam(burn, CONDITION_PARAM_FORCEUPDATE, true) -- Re-update condition when adding it(ie. min/max value)

function onUse(cid, item, fromPosition, itemEx, toPosition)
    print(1)
    if(isPlayer(itemEx.uid)) then
        print(2)
        if(item.type == TYPE_EMPTY) then
            print(3)
            doPlayerSendCancel(cid, "It is empty.")
            return true
        end
        print(4)
        if(item.type == TYPE_MANA_FLUID) then
            print(5)
            if(not doPlayerAddMana(itemEx.uid, math.random(80, 160))) then
                print(6)
                return false
            end
            print(7)
            doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_MONSTER)
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
            print(8)
        elseif(item.type == TYPE_LIFE_FLUID) then
            print(9)
            if(not doCreatureAddHealth(itemEx.uid, math.random(40, 75))) then\
                print(10)
                return false
            end
            print(11)
            doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_MONSTER)
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
            print(12)
        elseif(itemEx.uid == cid) then
            print(13)
            if(isInArray(alcoholDrinks, item.type)) then
                print(14)
                if(not doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)) then
                    print(15)
                    return false
                end
                print(16)
                doCreatureSay(cid, "Aaah...", TALKTYPE_MONSTER)
                print(17)
            elseif(isInArray(poisonDrinks, item.type)) then
                print(18)
                if(not doTargetCombatCondition(0, cid, poison, CONST_ME_NONE)) then
                    print(19)
                    return false
                end
                print(20)
                doCreatureSay(cid, "Urgh!", TALKTYPE_MONSTER)
                print(21)
            elseif(item.type == TYPE_LAVA) then
                print(22)
                if(not doTargetCombatCondition(0, cid, burn, CONST_ME_NONE)) then
                    print(23)
                    return false
                end
                print(24)
                doCreatureSay(cid, "Urgh!", TALKTYPE_MONSTER)
                print(25)
            else
                print(26)
                doCreatureSay(cid, "Gulp.", TALKTYPE_MONSTER)
                print(27)
            end
        else
            print(28)
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            print(29)
            return true
        end
        print(30)
        doChangeTypeItem(item.uid, TYPE_EMPTY)
        print(31)
        return true
    end
    print(32)
    if(not isCreature(itemEx.uid)) then
        print(33)
        if(item.type == TYPE_EMPTY) then
            print(34)
            if(item.itemid == ITEM_RUM_FLASK) then
                print(35)
                local tmp = distillery[itemEx.itemid]
                if(tmp ~= nil) then
                    print(36)
                    doTransformItem(itemEx.uid, tmp)
                    doChangeTypeItem(item.uid, TYPE_RUM)
                    print(37)
                else
                    print(38)
                    doPlayerSendCancel(cid, "You have to process the bunch into the distillery to get rum.")
                    print(39)
                end
                print(40)
                return true
            end
            print(41)
            if(isItemFluidContainer(itemEx.itemid) and itemEx.type ~= TYPE_EMPTY) then
                print(42)
                doChangeTypeItem(item.uid, itemEx.type)
                doChangeTypeItem(itemEx.uid, TYPE_EMPTY)
                print(43)
                return true
            end
            print(44)
            local tmp = casks[itemEx.itemid]
            if(tmp == nil) then
                print(45)
                tmp = getFluidSourceType(itemEx.itemid)
            end
            print(46)
            if(tmp) then
                print(47)
                doChangeTypeItem(item.uid, tmp)
                print(48)
                return true
            end
            print(49)
            doPlayerSendCancel(cid, "It is empty.")
            print(50)
            return true
        end
        print(51)
        local tmp = oilLamps[itemEx.itemid]
        if(item.type == TYPE_OIL and tmp ~= nil) then
            print(52)
            doTransformItem(itemEx.uid, tmp)
            doChangeTypeItem(item.uid, TYPE_NONE)
            print(53)
            return true
        end
        print(54)
        if(isItemFluidContainer(itemEx.itemid) and itemEx.type == TYPE_EMPTY) then
            print(55)
            doChangeTypeItem(itemEx.uid, item.type)
            doChangeTypeItem(item.uid, TYPE_EMPTY)
            print(56)
            return true
        end
        print(57)
        if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
            print(58)
            return false
        end
    end
    print(59)
    doDecayItem(doCreateItem(POOL, item.type, toPosition))
    doChangeTypeItem(item.uid, TYPE_EMPTY)
    print(60)
    return true
end

Well, hopefully there is no errors and your testing goes well.

If not, well we will cross that bridge when we get there. xP

Good luck!

Xikini

Here! Need more tests? I gess I haven't did everyting what you said.

I'm using my own script!
 

Here! Need more tests? I gess I haven't did everyting what you said.

I'm using my own script!
u12MNN9.png


-----------
Can't see the video.
 

Using your script now <3
HEEELP MEEE :'(
I really want to help, but you need to use the correct script when you are testing, otherwise I don't know what is happening when you test something.
This is a large script with multiple multiple things that can happen.
Sure, I could go through the video and slowly re-read through the script each time, and GUESS what the script is doing, but that is going to be extremely time consuming, and I could miss the actual issue.
Read my post properly, put in the work required, and I can probably fix the issue.
If you can't do that, don't bother tagging me to come back.
If you are still getting errors with the ABOVE script..
If possible, I'd like for you to try every combination above using the script BELOW.

Do not be discouraged if the error is contantly the same, or even if a new error pops up!
The more information you provide, the more we can narrow down the exact issue (or issues!)
And once we know what those issues are, we can start fixing them.

I'll need you to tell me exactly what you are trying to do in-game when you are getting the error(s).
And!
I need you to tell me what prints to your console.

Example;

Code:
Container used: Bucket
item_id: 2005
fluid: None.
usage: Using an empty container.. from Ground to ground.
Prints: 1, 2, 4, 21, 42
What happens?
Gives error:
[03/09/2018 21:58:55] [Error - Action Interface]
[03/09/2018 21:58:55] data/actions/scripts/liquids/containers.lua:onUse
[03/09/2018 21:58:55] Description:
[03/09/2018 21:58:55] (luaDoDecayItem) Item not found

Example 2;

Code:
Container used: trough
item_id: 1775
fluid: water
usage: Using a full container.. from Ground to empty space in backpack.
Prints: 1, 22, 23, 24, 25, 26, 28
What happens? : Throws liquid on ground.
Is this the expected result? : Yes
(if no, what should be happening?)

Script to test with;
(I'm using more prints then is normally necessary because I don't want you to have to test this twice, if at all possible.)
Lua:
local ITEM_RUM_FLASK = 5553

local TYPE_EMPTY = 0
local TYPE_WATER = 1
local TYPE_BLOOD = 2
local TYPE_BEER = 3
local TYPE_SLIME = 4
local TYPE_LEMONADE = 5
local TYPE_MILK = 6
local TYPE_MANA_FLUID = 7
local TYPE_LIFE_FLUID = 10
local TYPE_OIL = 11
local TYPE_URINE = 13
local TYPE_COCONUT_MILK = 14
local TYPE_WINE = 15
local TYPE_MUD = 19
local TYPE_FRUIT_JUICE = 21
local TYPE_LAVA = 26
local TYPE_RUM = 27
local TYPE_SWAMP = 28
local TYPE_TEA = 35

local distillery = {[5513] = 5469, [5514] = 5470}
local oilLamps = {[2046] = 2044}
local casks = {[1771] = TYPE_WATER, [1369] = TYPE_WATER, [1368] = TYPE_WATER, [1772] = TYPE_BEER, [1773] = TYPE_WINE}
local alcoholDrinks = {TYPE_BEER, TYPE_WINE, TYPE_RUM}
local poisonDrinks = {TYPE_SLIME, TYPE_SWAMP}

local drunk = createConditionObject(CONDITION_DRUNK)
setConditionParam(drunk, CONDITION_PARAM_TICKS, 60000)

local poison = createConditionObject(CONDITION_POISON)
setConditionParam(poison, CONDITION_PARAM_DELAYED, true) -- Condition will delay the first damage from when it's added
setConditionParam(poison, CONDITION_PARAM_MINVALUE, -50) -- Minimum damage the condition can do at total
setConditionParam(poison, CONDITION_PARAM_MAXVALUE, -120) -- Maximum damage
setConditionParam(poison, CONDITION_PARAM_STARTVALUE, -5) -- The damage the condition will do on the first hit
setConditionParam(poison, CONDITION_PARAM_TICKINTERVAL, 4000) -- Delay between damages
setConditionParam(poison, CONDITION_PARAM_FORCEUPDATE, true) -- Re-update condition when adding it(ie. min/max value)

local burn = createConditionObject(CONDITION_FIRE)
setConditionParam(burn, CONDITION_PARAM_DELAYED, true) -- Condition will delay the first damage from when it's added
setConditionParam(burn, CONDITION_PARAM_MINVALUE, -70) -- Minimum damage the condition can do at total
setConditionParam(burn, CONDITION_PARAM_MAXVALUE, -150) -- Maximum damage
setConditionParam(burn, CONDITION_PARAM_STARTVALUE, -10) -- The damage the condition will do on the first hit
setConditionParam(burn, CONDITION_PARAM_TICKINTERVAL, 10000) -- Delay between damages
setConditionParam(burn, CONDITION_PARAM_FORCEUPDATE, true) -- Re-update condition when adding it(ie. min/max value)

function onUse(cid, item, fromPosition, itemEx, toPosition)
    print(1)
    if(isPlayer(itemEx.uid)) then
        print(2)
        if(item.type == TYPE_EMPTY) then
            print(3)
            doPlayerSendCancel(cid, "It is empty.")
            return true
        end
        print(4)
        if(item.type == TYPE_MANA_FLUID) then
            print(5)
            if(not doPlayerAddMana(itemEx.uid, math.random(80, 160))) then
                print(6)
                return false
            end
            print(7)
            doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_MONSTER)
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
            print(8)
        elseif(item.type == TYPE_LIFE_FLUID) then
            print(9)
            if(not doCreatureAddHealth(itemEx.uid, math.random(40, 75))) then\
                print(10)
                return false
            end
            print(11)
            doCreatureSay(itemEx.uid, "Aaaah...", TALKTYPE_MONSTER)
            doSendMagicEffect(toPosition, CONST_ME_MAGIC_BLUE)
            print(12)
        elseif(itemEx.uid == cid) then
            print(13)
            if(isInArray(alcoholDrinks, item.type)) then
                print(14)
                if(not doTargetCombatCondition(0, cid, drunk, CONST_ME_NONE)) then
                    print(15)
                    return false
                end
                print(16)
                doCreatureSay(cid, "Aaah...", TALKTYPE_MONSTER)
                print(17)
            elseif(isInArray(poisonDrinks, item.type)) then
                print(18)
                if(not doTargetCombatCondition(0, cid, poison, CONST_ME_NONE)) then
                    print(19)
                    return false
                end
                print(20)
                doCreatureSay(cid, "Urgh!", TALKTYPE_MONSTER)
                print(21)
            elseif(item.type == TYPE_LAVA) then
                print(22)
                if(not doTargetCombatCondition(0, cid, burn, CONST_ME_NONE)) then
                    print(23)
                    return false
                end
                print(24)
                doCreatureSay(cid, "Urgh!", TALKTYPE_MONSTER)
                print(25)
            else
                print(26)
                doCreatureSay(cid, "Gulp.", TALKTYPE_MONSTER)
                print(27)
            end
        else
            print(28)
            doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
            print(29)
            return true
        end
        print(30)
        doChangeTypeItem(item.uid, TYPE_EMPTY)
        print(31)
        return true
    end
    print(32)
    if(not isCreature(itemEx.uid)) then
        print(33)
        if(item.type == TYPE_EMPTY) then
            print(34)
            if(item.itemid == ITEM_RUM_FLASK) then
                print(35)
                local tmp = distillery[itemEx.itemid]
                if(tmp ~= nil) then
                    print(36)
                    doTransformItem(itemEx.uid, tmp)
                    doChangeTypeItem(item.uid, TYPE_RUM)
                    print(37)
                else
                    print(38)
                    doPlayerSendCancel(cid, "You have to process the bunch into the distillery to get rum.")
                    print(39)
                end
                print(40)
                return true
            end
            print(41)
            if(isItemFluidContainer(itemEx.itemid) and itemEx.type ~= TYPE_EMPTY) then
                print(42)
                doChangeTypeItem(item.uid, itemEx.type)
                doChangeTypeItem(itemEx.uid, TYPE_EMPTY)
                print(43)
                return true
            end
            print(44)
            local tmp = casks[itemEx.itemid]
            if(tmp == nil) then
                print(45)
                tmp = getFluidSourceType(itemEx.itemid)
            end
            print(46)
            if(tmp) then
                print(47)
                doChangeTypeItem(item.uid, tmp)
                print(48)
                return true
            end
            print(49)
            doPlayerSendCancel(cid, "It is empty.")
            print(50)
            return true
        end
        print(51)
        local tmp = oilLamps[itemEx.itemid]
        if(item.type == TYPE_OIL and tmp ~= nil) then
            print(52)
            doTransformItem(itemEx.uid, tmp)
            doChangeTypeItem(item.uid, TYPE_NONE)
            print(53)
            return true
        end
        print(54)
        if(isItemFluidContainer(itemEx.itemid) and itemEx.type == TYPE_EMPTY) then
            print(55)
            doChangeTypeItem(itemEx.uid, item.type)
            doChangeTypeItem(item.uid, TYPE_EMPTY)
            print(56)
            return true
        end
        print(57)
        if(hasProperty(itemEx.uid, CONST_PROP_BLOCKSOLID)) then
            print(58)
            return false
        end
    end
    print(59)
    doDecayItem(doCreateItem(POOL, item.type, toPosition))
    doChangeTypeItem(item.uid, TYPE_EMPTY)
    print(60)
    return true
end

Well, hopefully there is no errors and your testing goes well.

If not, well we will cross that bridge when we get there. xP

Good luck!

Xikini
 
Last edited:
Back
Top