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

Re: Object can not be placed into a container

Post by mym »

scrawl wrote: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.
I did the same test and now I know why I sometimes had that same error icon.
My new conculsion is adding levelled item to NPCs seems to only work for indoor NPCs and only if they have not been loaded yet.

My new test cases are:
1.
- while outside in Seyda Neen, do a '"Tanisie Verethi"->additem "l_b_amulets" 20
- go to Addamasartus, kill her and check if she has some amulets
- she has amulets
2.
- go into Addamasartus, do a '"Tanisie Verethi"->additem "l_b_amulets" 20
- kill her and check if she has some amulets
- she has the error icon
3.
- go into Addamasartus, then go outside
- do a '"Tanisie Verethi"->additem "l_b_amulets" 20
- go back into the cave and kill her and check if she has some amulets
- she has the error icon

I also tried to add amulets to fargoth while in the boat, ie before going outside for the first time, but I still got the error icon.
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Object can not be placed into a container

Post by scrawl »

My new conculsion is adding levelled item to NPCs seems to only work for indoor NPCs and only if they have not been loaded yet.
That can't be done with OpenMW, because by the time the script reference to an NPC is resolved, the NPC has been loaded already. I suggest to implement the feature correctly for all cases or leave it unimplemented.
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 »

scrawl wrote:That can't be done with OpenMW, because by the time the script reference to an NPC is resolved, the NPC has been loaded already. I suggest to implement the feature correctly for all cases or leave it unimplemented.
I agree. I see no reason to implement this incoherent behavior. Of course I would love to see it implemented for all cases in OpenMW as it allows plugins to offer the player random loots from NPCs.
dteviot
Posts: 144
Joined: 17 Dec 2014, 20:29

Re: Object can not be placed into a container

Post by dteviot »

@mym
mym wrote:I agree. I see no reason to implement this incoherent behavior. Of course I would love to see it implemented for all cases in OpenMW as it allows plugins to offer the player random loots from NPCs.
I could have sworn that in the TES-CS I've seen NPCs with random item lists in their inventory.
OK, this isn't quite the same thing as adding random item list via script, but I'm not sure how it makes a difference. (From the perspective of someone playing the game.)

Also, while you can't add a random item list to an inventory via a script, I think you could have a script pick a random item and add THAT to a NPC's inventory. Same effect, just a bit more work.
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 »

dteviot wrote:Also, while you can't add a random item list to an inventory via a script
You can, via levelled items. But as we spoke above, in vanilla Morrowind it doesn't work for all cases...
I wonder how many scripts like farrp's one add levelled items through scripts.
User avatar
sjek
Posts: 442
Joined: 22 Nov 2014, 10:51

Re: Object can not be placed into a container

Post by sjek »

http://www.uesp.net/wiki/Tes3Mod:AddItem any ideas is there a way to break a mod .?
1. the actor has never been loaded. Local scripts would not be executed yet, therefore AddItem can only be called in the form some_actor->AddItem objectID count, which would affect the object inventory.

However, the form some_actor->AddItem objectID count works in a strange way:
- If the actor some_actor is unique, a call of some_actor->AddItem objectID count will add the item(s) to that actors inventory.
- If the actor some_actor is NOT unique, a call of some_actor->AddItem objectID count will add the item(s) to the object inventory, so the new item will only be given to all references of some_actor that have not been loaded yet.

Examples:
- "bob smith"->AddItem gold_001 100: if Bob Smith is a unique NPC (as he should be), he now has 100 gold.
- "imperial archer"->AddItem "silver arrow" 100: only imperial archers that have not been loaded yet will have those 100 silver arrows.
and
Normal items can be added to any actor or container.

Leveled items can be added to any actor or container, but they may not work as expected. They are only evaluated, if added to the object inventory. Added to the player, or a container in state 3, or an actor that has already been loaded, they appear as some strange and unusable icon.

Items that are created by the player like self-made potions or self enchanted items or filled soul gems can not be handled by AddItem. The same is true for health or number of usages. AddItem will only add items as defined in CS.
smells like a bug. how the local script works currently. working right when loaded and no additem or aitravel resrictions .?

--- how that text be written with only one part :P

the icon at least hasn't wide user base as in public mods that would be quickly noticed. for the load order if it's on the cell load that could be done with local script and with global referencing any NPC's

in vanilla it has to be global in multiple cases to work. gnite for now..
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 »

Good finding sjek!
Such a behavior has to be a bug as it is not consistent across situations.

I've updated the bug report based on your link: https://bugs.openmw.org/issues/2404
Locked