PlaceAtMe Ownership?

Post » Wed Aug 28, 2013 8:47 pm

So, first of all, the CK has CoinPurseSmall under "Flora" which is just bizarre.

Anyway, I've got a mod I'm working on that spawns a couple of coin purses at the player when they get knocked about (and removes gold from the inventory at the same time), as if the player has dropped them (since you can't actually hold or drop a coin purse).

However, I've noticed that items spawned at the player like gold and coin purses, if done inside an owned cell (like an Inn), will cause alarm when taken - as if the player is stealing from the Inn!

Does anyone know of a way around this?

User avatar
Portions
 
Posts: 3499
Joined: Thu Jun 14, 2007 1:47 am

Post » Wed Aug 28, 2013 4:13 pm

There's a setactorowner function you can use.

Ex:

Scriptname _test_testscript extends QuestForm Property kItem AutoActor Property PlayerRef AutoFunction SomeFunction()    ObjectReference kNewItem = PlayerRef.PlaceAtMe(kItem)    kNewItem.SetActorOwner(None)endFunction
User avatar
Prue
 
Posts: 3425
Joined: Sun Feb 11, 2007 4:27 am

Post » Wed Aug 28, 2013 4:42 pm

Weird. Totally works for gold, but not coin purses.

In a script extending the player alias:

Flora Property CoinPurseSmall  AutoObjectReference CoinPurse = GetActorReference().PlaceAtMe(CoinPurseSmall, 1)CoinPurse.SetActorOwner(None)
User avatar
Bedford White
 
Posts: 3307
Joined: Tue Jun 12, 2007 2:09 am

Post » Wed Aug 28, 2013 12:00 pm

Got it working. Thanks so much!

ObjectReference CoinPurse = GetActorReference().PlaceAtMe(CoinPurseSmall, 1)CoinPurse.SetActorOwner(GetActorReference().GetActorBase())
User avatar
Georgine Lee
 
Posts: 3353
Joined: Wed Oct 04, 2006 11:50 am


Return to V - Skyrim