Can't get OnActivate to trigger on a ReferenceAlias

Post » Thu Jun 21, 2012 4:02 am

I made a RefAlias that's filled by a horse. I put a script on it that atm is pared down to just this:


---------------------------------------------------------------------------------
Scriptname hrfHorseCheckScript Extends ReferenceAlias


Event OnActivate(ObjectReference akActionRef)

Debug.Notification("I was activated.")

EndEvent


---------------------------------------------------------------------------------


I load the game, make sure the horse that fills that refalias is in front of me, and I activate it. Nothing happens (besides mounting the horse). I don't get the "I was activated" message. If I use Debug.Trace it doesn't get written to the log. What am I doing wrong?
User avatar
darnell waddington
 
Posts: 3448
Joined: Wed Oct 17, 2007 10:43 pm

Post » Thu Jun 21, 2012 4:19 am

I don't see anything wrong with the script. Try adding an OnHit event and testing if that works. If it does, then I guess it's impossible to activate horses... If it doesn't then you must have done something wrong and the horse is not actually filling that alias.
User avatar
Danny Warner
 
Posts: 3400
Joined: Fri Jun 01, 2007 3:26 am

Post » Thu Jun 21, 2012 6:19 am

Turns out it works. It just takes a minute for the activation to register. Literally a minute, at least. The hit was registered a little faster so that let me know to try waiting longer for the activate. But not much faster; the OnHit took over 30 seconds. Crazy.
User avatar
R.I.p MOmmy
 
Posts: 3463
Joined: Wed Sep 06, 2006 8:40 pm

Post » Wed Jun 20, 2012 8:12 pm

Scripts in Skyrim have a script budget and when that is used-up, nothing happens (script-wise) until that budget is available again.
In short, that means you have some other script(s) running that use-up all the budget time-slices.

It would usually be something that calls RegisterForUpdate with a small interval or a OnHit event not taking into account destruction magic (flames spell, etc.) that spam OnHit events -- minutes into the future.

To pin-point which script(s) are ignorant about this, you can try to enable http://www.creationkit.com/INI_Settings_(Papyrus)#bEnableTrace and then in-game call http://www.creationkit.com/DumpPapyrusStacks and http://www.creationkit.com/DumpPapyrusUpdates from the console. This should give you enough to pin-point a specific script file.
The log-file is stored at \My Games\Skyrim\Logs\Script\Papyrus.0.log; Papyrus.0.log is always the most recent one.
User avatar
Roanne Bardsley
 
Posts: 3414
Joined: Wed Nov 08, 2006 9:57 am

Post » Wed Jun 20, 2012 8:21 pm

Thanks Xetrill. I watch the Papyrus log for my stuff. I've been ignoring everything else. Guess I better start paying more attention.

Do you know if there's an ini setting to raise the script budget specifically?
User avatar
Christine
 
Posts: 3442
Joined: Thu Dec 14, 2006 12:52 am

Post » Wed Jun 20, 2012 6:14 pm

I haven't tried changing any of these values, but I think you want to look at fUpdateBudgetMS, iMinMemoryPageSize, and iMaxMemoryPageSize:

http://www.creationkit.com/INI_Settings_%28Papyrus%29
User avatar
Anthony Santillan
 
Posts: 3461
Joined: Sun Jul 01, 2007 6:42 am

Post » Thu Jun 21, 2012 2:59 am

It turns out that while the horse activation event is set off fine by me, and by any random NPC I command to activate it via the console, the one actor I actually care about activating it is a follower and when she does it nothing happens. *laugh/cry moment*
User avatar
Siobhan Thompson
 
Posts: 3443
Joined: Sun Nov 12, 2006 10:40 am


Return to V - Skyrim