Remove alias object from player

Post » Wed Jun 20, 2012 4:05 am

Hi.

I'm trying to remove a quest item from the player, when the quest is finished. But "RemoveItem()" doesn't work together with "ReferenceAlias".

Here's what I did:
-Set up the Alias properly.
-Made an ReferenceAlias property in my script.
-Attached it to the Alias.
-Added this code:

ReferenceAlias Property HT_AliasRecipe  AutoFunction QuestComplete()  Game.GetPlayer().RemoveItem(HT_AliasRecipe, 1)EndFunction

But it fails to compile, saying: "type mismatch on parameter 1 (did you forget a cast?)"
User avatar
Victor Oropeza
 
Posts: 3362
Joined: Sun Aug 12, 2007 4:23 pm

Post » Wed Jun 20, 2012 4:56 am

If it is possible to assign the script to a stage within the quest then it can be much simpler like:

Game.GetPlayer().RemoveItem(HT_AliasRecipe.GetReference())

No need for properties, functions or anything like that.


I don't know much about papyrus or quest making though but maybe this will help.
User avatar
Soph
 
Posts: 3499
Joined: Fri Oct 13, 2006 8:24 am

Post » Wed Jun 20, 2012 4:27 am

I added ".GetReference()" and it worked.
Thanks a lot. =)
User avatar
Euan
 
Posts: 3376
Joined: Mon May 14, 2007 3:34 pm

Post » Wed Jun 20, 2012 9:05 am

Glad to help! :D
User avatar
Ice Fire
 
Posts: 3394
Joined: Fri Nov 16, 2007 3:27 am

Post » Wed Jun 20, 2012 7:52 pm

Yeah, the AliasReference is just a pointer object...the actual object is at *.GetReference() or *.GetRef() if you prefer.
User avatar
Greg Cavaliere
 
Posts: 3514
Joined: Thu Nov 01, 2007 6:31 am


Return to V - Skyrim