Dynamically Merging FormLists

Post » Sun Feb 06, 2011 5:37 am

Let's say I create a custom FormList to use in my script and I want dynamically (in the script's initialization block) merge in the items from some of Bethesda's (well, Obsidian's) other predefined FormLists. Is that possible?

In other words, I want to make the following call:

AddFormToFormList MyCustomList AlcoholicDrinks

Now, the above doesn't work--I tried it--but I was hoping maybe there was another simple way to do this. Ugly way: Use a Label/Goto loop and add each item in AlcoholicDrinks one at a time.

(And, no, to be upfront, there's no real reason I need to do this dynamically as opposed to just adding the items to my custom FormList statically in GECK. I just want to know if the above is doable since I prefer doing things dynamically rather than statically.)
User avatar
Jessica Colville
 
Posts: 3349
Joined: Wed Oct 18, 2006 6:53 pm

Post » Sun Feb 06, 2011 4:07 am

Follow-Up Question:

set nItemValue to (GetValue NCRMoney100)

The above will set nItemValue to 40. Now, throw NCRMoney100 into some custom FormList and get a reference to that item in the FormList, e.g.,

set refItem to (ListGetNthForm CustomList 0)

(assume NCRMoney is at index 0 in CustomList)

How do I get the value of that item?

set nItemValue to (GetValue refItem)
~and~
set nItemValue to refItem.GetValue

...both set nItemValue to 0. (And the reference is valid. I can print out its name (printc "%n" refItem), so that's not the problem.)


Never mind. GetValue works fine with the FormID I get from my FormList in another section I have going on in my script, so something else is the problem.

BTW, with NVSE's printc function, how does one print an integer in Base10??? Whenever I use %d, I get out zeros; when I use %x as the format specifier, it prints fine, but, of course, it's in hexadecimal (Base16) format. Answer: use "%.0f" Why: because all the parameters are converted to floats
User avatar
Klaire
 
Posts: 3405
Joined: Wed Sep 27, 2006 7:56 am


Return to Fallout: New Vegas