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...

Acessing another script's variable


bleakraven
 Share

Recommended Posts

Hi TESA!

 

Is there a way to access a variable that has been defined in another script? I need to get an object from another script so I can enable it with this one.

 

I need to get this variable I called Current Campfire in this script:

 

string CurrentCampfire = "null"

Event OnTriggerEnter(ObjectReference akActionRef)
	Actor actorRef = akActionRef as Actor
	if(actorRef == game.getPlayer())
		ShelterLocationMessage.Show()
		IsInsideArea.SetValue(1) ;True
		CurrentCampfire = Campfire
	EndIf
EndEvent

 

And I want to use it in this one like this:

 

ObjectReference InitialCampfire = aBleakShelterMessage.CurrentCampfire

Function SecondMenu()
	int ibutton2 = FlintstoneMenu2.Show()
	if (ibutton2 == 0)
		InitialCampfire.Enable()
	EndIf
EndFunction

 

 

It is meant to get the campfire object that is a property in the first script so that it can make it visible....

Link to comment
Share on other sites

  • 3 weeks later...

You can always try use a global variable.

 

Make the new global under the Object Window under Miscellaneous / Global in the creation kit.

 

And put thus,

GlobalVariable Property YourGlobalVariable auto

Into each of your scripts to use/set/get the variable. You'll need to configure the global variable in the script properties window as well.

Edited by Cerest
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...