Activate() not working? (And other scripting stuff)

Post » Sat Aug 30, 2014 12:41 pm

Alright. I've got another issue. So I'm trying to make the player read a note, but it has to be forced. They don't get to choose to read the note. So I thought you could do something like "Book.Activate(Game.GetPlayer())" but that doesn't seem to work. Here's the whole script, so you can help me correct any other glaring errors you see:

Spoiler
Scriptname IQ02PackageScript extends ReferenceAlias  {Called when the player tries to open the package.}Message Property OpenConfirmation Auto {Called when you say yes to opening the package. 0 is cancel, 1 is open, 2 is read the note.}Message Property PackageOpenMessage Auto {Called when you equip the package. 0 is exit, 1 is read note, 2 is open.}Book Property CourierNote Auto Actor Property PlayerREF Auto Weapon Property Cutlass Auto Armor Property Buckler Auto Event OnEquipped(Actor akActor)	If akActor == PlayerREF		Int iButton = PackageOpenMessage.Show()		While iButton 			If iButton == 1				CourierNote.Activate(PlayerREF)								If PlayerREF.GetItemCount(CourierNote) == 0					PlayerREF.AddItem(CourierNote, 1)				EndIf			ElseIf iButton == 2				iButton = OpenConfirmation.Show()				While iButton					If iButton == 1						PlayerREF.AddItem(Cutlass, 1)						PlayerREF.AddItem(Buckler, 1)						PlayerREF.RemoveItem(Self.GetReference(), 1)					ElseIf iButton == 2						CourierNote.Activate(PlayerREF)						If PlayerREF.GetItemCount(CourierNote) == 0							PlayerREF.AddItem(CourierNote, 1)						EndIf					EndIf				EndWhile			EndIf		EndWhile	EndIfEndEvent 

Compiler Errors:

Spoiler
Starting 1 compile threads for 1 files...Compiling "IQ02PackageScript"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\IQ02PackageScript.psc(23,16): Activate is not a function or does not existC:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\IQ02PackageScript.psc(45,18): Activate is not a function or does not existNo output generated for IQ02PackageScript.psc, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on IQ02PackageScript.psc

[Finished in 1.1s with exit code -1]

Any help would be greatly appreciated.

User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Post » Fri Aug 29, 2014 11:13 pm

You're calling it on the Book Base Object. Activate is supposed to be called on the ObjectReference.

User avatar
Lil Miss
 
Posts: 3373
Joined: Thu Nov 23, 2006 12:57 pm

Post » Sat Aug 30, 2014 12:50 am

Activate() is a function of ObjectReference type, not of Book type. To activate something/one, you need a reference to that 'base object', not the 'base object' itself.

User avatar
meghan lock
 
Posts: 3451
Joined: Thu Jan 11, 2007 10:26 pm


Return to V - Skyrim