Skip to content

How can a script tell if it is running under NWN:EE?

pscythepscythe Member Posts: 116
edited June 2018 in Builders - Scripting
Is there a function to tell if a you're running under EE?
So that we can do something like:

If (RunningUnderEE()) {
	// do new stuff
} else {
	// do old stuff
}

Comments

  • NeverwinterWightsNeverwinterWights Member Posts: 339
    edited June 2018
    Only thing I can think of to do would be to try something in scripting that only EE can do but 1.69 can't. Off the top of my head for example, the max item charges on an item in 1.69 is 50 but in EE it's 250. So if you SetItemCharges on an item to 51 and then use GetItemCharges, if it's still 50 you are in an old version but if greater than 50 you are in EE version. Something like that. There may be an easier method with a different function that has a different return value now or something else similar.
  • pscythepscythe Member Posts: 116

    Only thing I can think of to do would be to try something in scripting that only EE can do but 1.69 can't. Off the top of my head for example, the max item charges on an item in 1.69 is 50 but in EE it's 250. So if you SetItemCharges on an item to 51 and then use GetItemCharges, if it's still 50 you are in an old version but if greater than 50 you are in EE version. Something like that. There may be an easier method with a different function that has a different return value now or something else similar.

    Thanks. That will do nicely since I won't be checking that often so it is not a problem to spawn an item, set the charges, then destroy it.
  • NeverwinterWightsNeverwinterWights Member Posts: 339
    edited June 2018
    You could also just do it once and then set a variable on the module based on the results. Then the scripts can just check that variable instead of the hassle of spawning, setting charges and destroying every time.
Sign In or Register to comment.