Object can not be placed into a container

Support for running, installing or compiling OpenMW

Before you submit a bug report for the first time, please read: Bug reporting guidelines
mym
Posts: 47
Joined: 09 Feb 2015, 13:31
Gitlab profile: https://gitlab.com/mym34

Object can not be placed into a container

Post by mym »

Hi,

One of my mods won't initialize, openmw.log says:

Execution of script farrp_performll_scr failed:
Object of type N3ESM11ItemLevListE can not be placed into a container

I've opened a bug and attached the pluggin : https://bugs.openmw.org/issues/2404

How could I fix it please ?
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

Re: Object can not be placed into a container

Post by sjek »

startscript "farrp_performll_scr" in the console gives

Execution of script farrp_performll_scr failed:
Object of type struct ESM::ItemLevList can not be placed into a container

viewtopic.php?f=2&t=2635&p=30036
the leveled lists are overwriting each others as of esm file structure.

from where are you initializing that script .?

fargoth didn't wield a shortsword when hit or found one on when died.

https://github.com/OpenMW/openmw/blob/m ... e.cpp#L565
can you specify type of your leveled list somehow ?
mym
Posts: 47
Joined: 09 Feb 2015, 13:31
Gitlab profile: https://gitlab.com/mym34

Re: Object can not be placed into a container

Post by mym »

Hi,
I'm back on that issue. I don't know how to proceed to solve it.

I used MWEdit to edit the plugin, have a look at the concerned script but I don't know how to track down the problem.

Compiling the script works fine.
From Windows, I started a new game to trigger the script and then had a look at Warnings.txt. Then I deactivated the script and ran Morrowind again.

With the plugin activated I have the following lines added to Warnings.txt:

Code: Select all

Not able to find Ankle part in rt_pants_MW32_a.
Not able to find Knee part in rt_pants_MW32_k.
Not able to find Upper Leg part in rt_pants_MW32_ul.
Not able to find Ankle part in emc_rt_p_br_21_a.
Not able to find Knee part in emc_rt_p_br_21_k.
Not able to find Upper Leg part in emc_rt_p_br_21_ul.
Can it be related to the bug?
What can I do please?
mym
Posts: 47
Joined: 09 Feb 2015, 13:31
Gitlab profile: https://gitlab.com/mym34

Re: Object can not be placed into a container

Post by mym »

Additional infos:
- the script is launched when the player exits the Census and Excise Office
- openmw's log doesn't give reference to any object ID so I don't know what to search
- the script is a list of instructions that add items to NPCs:

Code: Select all

Begin farrp_PerformLL_scr
    set farrp_PerformLL_once to 1
    [...]
    "Marilia Saram"->additem "farrp_Long_NPC" 1
    "relyn sarano"->additem "farrp_Long_NPC" 1
    "breyns randas"->additem "farrp_Short_NPC" 1
    "nels llendo"->additem "farrp_Short_NPC" 1
    "sarvur sadri"->additem "farrp_Axe_NPC" 1
    "filbeneth"->additem "farrp_Blunt_NPC" 1
    "minisun ulirbabi"->additem "farrp_Long_NPC" 1
    [...]
    MessageBox "Weapon Compilation Mod:: 470+ NPCs (and skeletons) now carry new leveled weapons"
    StopScript "farrp_PerformLL_scr"
END
- when playing on Windows, for some of thoose NPCs, when I loot their corpse, the farrp's item that should be there is replaced with an "error icon" (with a red crossed circle) and the name displayed is the object ID (eg. "farrp_Short_NPC")
mym
Posts: 47
Joined: 09 Feb 2015, 13:31
Gitlab profile: https://gitlab.com/mym34

Re: Object can not be placed into a container

Post by mym »

sjek wrote:from where are you initializing that script .?
When the player exits the Census and Excise Office. The script is attached to the exit door.
sjek wrote:can you specify type of your leveled list somehow ?
Sorry, I'm don't really understand the question.
dteviot
Posts: 144
Joined: 17 Dec 2014, 20:29

Re: Object can not be placed into a container

Post by dteviot »

From what I can glancing at this thread, your script adds a Levelled item list to a number of NPCs.
e.g.

Code: Select all

    "relyn sarano"->additem "farrp_Long_NPC" 1
    "breyns randas"->additem "farrp_Short_NPC" 1
I assume farrp_Long_NPC, and farrp_Short_NPC are levelled item lists.
The https://github.com/OpenMW/openmw/blob/m ... e.cpp#L565 link Sjek gave is the code that covers adding items to a container. (In this case, each NPC is a "container") The code appears to not allow adding a levelled list to a container.

Here's the code

Code: Select all

int MWWorld::ContainerStore::getType (const Ptr& ptr)
{
    if (ptr.isEmpty())
        throw std::runtime_error ("can't put a non-existent object into a container");

    if (ptr.getTypeName()==typeid (ESM::Potion).name())
        return Type_Potion;

    if (ptr.getTypeName()==typeid (ESM::Apparatus).name())
        return Type_Apparatus;

    if (ptr.getTypeName()==typeid (ESM::Armor).name())
        return Type_Armor;

    if (ptr.getTypeName()==typeid (ESM::Book).name())
        return Type_Book;

    if (ptr.getTypeName()==typeid (ESM::Clothing).name())
        return Type_Clothing;

    if (ptr.getTypeName()==typeid (ESM::Ingredient).name())
        return Type_Ingredient;

    if (ptr.getTypeName()==typeid (ESM::Light).name())
        return Type_Light;

    if (ptr.getTypeName()==typeid (ESM::Lockpick).name())
        return Type_Lockpick;

    if (ptr.getTypeName()==typeid (ESM::Miscellaneous).name())
        return Type_Miscellaneous;

    if (ptr.getTypeName()==typeid (ESM::Probe).name())
        return Type_Probe;

    if (ptr.getTypeName()==typeid (ESM::Repair).name())
        return Type_Repair;

    if (ptr.getTypeName()==typeid (ESM::Weapon).name())
        return Type_Weapon;

    throw std::runtime_error (
        "Object of type " + ptr.getTypeName() + " can not be placed into a container");
}
At this point, it's looking like it may be a bug in OpenMW to me.
The bug being:

OpenMW does not allow scripts to add Levelled Item Lists to NPCs.

Can you produce a simplified script (say, that just changes one NPC) and a use case that demonstrates that it works for Vanilla and not for OpenMW?
Thanks.
mym
Posts: 47
Joined: 09 Feb 2015, 13:31
Gitlab profile: https://gitlab.com/mym34

Re: Object can not be placed into a container

Post by mym »

Thanks dteviot for your feedback.
Your hypothesis makes sense.

I did what you suggest: I removed all "additem" lines except one, the one with "Tanisie Verethi", the first thief found in "addamasartus" cave.
OpenMW produces the same log error. Tested on version 35.1 (debian package).
Vanilla Morrowind works fine: I killed that thief and found an "Iron Wheel" on her, which is a weapon from that mod.

I've attached the modified plugin. The whole original mod can be downloaded here: http://morrowind4kids.com/pseronwyrd/fi ... ion%20Mod/
Attachments
farrp_WeaponCompilationMod_V2.esp.gz
(62.24 KiB) Downloaded 218 times
dteviot
Posts: 144
Joined: 17 Dec 2014, 20:29

Re: Object can not be placed into a container

Post by dteviot »

@scrawl
mym wrote:Thanks dteviot for your feedback.
Your hypothesis makes sense.

I did what you suggest: I removed all "additem" lines except one, the one with "Tanisie Verethi", the first thief found in "addamasartus" cave.
OpenMW produces the same log error. Tested on version 35.1 (debian package).
Vanilla Morrowind works fine: I killed that thief and found an "Iron Wheel" on her, which is a weapon from that mod.

I've attached the modified plugin. The whole original mod can be downloaded here: http://morrowind4kids.com/pseronwyrd/fi ... ion%20Mod/
@mym, I suggest you update #2404 in the bug tracker with the additional information and the stripped down plug-in.
It may also be worthwhile to drop scrawl a PM to see if he has any advice.
I'd be willing to look into this, but I've just volunteered to do some work in the launcher, and it may be some weeks before I get that done.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Object can not be placed into a container

Post by scrawl »

I have just tested this. Adding a levelled item at runtime does not seem to work correctly in vanilla, at least not when using the console. What is added instead is a useless item with a missing icon, instead of the list being evaluated.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: Object can not be placed into a container

Post by Zini »

Maybe an opportunity for a pre-1.0 improvement? We don't break compatibility if we make this work properly and it is fairly in line with other improvements we already made.
Locked