OnRead Trigger Activator

Post » Wed Jun 20, 2012 11:54 pm

I've been searching for uses of the OnRead() function and found of lot of spell and recipe books this is used in. But I haven't seen how this can be used to trigger an event.

I've a great little script from JustinOther that triggers an event on getting an item off of an NPC. What I need now is something similar but a trigger when reading a certificate (note).

I've been piecing together different things I've been finding while researching this but there is still stuff I need to learn about this to get it to work.

This is what I am working on:

ScriptName AntreCertFreeFamily extends ObjectReferenceObjectReference Property YourMarkerREF AutoEvent OnRead()	    If akNewContainer == Game.GetPlayer()			    YourMarkerREF.Enable()                Debug.Notification("The Fisher Family Has Been Set Free!")	    EndIfEndEvent

I have no idea what the different ak style variables are so I don't know what to change that to....if that's what I need to do.

I've played around with stuff like "akItemRead" and "akOnRead" etc etc. But I am sure the "IF" conditional is the problem here.

Thanks in advance for any and all help :)
User avatar
Guinevere Wood
 
Posts: 3368
Joined: Mon Dec 04, 2006 3:06 pm

Post » Wed Jun 20, 2012 2:59 pm

ScriptName AntreCertFreeFamily extends ObjectReferenceObjectReference Property YourMarkerREF AutoEvent OnRead()	If YourMarkerREF.IsDisabled()		YourMarkerREF.Enable()		Debug.Notification("The Fisher Family Has Been Set Free!")	EndIfEndEvent
Each function/event has its own parameters or in some cases, like http://www.creationkit.com/OnRead_-_ObjectReference, none.
User avatar
Code Affinity
 
Posts: 3325
Joined: Wed Jun 13, 2007 11:11 am

Post » Wed Jun 20, 2012 4:37 pm

"IsDisabled"???

Man I feel dumb lol

I think I need to hunt down a variable chart the game uses.

Thanks again for all your help Justin.

All you guys at the gamesas forums are awesome for noobs like myself :)
User avatar
Natasha Biss
 
Posts: 3491
Joined: Mon Jul 10, 2006 8:47 am

Post » Wed Jun 20, 2012 9:44 pm

hhhmmm

It seems to be not working.

It activates on retrieving the paper from the safe with no notification.

I've recompiled it several times and double checked that the proper script is being used too.

I've gone into the property of the script and it's calling the correct trigger.
User avatar
Jessica Nash
 
Posts: 3424
Joined: Tue Dec 19, 2006 10:18 pm

Post » Wed Jun 20, 2012 6:06 pm

Is YourMarkerREF "Initially Disabled"? So long as isn't already enabled and the property is filled correctly, the notification should fire. Could be that it's saved as enabled...
User avatar
Damian Parsons
 
Posts: 3375
Joined: Wed Nov 07, 2007 6:48 am

Post » Wed Jun 20, 2012 9:54 pm

I see what happened.

For some reason the old script was staying with the save game.

Once I loaded up a save that hasn't been to the mod it worked perfectly.

I have no idea why a script would attach to a save game though :/
User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm


Return to V - Skyrim