Jump to content

[LE] Help with additem scripting problems.


Recommended Posts

SOLVED PLEASE IGNORE

 

So I need some help figuring how to make the NPC give a key when the player selects a specified dialog option.

 

The mod starts with the NPC force greeting the player when they get in range upon entering the cell. (Got force greet to work already)

The player can then select options that can either make the NPC attack (Got this to work too) or convinces the NPC to leave the player alone and gives the player a key.

The key let's the player move to the next area. It's either obtained through dialog or killing the NPC.

 

It's not a full on quest mod, just dialog. I've tried adding scripts under dialogue views and the dialog that activates it.

I've tried adding the Game.GetPlayer()Additem() stuff but the CreationKit wiki says it doesn't work anymore with no alterative.

It's on the NPC's corpse if you defeat him. So I tried another script to remove item and place in player inventory. Still no avail.

I've tried setting conditions and variables, but I'm having some trouble with those too. I'm starting to think I'm not placing scripts in the correct places or typing them correctly. Especially since there's dozens of places to put them.

I shouldn't have to make a full on quest with stages and scenes right? Everything else works without them.

 

Now I'm still new to scripting, so it's probably something I'm doing.

 

I've tried a bunch of things to get this to work for 5 days now. It's driving me nuts.

I'm trying to get this done by April. Half of it is done so far. Just stuck on this.

If anyone can shed some light on this, or a even a link to a full step by step tutorial. I'd appreciate it.

Edited by thescavenger
Link to comment
Share on other sites

Where do you see that AddItem no longer works?

The wiki says it doesn't work right under Notes on that page.

 

"As of Skyrim version 1.6, it is no longer possible to use AddItem to add an Object or ObjectReference of type Container to the player's inventory."

 

I currently am running version 1.9.32 of LE Skyrim. So I'm past that number.

Edited by thescavenger
Link to comment
Share on other sites

 

Where do you see that AddItem no longer works?

The wiki says it doesn't work right under Notes on that page.

 

"As of Skyrim version 1.6, it is no longer possible to use AddItem to add an Object or ObjectReference of type Container to the player's inventory."

 

I currently am running version 1.9.32 of LE Skyrim. So I'm past that number.

 

That statement refers to objects of the Container base type. Regular objects (Misc, Armor, Weapon, etc..) work just fine with AddItem.

Link to comment
Share on other sites

If you want to fake a container in your inventory you can use a MiscObject or a Key with a script on it, though I'd prolly go with MiscObject. Interestingly you use OnEquip Event there to trigger the script, without actually equipping the MiscObject. This event can then view a container of your choice, one you already have in mind and have ready to open. Its a ghetto but solid workaround to enabling sub-containers

Link to comment
Share on other sites

first you get a property reference to object the NPC has? store this reference in your script OFC? You will find it in the NPC inventory. then remove the object from the NPC while transferring it to the player? you NOT Adding an item presay, you are transferring one. when you remove an object you get a choice where it goes....

 

that way the system garbage disposal will not have to deal with you creating objects willy nilly. and storing them in the memory.... and the game save... for no reason whatsoever.

 

the default action with remove destroys the object, but you can send it somewhere else with the extra parameters that no one uses

Function RemoveItem(Form akItemToRemove, int aiCount = 1, bool abSilent = false, ObjectReference akOtherContainer = None) native

your finished code should look like this

RemoveItem(theKey, akOtherContainer = PlayerREF) 

with two properties Object References for theKey and PlayerREF

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...