Jump to content

SM Event Crime Gold Help


RedxYeti

Recommended Posts

Ive made a mod that gives xp when you fail a pickpocket that relies on the SM Event Crime Gold Event

 

I have everything set up correctly in the event node, and the quest triggers when it should. It doesn't have any conditions, I used code for the rest.

 

 

Here's the gist of the code

Event OnStoryCrimeGold(ObjectReference akVictim, ObjectReference akCriminal, Form akFaction, int aiGoldAmount, int aiCrime)
 
	If aiCrime == 1 ;pickpocketing


		If playerref.getav("Pickpocket") <= 15 ;checks player pickpocket level


			Game.AdvanceSkill("Pickpocket", 10) ;adds skillpoints


		Endif

	Endif

Utility.Wait(2)

Reset()

EndEvent

SO my problem is, sometimes if you fail a pickpocket and holster your weapons, the npcs decide to forgive you. If they forgive you the crime gold event doesn't trigger until you pay your debt.

 

 

 

 

Is there a better way to trigger this? or am I just kinda stuck with this weird quirk of npc behavior and the node being triggered?

Link to comment
Share on other sites

I have a new idea, removing the event node and doing something like

Event OnInit()

	RegisterForSingleUpdate(1)

EndEvent




Event OnUpdate()

 if  (IsPlayerActionActive 11)
		
	RegisterForMenu("Inventory Menu")

but I don't know how to use IsPlayerActionActive correctly in an if statement

Link to comment
Share on other sites

IsPlayerActionActive is a condition function. It can be used on magic effects and any other record with conditions. It cannot be used directly in papyrus.

 

You may just have to deal with the oddity in your first post.

 

Thanks for the info, ive decided to leave that sm event node as a light version and went with this for the full version:

Event OnUpdate()

	If PlayerRef.IsInCombat() == 1 ;Cant Pickpocket in Combat

		RegisterForSingleUpdate(2)

	Else

		If PlayerRef.IsSneaking() == 1 ;Checks if player is sneaking

			RegisterForMenu("Dialogue Menu") ;Listens for Dialogue menu
			RegisterForMenu("ContainerMenu") ;Listens for containermenu
			RegisterForSingleUpdate(0.2)
	
		Elseif PlayerRef.IsSneaking() == 0 ;Checks if player isnt sneaking

			RegisterForSingleUpdate(0.2)
			UnRegisterForMenu("ContainerMenu") 
			UnRegisterForMenu("Dialogue Menu")

		Endif

	Endif

EndEvent



Event OnMenuClose(String MenuName)

	If MenuName ==  "ContainerMenu" 

		Utility.Wait(0.7)

		If PlayerRef.IsInCombat() == 1 || UI.IsMenuOpen("Dialogue Menu")  ;Checks if the player is in combat after closing the container menu, or if player is talking to a guard

and then the skill adds ofc

Link to comment
Share on other sites

  • Recently Browsing   0 members

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