Jump to content

[LE] [Help] Setting GlobalVariable Properties in Payprus.


Recommended Posts

You make a property:

 

GlobalVariable Property MyGlobal Auto

 

And somewhere in your Script you can change the value:

 

MyGlobal.SetValue(myValue in decimal form)

 

Be sure to fill your properties:

 

http://skyrimmw.weebly.com/skyrim-modding/how-to-fill-properties-skyrim-modding-tutorial

Link to comment
Share on other sites

Globals have little write use outside of a script, the main purpose is typically use it across scripts and dialogue as a read variable, occasionally writing to reflect condition changes (i.e. Lights are On, Lights are Off, Lights are on but Generators are off, etc). I do have to say when I was writing a music play control script for Mharphin, I discovered Globals cannot be declared negative, if you are trying to utilize a negative value. Only 0 - 32-bit-max-value work for a Global.

 

Make sure you don't flag the Global as constant also, it will not allow for change if you do.

Link to comment
Share on other sites

Sorry that wasn't clear. So you declare with a property in the script, and in the properties tab of the script, you can navigate to the particular global you are using. Alternatively if you name the global property in the script with the exact name in the editor window, you can Auto-Fill your property.

 

It is not possible to be dynamic on assigning globals within the script itself, and you must use the built in property tools.

Edited by Arron Dominion
Link to comment
Share on other sites

Not necessarily true, you can use Game.GetFormFromFile() as GlobalVariable. and set it that way. Its just not the most ideal way to do it. And you can change constant global variables, but it will only stay changed for your current play session.

Link to comment
Share on other sites

  • 6 years later...

Make sure you don't flag the Global as constant also, it will not allow for change if you do.

Yeah I know it's an old thread, but I found this thread and it helped. But constant globals CAN be changed in game. But they don't persist between gaming sessions, they revert to whatever their value is in the ESP at each game start. This is great for running something once at the start of each session; just check the variable, and if it's the vanilla value then do something and afterward set it to a nonvanilla value.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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