Jump to content

Help getting additem function to work?


Recommended Posts

Posted

I've been modding for some time now, however i still consider myself a beginner, and as such there are stuff that i still can't wrap my head around, one of them being additem(). I've tried to use it on several different occasions now, and every time it just doesn't work and i figure out some alternative method. For example here i tired to add an item to a container set by a quest stage:

Spoiler

;fragment start

containerRefAlias.getref().additem(itemproperty, 1, false), only works if the cell the container is in is loaded, despite being marked as persistent

;fragment end

and here i tried making something like the courier system from skyrim

Spoiler

;fragment start

itemAliasRef.forcerefto(game.getplayer().placeatme(itemproperty)

(courierquest as courierquestscript).addaliastocontainer(itemAliasRef)

;fragment end

 

function addAliasToContainer(ReferenceAlias refAliasToAdd)

    objectReference vObjectRefToAdd = refAliasToAdd.getReference()
    addRefToContainer(vObjectRefToAdd)

EndFunction

 

function addRefToContainer(objectReference objectRefToAdd)
    CourierContainerProperty.addItem(objectRefToAdd)
    CourierItemCountGlobal.value += 1
endFunction

 

this also doesnt work, the global doesnt get increased, however when i use cqf from the console, it does

Obviously i'm missing something here, but i cannot figure it out on my own so i'm hoping someone here could point me the right way

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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