Jump to content

Attaching a script to a magic effect and the magic effect to a consuma


DavidD

Recommended Posts

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 by DavidD
Link to comment
Share on other sites

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

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

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...