Jump to content

Getting PlayerPayCrimeGold to work?


BangBangYouAreDead

Recommended Posts

Currently working on an update for my mod Gunners Overhaul. I've set a Crime faction for the Gunners which tracks crime gold, and I want to set up an NPC who you can pay the crime gold to and thus reset the crime with the Gunners faction.

 

I have the NPC set up with a relevant quest (see image attached). I run the following script:

 

Scriptname GunnerResetCrimeGold extends TopicInfo
{CrimeGunnerFaction.PlayerPayCrimeGold(abRemoveStolenItems=True)
CrimeGunnerFaction.SetAlly(Player, true, true)
GunnerFaction.SetAlly(Player, true, true)
CrimeGunnerFaction.SetPlayerExpelled(false)
GunnerFaction.SetPlayerExpelled(false)}
Faction Property pCrimeGunnerFaction Auto Const Mandatory
Faction Property pGunnerFaction Auto Const Mandatory
ActorBase Property pPlayer Auto Const Mandatory

But nothing happens. I know the crime gold is there because the CanPayCrimeGold condition on the NPC dialogue works. What am I missing here? I'm going crazy over this! Please help!

http://i1286.photobucket.com/albums/a617/bcampbell112233/overhaulcrimegold_zpsnmprsqfy.png

Update: Trying to 'player.paycrimegold 0 0 CrimeGunnerFaction' via the console in-game returns that 'CrimeGunnerFaction' is not acceptable for the Faction (Optional) part of the command. Does this mean the faction isn't being located properly? Anyone know how to fix this?
Update 2: Running the script as a Papyrus fragment on end doesn't seem to help. Going to try 'CrimeGunnerFactionProperty.PayCrimeGold()' and see what happens.
Update 3: Well, that didn't work either, but I figured out you have to use the Faction ID and not the Faction name. My new faction still isn't being found for some reason. This is horribly frustrating.
Update 4: In case anyone runs into the a similar issue, I think I've got it.
1. Create your CrimeFaction and NPC. Don't add the CrimeFaction to the NPC.
2. Add some dialogue where they ask the player to pay the crime gold.
3. On the acceptance response, run the following fragment at the beginning of the Topic Info:
akSpeaker.AddToFaction(pMyCustomCrimeFaction)
akSpeaker.SetCrimeFaction(pMyCustomCrimeFaction)
ensuring you set MyCustomCrimeFaction as a property.
4. Then run the following fragment at the end of the Topic Info:
akSpeaker.GetCrimeFaction().PlayerPayCrimeGold(True, False)
akSpeaker.GetCrimeFaction().SetAlly(pPlayerFaction, true, true)
akSpeaker.RemoveFromFaction(pMyCustomCrimeFaction)
ensuring you set PlayerFaction as a property.
All done! Hope this helps somebody if you're trying to do something similar.
Edited by BangBangYouAreDead
Link to comment
Share on other sites

  • Recently Browsing   0 members

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