KingsGambit Posted April 10, 2012 Share Posted April 10, 2012 Hi all, I'm working on something at the moment but am having some trouble with the scripting. Neither the wiki nor Google are proving very helpful here so I was hoping to pick some brains. I would love some advice with any of the following: I'm basically having trouble with the GetCrimeGold function. My code is as follows: Scriptname GetCrimeGoldScript extends ObjectReference Float PCCrimeGold FormList property CrimeFaction auto ObjectReference CurRef int CurIndex int ArrayLength Event OnEquipped(Actor akActor) If (akActor == Game.GetPlayer()) ArrayLength = CrimeFaction.GetSize() CurIndex = 0 While CurIndex <= ArrayLength CurRef = (CrimeFaction.getat(CurIndex)) PCCrimeGold = Game.GetPlayer().GetCrimeGold CurRef CurIndex += 1 EndWhile EndIf EndEvent The formlist is set to CrimeFactionsList. It simply won't compile as it won't treat my property "CurRef" as a faction ID. I would greatly welcome any ideas, with my thanks in advance. Link to comment Share on other sites More sharing options...
fg109 Posted April 10, 2012 Share Posted April 10, 2012 Scriptname GetCrimeGoldScript extends ObjectReference Float PCCrimeGold FormList property CrimeFaction auto Faction CurRef int CurIndex int ArrayLength Event OnEquipped(Actor akActor) If (akActor == Game.GetPlayer()) ArrayLength = CrimeFaction.GetSize() CurIndex = 0 While CurIndex < ArrayLength CurRef = CrimeFaction.getat(CurIndex) as Faction PCCrimeGold = CurRef.GetCrimeGold() CurIndex += 1 EndWhile EndIf EndEvent Link to comment Share on other sites More sharing options...
KingsGambit Posted April 10, 2012 Author Share Posted April 10, 2012 Scriptname GetCrimeGoldScript extends ObjectReference Float PCCrimeGold FormList property CrimeFaction auto Faction CurRef int CurIndex int ArrayLength Event OnEquipped(Actor akActor) If (akActor == Game.GetPlayer()) ArrayLength = CrimeFaction.GetSize() CurIndex = 0 While CurIndex < ArrayLength CurRef = CrimeFaction.getat(CurIndex) as Faction PCCrimeGold = CurRef.GetCrimeGold() CurIndex += 1 EndWhile EndIf EndEventThank you very much, fixed my issue with declaring the property and calling the function too :) Will calling CurRef.GetCrimeGold() return the player's crime gold toward the specified faction then? I had assumed I needed to reference the player there. Link to comment Share on other sites More sharing options...
KingsGambit Posted April 10, 2012 Author Share Posted April 10, 2012 Is there a way to reference an npcs crimegold value, or does such not exist? Link to comment Share on other sites More sharing options...
fg109 Posted April 10, 2012 Share Posted April 10, 2012 There's no way that I know of to reference an NPC's crime gold. I'm not sure that they even have bounties. Link to comment Share on other sites More sharing options...
Recommended Posts