Jump to content

How do I track the total player bounty from all crime factions?


nhackett

Recommended Posts

I'm completely stumped. I'm attempting to create a quest that involves tracking the total lifetime bounty of the player from all factions. To do so I want to step through each element of the formlist 'crimeFactionList'.

 

I'd greatly appreciate anyone that is able to explain what needs to fill the '???'.

...

Event OnInit()
    RegisterForSingleUpdate(60.0)
EndEvent

Event OnUpdate()
	int crimeGold = 0
	Int iElement = crimeFactionList.GetSize()
	Int iIndex = 0
	??? crimeFactionList = ??? ; should this be set as a script proprty? How do I declare a form list property?

	While iIndex < iElement
		??? = crimeFactionList.GetAt(iIndex) ; What type of variable can hold this value?
		crimeGold = ???.GetInfamy() + crimeGold ; This ??? should be the variable from the previous line
		iIndex += 1
	EndWhile

	debug.MessageBox("Total Player Infamy: " + crimegold)

	RegisterForSingleUpdate(updateInterval)
EndEvent

...
Link to comment
Share on other sites

You create a formlist property like any other property:

 

FormList property MyList auto

 

To get the length of your formlist, use MyList.GetSize()

 

GetAt will return a form, but you probably want a faction variable. So you should make a faction variable (MyFaction) and say:

 

MyFaction = MyList.GetAt(iIndex) as faction

 

However, you can get the PC's total lifetime bounty using the function:

 

Game.QueryStat("Total Lifetime Bounty")

Edited by lofgren
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...