Jump to content

How can I make a perk change a global variable?


Omeletter

Recommended Posts

I'm working on a mod, nearly finished, and all I need to do is to have this perk change a couple global variables. I have no idea how to do this, and I didn't find much help on Google.

 

This perk is the vanilla's "Green Thumb". I think it would work like this - "Perk -> Run Script -> change Global Variables". I already created the needed global variables, and they worked, now I just need a script that changes the global variables to the numbers I need, if I have got the perk. Remember, the script needs to change multiple global variables at the same time!

 

I think that this script needs to run when you first install the mod, to check if you already have green thumb perk (and if you have the perk it would change the global variables), and the second time when you get the green thumb perk, e.g. if you level up your alchemy skill and take the perk with the mod already installed.

Edited by Omeletter
Link to comment
Share on other sites

Im feeling a little :hurr: right now. Attach this to your perk and I think it will run the first time you get it. Im a little fuzzy on the details so you will have to do a little work on the script yourself.

Scriptname MyPerkScript extends Perk  
Event Onit()
  Global1.SetValueInt(?)
  Global2.SetValueInt(?)
  Global3.SetValueInt(?)
EndEvent

GlobalVariable Property Global1  Auto  
GlobalVariable Property Global2  Auto  
GlobalVariable Property Global3  Auto

Link to comment
Share on other sites

  • Recently Browsing   0 members

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