Quastion about adding random items to NPC?

Post » Mon Mar 01, 2010 1:34 pm

Hello

First sorry for my bad English

I'm working on a mod requires adding random items to specific NPC, and i need experts help :rolleyes:

in detail let's say i have collection of rings each one with its own gamemode script, at specific event i want randomly one of those rings added to a specific NPC and then removed.

Is it possible?
User avatar
Ludivine Dupuy
 
Posts: 3418
Joined: Tue Mar 27, 2007 6:51 pm

Post » Mon Mar 01, 2010 1:02 am

It's very easily done with a levelled list and some scripting. Here's some info on the commands you'll need to use:

http://cs.elderscrolls.com/constwiki/index.php/Category:Leveled_Lists

http://cs.elderscrolls.com/constwiki/index.php/AddItem

http://cs.elderscrolls.com/constwiki/index.php/GetItemCount

http://cs.elderscrolls.com/constwiki/index.php/RemoveItem

Goodluck. :)
User avatar
Manny(BAKE)
 
Posts: 3407
Joined: Thu Oct 25, 2007 9:14 am

Post » Mon Mar 01, 2010 9:28 am

The problem however is with the rings themselves. Scripted items have their scripts stored within the save game even after the item is removed, so if this process happens more than once, having scripts on any inventory items which are created (as opposed to only one reference of each being moved between containers) can create some degree of savegame bloating.

Other ways you can do this would be with an ability script for each of the effects, being added randomly with scripting, or using part of the quest script to detect which ring the NPC has (getitemcount), and performing all of the gamemode functions directly. Or a combination of both (leveled list adds item, quest script checks which item was added, quest script adds an ability script to the actor, ability script performs related functions).
User avatar
Victoria Bartel
 
Posts: 3325
Joined: Tue Apr 10, 2007 10:20 am

Post » Mon Mar 01, 2010 3:25 pm

@ Pro 6AM3R: Thank you for your help, i don't have the knowledge how Leveled Lists work, I will check the link to wiki you included :)

@ Vagrant0: GetItemCount and quest script would be the best choice (how come i didn't think of that :rolleyes:) all i need now is read about about Leveled lists mechanics, Thank you very much for your help and suggestion :)
User avatar
Jessica Stokes
 
Posts: 3315
Joined: Fri Jul 28, 2006 11:01 am


Return to IV - Oblivion