Globalconstant scripts?

Post » Thu Jun 21, 2012 6:12 pm

All,

I understand how to attach a script to an object. However, I cant figure out how to make a script that always runs. I basically want a script that is always in effect that monitors whenever certain events happen to the player (such as a skill increase). I would also like a script that kicks something off every time the map page opens. I just dont know what to attach the scripts to.

Help? Thanks!
User avatar
Code Affinity
 
Posts: 3325
Joined: Wed Jun 13, 2007 11:11 am

Post » Thu Jun 21, 2012 6:20 am

Skill increases are easy to spot because the Story manager has an OnStoryIncreaseSkill event. You would make a quest, rather than a script, and put code in the quest's startup fragment (and finish it with a Stop()). Then you would put it in the appropriate SM Event node.

(I have no idea how to tell when the map is open.)
User avatar
Amysaurusrex
 
Posts: 3432
Joined: Wed Aug 09, 2006 2:45 pm

Post » Thu Jun 21, 2012 5:20 pm

Interesting. I still havent done much if anything with the story manager. I will look in that direction. Thanks!

If anyone knows of any other global script approaches, like knowing when,the map is opened pr having a script wake up every 5 minutes to do something, let me know. :)

Thanks!
User avatar
neen
 
Posts: 3517
Joined: Sun Nov 26, 2006 1:19 pm

Post » Thu Jun 21, 2012 9:33 am

If you want a script to do something at regular intervals, use RegisterForUpdate (or, usually better, RegisterForSingleUpdate,and call RegisterForSingleUpdate again at the end of the OnUpdate event).
User avatar
Jason King
 
Posts: 3382
Joined: Tue Jul 17, 2007 2:05 pm

Post » Thu Jun 21, 2012 6:19 pm

Does anyone else know if its possible to set up an event for when the map is opened?
User avatar
lucy chadwick
 
Posts: 3412
Joined: Mon Jul 10, 2006 2:43 am


Return to V - Skyrim