Does any of you know if there exists a script function (vanilla or NVSE) which receives a reference/base object and returns a numeric, decimal value, representing its FormID?
I went through the NVSE documentation, up to the latest 3b2, but so far could not find one.
FormID of a reference
Posted 11 March 2013 - 02:44 PM
Posted 11 March 2013 - 11:16 PM
No, there are no functions that return a FormID in decimal. I'm curious why you would want a deximal-converted FormID.
Posted 12 March 2013 - 01:57 AM
Indeed, you are right to be curious.
I am modifying a few properties of an object (a weapon), and need to make sure that in case the player loads a saved game before those properties could be reset to their default values, the reset will be completed immediately when the game loads. The idea was to get the object's FormID, along with the index of the file it came from, store them in a global constant, then, on the loaded session, use both to reconstruct the base object (using BuildRef).
At the moment, I'm using a Form List to store the base object and pass it between sessions, which works quite well, but is a bit awkward. I just wondered if there was another, neater way of doing it.
Posted 12 March 2013 - 01:03 PM
That does sound complex, and I'm not sure I follow it completely. I figured you wanted the ID in decimal for BuildRef, but I don't know of a way you can even access a FormID itself as a variable to perform a mathematical conversion.
My confusion was centered around needing to build a reference to something you already have access to a reference of.
Posted 12 March 2013 - 05:05 PM
Don't the stats of weapons (and other items) reset to their editor defaults upon game reload? Things like changing ammo lists, names etc all revert back. Or are you referring to loading a save in an existing instance of the game?
Posted 12 March 2013 - 07:26 PM
I don't know of a way you can even access a FormID itself as a variable to perform a mathematical conversion.
The %i format specifier can be used to print the FormID of a passed reference, so it is at least partially accessible. I guess the NVSE team never thought a function returning a FormID would be very useful to anyone, and therefore never implemented one.
Or are you referring to loading a save in an existing instance of the game?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users