Library scripts and Properties

Post » Sat Nov 17, 2012 10:18 pm

I think I already know the answer, but just in case: Is it possible to attach ref Properties to a common "Library" script that is utilized by my object scripts?, e.g. so MyFishLibrary.nearestFish() could look at the critterfishList Formlist, for instance.

This is a Library of routines common to all scripts in my fishing mod - get nearest fish, get the region the player is in, determine if an object is in water or on land, etc, and it makes extensive use of FormLists and Object Refs in addition to simples like int and floats.

If this isn't possible, is it better to :

1) attach my library to an unused Form object, someplace in the world, and attach properties to that instance, or

2) Keep it as a Library and pass the values in via the methods, eg MyFishLibrary.nearestFish(critterfishList), or

3) make the Library extend ObjectRef and extend my other classes from it (and would props on the library be settable then?)


ITs a rather lengthy task to set up, so I jut wanted some community input before I mangle my otherwise functional code... =)
User avatar
CYCO JO-NATE
 
Posts: 3431
Joined: Fri Sep 21, 2007 12:41 pm

Return to V - Skyrim