additem, leveled lists, and creatures vs NPCs

Questions specific to OpenMW-CS can be asked, and content development related topics can be discussed here
Post Reply
claudekennilol
Posts: 92
Joined: 01 Aug 2012, 20:48

additem, leveled lists, and creatures vs NPCs

Post by claudekennilol »

Code: Select all

"some npc"->additem "some_leveled_list", 1
works

Code: Select all

"some_creature"->additem "some_leveled_list", 1
doesn't work. It seems like this also doesn't work in vanilla (biggest difference being it silently continues in vanilla while in OMW it completely kills the script). But I guess my question is more why? Is there some mechanical reason it shouldn't work? Is the reason simply because it doesn't work in vanilla so it also doesn't/shouldn't work in OMW?
User avatar
Atahualpa
Posts: 1176
Joined: 09 Feb 2016, 20:03

Re: additem, leveled lists, and creatures vs NPCs

Post by Atahualpa »

Are you sure that this works for NPCs? I just tried it out and it didn't work for me (it was also rejected for containers).

Anyway, the rejection of levelled item lists was implemented by Zini way back in 2012: Commit e13e858c. The original game does not complain when you add levelled item lists to an NPC or creature, but you end up with a useless dummy item instead of the desired randomised item(s).
It could be that the underlying code makes it impossible to add levelled lists at runtime. Maybe one of our main/veteran developers can clear things up.
claudekennilol
Posts: 92
Joined: 01 Aug 2012, 20:48

Re: additem, leveled lists, and creatures vs NPCs

Post by claudekennilol »

This is a rough description as it's from memory. Running `"some npc"->additem "some_leveled_list" 1` from the console I know behaves as you describe--that it just adds a dummy item. There's a script that runs that adds a leveled list to specific high level creatures and specific NPCs. From my testing, neither (neither as in neither vanilla nor OMW) adds anything to the creature. This was tested by spawning about 20 "dremora" and checking their inventory.

However, "Alenus Vendu" is an npc which has the leveled list added. In vanilla, every time I spawned this NPC (about 6) she had an item from the leveled list. Each time I spawned her in OMW she had nothing from the leveled list on her.

I wanted to make a simple a very simple mod to verify this, but the only install I had available was the free 20th edition from the bethesda launcher and apparently it doesn't come with the CK installed so I couldn't get a simple mod in place to test it for vanilla. (and as far as I could tell open-cs only makes the openmw format plugins)

This is what's in openmw.log

Code: Select all

Execution of script cw_mtt_loot failed:
Object 'cw_trinket_npc' of type struct ESM::ItemLevList can not be placed into a container
MTT IV - http://mw.modhistory.com/download-46-6949
MTT IV patch - http://mw.modhistory.com/download-13-6822

Here is the content of the script
Spoiler: Show
So from my testing, in vanilla `"dremora"->AddItem "cw_trinket_NPC", 1` fails but doesn't stop execution of the script which continues on to `"alenus vendu"->AddItem "cw_obj_unfinished_ring", 1` which appears to work. In OMW `"dremora"->AddItem "cw_trinket_NPC", 1` fails which kills the script which doesn't get to the portion to add "items" to NPCs.
User avatar
AnyOldName3
Posts: 2668
Joined: 26 Nov 2015, 03:25

Re: additem, leveled lists, and creatures vs NPCs

Post by AnyOldName3 »

I'm pretty sure you can just google Morrowind Construction Kit and find an official download that'll work with any version of Morrowind. You can also make an ESP with the OpenMW CS - just rename the omwaddon file to esp and it'll work just fine. If you've got scripts, though, you'll need to resave it with the vanilla CK, as OpenMW doesn't use or create script bytecode, so that kind of defeats the purpose of what you're trying to do.
claudekennilol
Posts: 92
Joined: 01 Aug 2012, 20:48

Re: additem, leveled lists, and creatures vs NPCs

Post by claudekennilol »

I've got it on a disk, too. I just didn't have it already installed at the point I was looking into the error.
kuyondo
Posts: 243
Joined: 29 Mar 2016, 17:45

Re: additem, leveled lists, and creatures vs NPCs

Post by kuyondo »

Adding leveled list via additem doesn't work in OpenMW. You can do it in vanilla, but you need MCP.. A workaround is to create an empty leveled list, add it into the object directly, and then use addtolevitem command to add items into the leveled list.
claudekennilol
Posts: 92
Joined: 01 Aug 2012, 20:48

Re: additem, leveled lists, and creatures vs NPCs

Post by claudekennilol »

> but you need MCP

My test above was done without MCP
Post Reply