Could someone explain a bit more about persistence

Post » Tue Jun 19, 2012 7:35 pm

Hey there!


I've mad a few mods, mainly (read only) scripting since that's the only thing which interests me.


Now I wonder a bit about the persistence, garbage collection and all that.

It says that if I have properties it'll always be loaded into memory. Now if I attach a script to something like a magic effect and then put that magic effect on a potion, will the same instance of my script be used multiple times or will multiple instances be created?

So will there be 400 instances of my script after X hours or will there still only be 1?

Say that I have a script attached to every single food item (including potions), and this script has properties so it will be persistent. If the player eats 500 pieces of venison stew, will there be a bunch of unnecessary data loaded into memory or will it use the same script for every 500 times the player eats the venison?
User avatar
Madison Poo
 
Posts: 3414
Joined: Wed Oct 24, 2007 9:09 pm

Post » Tue Jun 19, 2012 11:02 am

For magic effects, a new instance of the script is created when the effect starts, and that same instance of the script is destroyed right after the effect stops, once everything in the script has stopped running.

Cipscis
User avatar
ShOrty
 
Posts: 3392
Joined: Sun Jul 02, 2006 8:15 pm

Post » Tue Jun 19, 2012 6:23 pm

For magic effects, a new instance of the script is created when the effect starts, and that same instance of the script is destroyed right after the effect stops, once everything in the script has stopped running.

Cipscis

Ah okay, so there should be no worries then! Thank you!
User avatar
Jimmie Allen
 
Posts: 3358
Joined: Sun Oct 14, 2007 6:39 am


Return to V - Skyrim