DavidD Posted February 17, 2012 Share Posted February 17, 2012 (edited) Hey there! In the wiki under persistence it says that if I attach a property to a script it'll stay forever. What if I attach the script "ScriptFoo" to "MagicEffectFoo" and then make the effect of a consumable "MagicEffectFoo"? Will I end up with 1 ScriptFoo in the game which is reused or will I end up with 100 (given I use 100 consumables). If anyone is experienced with global functions and can tell me how to call a global function which returns a property like so:int property prop auto int function GetProperty() return property endFunction I'm used to C++ and C# (or pretty much any other language..) where functions are global left and right so not being able to do so with ease is making this way difficult Also it should say "Will it create multiple instances" not references Edited February 17, 2012 by DavidD Link to comment Share on other sites More sharing options...
Jugg3r Posted February 17, 2012 Share Posted February 17, 2012 i am pretty new to scripting with papyrus but it should work like this Scriptname MyTriggerBoxScript extends ObjectReference So MyTriggerBoxScript "is a child" of ObjectReference, thus i can call on all functions native to ObjectReference.Pls correct me if i am wrong ;) Link to comment Share on other sites More sharing options...
DavidD Posted February 17, 2012 Author Share Posted February 17, 2012 i am pretty new to scripting with papyrus but it should work like this Scriptname MyTriggerBoxScript extends ObjectReference So MyTriggerBoxScript "is a child" of ObjectReference, thus i can call on all functions native to ObjectReference.Pls correct me if i am wrong ;) That is true, however you will also inherit properties and I'd like to keep the usage of properties to a minimum since they'll be persistent and I don't know how the garbage collection works or if scripts are removed/reused or whatever Link to comment Share on other sites More sharing options...
Jugg3r Posted February 17, 2012 Share Posted February 17, 2012 Then you will have to write the function all over for your parent script,And afaik inheritage doesnt mean everything is initiallized ... but i am as green as you are. Just thinking out loudly :) Link to comment Share on other sites More sharing options...
DavidD Posted February 18, 2012 Author Share Posted February 18, 2012 Then you will have to write the function all over for your parent script,And afaik inheritage doesnt mean everything is initiallized ... but i am as green as you are. Just thinking out loudly :) It says on the wiki that if it has properties then it'll always be there. The question is if the default property will make it persistent, I guess there'd be a note if it didn't Link to comment Share on other sites More sharing options...
Recommended Posts