Removing an Alias object fom inventory in an event

Post » Mon Oct 28, 2013 7:32 am

I've done this before but can't remember how. Player has an Alias object from a quest in his inventory, upon activating an activator I need this alias object to be removed from inventory. I'm kind of on the right track but doing something wrong. Here's what I have - script isn't complete yet just want to get the remove alias bit working first, please tell me what is wrong, thanks.

Quest Property MyQuest AutoInt Property PreReqStage AutoInt Property StageToSet AutoGlobalVariable Property MinusSkull AutoObjectReference Property Obj1 AutoAlias Property Skull01 AutoEvent OnActivate(ObjectReference akActionRef)If akActionRef == Game.GetPlayer()If MyQuest.GetStage() == PreReqStageGame.GetPlayer().RemoveItem(Skull01)EndifEndifEndevent
User avatar
Rhi Edwards
 
Posts: 3453
Joined: Fri Jul 28, 2006 1:42 am

Post » Mon Oct 28, 2013 5:26 am

You need to retrieve the item that the referencealias is pointing at. Try

akActionRef.RemoveItem(Skull01.GetReference())

Edit: (You'll need to define Skull01 as a ReferenceAlias instead of an Alias for this to work)

User avatar
Natasha Biss
 
Posts: 3491
Joined: Mon Jul 10, 2006 8:47 am

Post » Mon Oct 28, 2013 8:41 am

Thanks, all seems well now.

User avatar
Ladymorphine
 
Posts: 3441
Joined: Wed Nov 08, 2006 2:22 pm


Return to V - Skyrim