Detect when the player gives an item to an alias.

Post » Sun Dec 16, 2012 11:52 pm

I'm making a quest where the player has to pickpocket a letter, read it, then replace it. Here is the code I used for detecting when the player has taken the note:

Event OnContainerChanged(ObjectReference newContainer, ObjectReference oldContainer)if (newContainer == Game.GetPlayer())SBQRadCour.SetObjectivedisplayed(20)SBQRadCour.SetStage(20)endif


Which all works fine.

I'm having trouble detecting when the note is put back on the character. The character I'm pickpocketing the letter from is a ref alias, so I tried adding an alias property to the script and writing the same script as above but replacing Game.GetPlayer with my alias, ThCourier:


if (newContainer == ThCourier())SBQRadCour.SetObjectivedisplayed(20)SBQRadCour.SetStage(20)endif


It doesn't work though. Whenever I try to compile, I get an error saying:

ThCourier is not a function or does not exist

I'm not exactly sure what to do, since I can't add an 'actor' property (the alias is a non-unique lvl character)
User avatar
Javaun Thompson
 
Posts: 3397
Joined: Fri Sep 21, 2007 10:28 am

Return to V - Skyrim