Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Using a Quest to hold global object variables


Leecarter
 Share

Recommended Posts

I know there are global variables you can create in the CK, but they're limited only to 3 numeric datatypes.

What I'm looking for is a way to make objects available globally. I've read this is possible by creating a quest that runs on start, then attach a script with the properties you want to make accessible globally. This directions I've found online to do this thus far haven't worked (or I did it wrong).

For example, one of the things I'd like to have globally accessible is a VisualEffect property, but this could apply to perks, weapons, or whatever else you wanted to use as a property in your scripts.

Has anyone here used this approach for creating global properties?

Link to comment
Share on other sites

I should clarify this a little more.

I have a quest set up that contains the variable in a script property - added a quest property to the actor's script - populated the property for the actor with the quest in the CK.

That works fine for accessing and persisting objects for the player, but I want something truly global. So let's say I want to access an object from *any* script.

Maybe this isn't even possible?

Link to comment
Share on other sites

If you can point to the properties in the quest script, then you can apply them in your current script. You just use the '=' sign.

myLocalREF = myCommandQuest.myQuestREF

I have not tried to do this yet since I only need global variables and they are easy enough to use.

Link to comment
Share on other sites

I found a way to do it by over-riding the inheritance of ObjectReference, creating properties in the new higher class, and then injecting variables from the local player script into the new top level script.

After the variables are injected by an event on the player (I used OnHit()) they will be available everywhere in any script using Game.GetPlayer().MY_NEW_VARIABLE.

Incorporated this into my first mod here:

http://skyrim.nexusmods.com/downloads/file.php?id=13281

There are 3 scripts, all beginning with "GM_".

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...