Update: so you can do math operations on ref instead of long and it almost seems to be behaving as a 32bit unsigned integer... except the bit operations seem to be choking still... see post below.
Does anyone have any experience generating 32bit unsigned longs for use as reference IDs in an Oblivion script?
I'm currently getting crapped on by the script engine. For More-Armor-Slots, I am doing bit arithmetic to generate a 32bit unsigned number that I then convert to a ReferenceID. Unfortunately, OBSE/Oblivion Script does not natively support unsigned long, so I'm try to manipulate a signed long so it turns into the bit-equivalent of the 32bit unsigned long value I want so I can convert into a RefID. Example:
If I try to generate 7F00:13E1 (which uses 31 bits and leaves the 32nd bit = 0) OBSE handles the number perfectly and I can pass it to pluggy to create a Reference ID.
If I try to generate FF00:13E1 (the 32nd bit is now = 1) OBSE will now do stupid things like trying to print out a 64bit hex string when I specify formating for 32bit hex string and it is always the following string no matter what the actual result of my math should be: FFFFFFFF80000000.
I'm about to look through the OBSE source code, but wanted to ask here just in case this is something that's been solved years ago.