Jump to content

Reference Actor in Script?


GomuGomu64

Recommended Posts

I'll try to keep this as simple as possible.

 

I'm trying to make a quest for a custom NPC of mine. After a certain topic (In this case, the last one) is clicked, the player loses money and the NPC that is being talked to, has it's and the player's relationshiprank set to 3.

 

Picture of what I've scripted :

 

http://oi43.tinypic.com/a2stt.jpg

 

I've refenced "Merc" in Quest Alias as AAAMedilo (My custom NPC). Thing is, when I click "Compile" In the Papyrus Fragment section, I get given this :

 

Starting 1 compile threads for 1 files...
Compiling "TIF__010012EB"...
C:\Program Files\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\TIF__010012EB.psc(9,11): a property cannot be used directly on a type, it must be used on a variable
C:\Program Files\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\TIF__010012EB.psc(9,11): RemoveGoldPlayer is not a property on script removegold or one of its parents
No output generated for TIF__010012EB, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__010012EB

 

Here's the script :

 

Scriptname RemoveGold extends Quest  

Int Property PlayerGold Auto
MiscObject Property pGold Auto

Function RemoveGoldPlayer(Actor Merc)

If Merc.GetRelationshipRank(Game.GetPlayer()) == 0
	Merc.SetRelationshipRank(Game.GetPlayer(), 3)
EndIf

PlayerGold = (1000)

Game.GetPlayer().Removeitem(pGold, PlayerGold)

EndFunction

 

I've looked at other quests that might do what I wanted, and their Papyrus Fragment section pretty much looks like what I have in mine.

 

Anything I'm doing wrong?

 

Thanks in advance.

Link to comment
Share on other sites

Try RemoveGold.RemoveGoldPlayer(akSpeaker) in your script fragment.

 

Gah. I can see where your coming from, but I then get this error :

 

Starting 1 compile threads for 1 files...
Compiling "TIF__010012EB"...
C:\Program Files\The Elder Scrolls V Skyrim\Data\Scripts\Source\temp\TIF__010012EB.psc(9,11): cannot call the member function RemoveGoldPlayer alone or on a type, must call it on a variable
No output generated for TIF__010012EB, compilation failed.

Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on TIF__010012EB

 

"must call it on a variable" Humm. Haven't the faintest clue how to do that, especially with what I'm trying to do :wallbash:

Link to comment
Share on other sites

  • Recently Browsing   0 members

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