Can GetIsUsedItem be used with IsInList

Post » Tue May 17, 2011 5:12 am

I've made a series of formlists and I've made a series scripts to make stuff happen when something from any of those lists gets used. Now I've run into the issue of how to determine when an item is used that is found in one of those lists. I wrote out the whole script with Player.GetIsUsedItem.IsInList ItemList1 without stopping to check my syntax. This obviously doesn't work. I'm sure there is a very simple answer but I'm not seeing it.
User avatar
Angel Torres
 
Posts: 3553
Joined: Thu Oct 25, 2007 7:08 am

Post » Tue May 17, 2011 11:30 am

So I'm guessing that the answer is not as simple as I thought. That makes me feel a bit better, I think.

I'll be switching my scripts to something like:

if player.GetItemUsed 1stItem == 1
Do Cool Stuff 1
if player.GetItemUsed 2ndtItem == 1
Do Cool Stuff 1
if player.GetItemUsed 3rdItem == 1
Do Cool Stuff 2
if player.GetItemUsed 4thItem == 1
Do Cool Stuff 2

That should work.
User avatar
Cameron Garrod
 
Posts: 3427
Joined: Sat Jun 30, 2007 7:46 am

Post » Tue May 17, 2011 6:34 am

Some functions that accept an object can be passed a list instead, e.g. player.GetItemCount MyList.
Alternatively you could iterate through your list with FOSE and check GetItemUsed EachObject in one loop, to make it easier to expand.
User avatar
Pumpkin
 
Posts: 3440
Joined: Sun Jun 25, 2006 10:23 am

Post » Tue May 17, 2011 2:23 am

Forgive me, I'm not all that familiar with the ins and outs of FOSE. Would I have to use something like ListGetNthForm?

ListGetNthForm List1 1
ListGetNthForm List1 2
ListGetNthForm List1 3
Do Stuff
ListGetNthForm List2 1
ListGetNthForm List2 2
Do Stuff

Or is there some other command I need to look at?
User avatar
sam westover
 
Posts: 3420
Joined: Sun Jun 10, 2007 2:00 pm


Return to Fallout 3