"Global" scripts? What is the Papyrus equivalent?

Post » Sun Jun 17, 2012 9:09 pm

I would like a script to run automatically when the player starts the game, and run in the background continuously. In Morrowind, this would be a "global" script, a script not tied to an object and listed in the StartScripts list in the Construction Set.

I can't seem to find similar functionality in the CK / Papyrus, everything seems to be tied to an object.

Can someone enlighten me?

Thanks!
User avatar
Hope Greenhaw
 
Posts: 3368
Joined: Fri Aug 17, 2007 8:44 pm

Post » Mon Jun 18, 2012 11:11 am

Simplest way to do this is create a Starts Enabled quest and attach your quest to it. You'll need to use the OnUpdate event on the script, and call RegisterForUpdate from the quest's startup stage.
User avatar
Theodore Walling
 
Posts: 3420
Joined: Sat Jun 02, 2007 12:48 pm

Post » Mon Jun 18, 2012 1:32 pm

Calling RegisterForUpdate in the startup stage? Is there a way to specify which of the quest's scripts the function will be called from?
User avatar
Ellie English
 
Posts: 3457
Joined: Tue Jul 11, 2006 4:47 pm

Post » Mon Jun 18, 2012 12:00 am

Thank you, Maturin!
User avatar
Maddy Paul
 
Posts: 3430
Joined: Wed Feb 14, 2007 4:20 pm

Post » Sun Jun 17, 2012 9:30 pm

Thanks man, have been thinking about this myself. Looks like you can change the interval that it updates at through the registerForUpdate function so it could be set really fast if need be.
User avatar
gemma king
 
Posts: 3523
Joined: Fri Feb 09, 2007 12:11 pm

Post » Sun Jun 17, 2012 10:58 pm

Calling RegisterForUpdate in the startup stage? Is there a way to specify which of the quest's scripts the function will be called from?

How do we even do that? Making a Papyrus fragment that does "RegisterForUpdate(1)" doesn't work...How do we even do that?
User avatar
rolanda h
 
Posts: 3314
Joined: Tue Mar 27, 2007 9:09 pm

Post » Mon Jun 18, 2012 7:03 am

Does anyone have an answer to Archereon's question above? I'd like to know as well.
User avatar
Marta Wolko
 
Posts: 3383
Joined: Mon Aug 28, 2006 6:51 am

Post » Mon Jun 18, 2012 6:20 am

How do we even do that? Making a Papyrus fragment that does "RegisterForUpdate(1)" doesn't work...How do we even do that?

Dont add it as a fragment. Use the Scripts tab on the far right and attach it there.
User avatar
Jesus Lopez
 
Posts: 3508
Joined: Thu Aug 16, 2007 10:16 pm


Return to V - Skyrim