Jump to content

My Papyrus script is reading out a rule func0, please help


RowanSkie

Recommended Posts

I managed to merge the three codes we made! Now, since I managed to pinpoint which potions need this thing, I'm up to adding it. At least it's a few.

 

Here's the whole thing.

 

I think I didn't do well.

Scriptname rep_keyObject Extends ObjectReference

Group Properties
	MiscObject Property rep_tinkey Auto Const Mandatory
	Keyword Property rep_canration Auto Const Mandatory
  Message Property rep_tinkeyuse Auto Const Mandatory
EndGroup

Event OnEquipped(Actor AkActor)
  if AkActor.GetItemCount(rep_tinkey) > 0
    rep_tinkeyuse.Show()
    AkActor.RemoveItem(rep_tinkey)
    Debug.Trace("C-Ration opened with key.")
  Elseif AkActor.GetItemCount(rep_tinkey) == 0
    AkActor.DamageValue(Game.GetHealthAV(), 10)
    Debug.Trace("C-Ration opened without key.")
  endif
EndEvent


Random assignment of Actor, ;-;

 

EDIT: And it turns out Potions don't get Scripts. *facepalm*

Edited by RowanSkie
Link to comment
Share on other sites

I think you did well. Maybe check that the actor is the player and not some random NPC.

Scriptname rep_keyObject Extends ObjectReference
{Attach this to each of your potions.}

Group Properties
	MiscObject Property rep_tinkey Auto Const Mandatory
	Keyword Property rep_canration Auto Const Mandatory
	Message Property rep_tinkeyuse Auto Const Mandatory
EndGroup

Event OnEquipped(Actor AkActor)
	If (akActor == Game.GetPlayer()) ; you dont want an NPC to trigger a message in the players face
		if AkActor.GetItemCount(rep_tinkey) > 0
			rep_tinkeyuse.Show()
			AkActor.RemoveItem(rep_tinkey)
			Debug.Trace("C-Ration opened with key.")
		Elseif AkActor.GetItemCount(rep_tinkey) == 0
			AkActor.DamageValue(Game.GetHealthAV(), 10)
			Debug.Trace("C-Ration opened without key.")
		endif
	EndIf
EndEvent

Attach to your potions and I think your good to go.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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