the Sim Settlements forums!

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Declaring akPlayerRef

msalaba

Well-Known Member
Staff member
Community Rockstar
Verified Builder
HQ Support
Messages
4,425
In Kinggath's Bethesda Tutorial series, he said the following is a low impact way to ref the PC:
Actor akPlayerRef = Game.GetPlayer()

Yet, on the Creation Kit Wiki:
Actor Property akPlayerRef Auto ; Least 'expensive' way to refer to the player

The former would be a temp var, but would need to be called for every Function / Event that requires a PlayerRef. The latter would be available for all Functions / Events in the script.

Is this a use case scenario where the former would be for a quick check while the latter would be more advantageous in a script that requires heavy use of a PlayerRef?
 
Since the PlayerRef is always persistent anyway, it's better to use a property than to make a function call. What kinggath meant (I think) is that if you are re-using the PlayerRef, best put it in a variable (or in a property) so that you don't make unnecessary function calls.

And now I see that you are already on to the BTK vids, good good! ;)
 
Then the question of where the 64k script data limit comes in. What exactly is the script data limit and what does it mean to a two bit wanna be modder like me?
 
The 64MB script property memory limit is really only applicable to city plans (and possibly huge addon packs like ours, Wasteland Venturers) since that limit wouldn't be possible to reach even with a full load order unless you have these type of mods. City plans have position, rotation, scale etc data for each item they place which can amount to millions of properties added together if you have many cityplans. For PC players, Baka ScrapHeap has solved the issue by increasing the data limit.
 
So the 64MB (for some reason I had KB stuck in my head.... back to the old school 80s tech???)

This applies to the combined load order? i.e. all mods loaded in a game.

If so, then we the mod authors should be trying to keep the number of declared Properties down. (Every little bit helps) I have yet to figure out how to "undeclare" Properties that are no longer needed.
 
To “undeclare” a property, edit the script that uses that property. Delete the property declaration inside there, save, recompile the script.

After that re-open the properties on the script in the CK - it will then do the cleanup for you.
 
Top