Quick Q: Moving an Alias from an Alias to player

Post » Thu Jan 16, 2014 6:52 pm

Have this fragment and can't quite see what I'm missing, error says missing a cast. I'm moving an Alias MISC "PuzzlePiece" from a NPC to Player, like this...

Game.GetPlayer().AddItem(Alias_PuzzlePiece.GetRef(), False, Alias_crumple2nd.GetRef())

.psc(253,17): type mismatch on parameter 2 (did you forget a cast?)

It's probably staring at me but need another pair of eyes on it. Thanks.

User avatar
Nana Samboy
 
Posts: 3424
Joined: Thu Sep 14, 2006 4:29 pm

Post » Fri Jan 17, 2014 3:25 am

Those are incorrect parameters for AddItem.

To move an item from one container to another you need to use RemoveItem, this should do the trick:

Alias_crumple2nd.getRef().RemoveItem(Alias_PuzzlePiece.GetRef(), 1, False, game.getPlayer())
User avatar
Lyndsey Bird
 
Posts: 3539
Joined: Sun Oct 22, 2006 2:57 am

Post » Fri Jan 17, 2014 4:13 am

You know what egocarib - that's the way I originally scripted it but for some reason I changed it. Its very late, I should sleep. Thanks.

User avatar
Gaelle Courant
 
Posts: 3465
Joined: Fri Apr 06, 2007 11:06 pm


Return to V - Skyrim