Where to hook up permanent active scripts?

Post » Wed Jun 20, 2012 9:36 pm

I want to permantly watch what the player equips and keep track of it.
I have to use the OnEquip event but where to hook scripts , so every time the players changes stuff it gets active?
Is it possible to watch for hotkey presses?

Is there something like a main script, running and controlling stuff all the time?
Or is everything attached to items/spells/actors etc?

PS: no skse / script dragon please :wink:
User avatar
Marion Geneste
 
Posts: 3566
Joined: Fri Mar 30, 2007 9:21 pm

Post » Thu Jun 21, 2012 1:08 am

You probably want a quest with an alias to player and a script attached to that alias.
User avatar
m Gardner
 
Posts: 3510
Joined: Sun Jun 03, 2007 8:08 pm

Post » Wed Jun 20, 2012 1:43 pm

Ok, I made a new quest, set the alias to player and added a oninit script with a notification for testing.
Nothing happens when the game is loaded. Quest not loading - did I forgot something?

Start game enabled is set...
User avatar
Julie Serebrekoff
 
Posts: 3359
Joined: Sun Dec 24, 2006 4:41 am

Post » Wed Jun 20, 2012 2:06 pm

That should work, it did for me. Just to be sure: you attached your script to the alias, not the quest, right?

I'm not sure OnInit() is the best test, though. Try OnItemAdded() with just a debug.notification in it and then pick up something in game.
User avatar
TIhIsmc L Griot
 
Posts: 3405
Joined: Fri Aug 03, 2007 6:59 pm

Post » Wed Jun 20, 2012 11:40 pm

Thanks, that helped a bit.
Well acutally I did everything right, had a stupid error...

My script was premade as "extends objectreference". The script under alias HAS TO BE "....extends referencealias" or it fails.
A simple thing taking forever because of lacking documentation :(

At least it works now.
User avatar
Ricky Meehan
 
Posts: 3364
Joined: Wed Jun 27, 2007 5:42 pm


Return to V - Skyrim