Jump to content

[LE] Help with Papyrus Fragments and Perk Scripting


Recommended Posts

Inspired by my currently smooth playthrough with the Playable Monster Mod, I've been wanting to add some more gameplay depth on my end. One feature of my mod was to enable playable predator animals to feed on corpses. I have a beginner's understanding of papyrus, but I thought with wiki resources and the cannibal/werewolf feeding script as examples that this was something I could do by myself, but I've fallen short.

 

Like the werewolf process, I've created a function (AnimalPredation) within a script (_MR_PredatorFeedingScript) that I've attached to a quest (_MR_PlayerMonsterQuest). The script simply prompts the animation and VFX, and it compiled without issue. I then defined the properties in the creation kit. Here is said script.

 

Scriptname _MR_PredatorFeedingScript Extends quest
Idle property _SabreCatFeeding auto
Spell property BleedingFXSpell auto
Function AnimalPredation(Actor victim)
Game.GetPlayer().PlayIdle(_SabreCat_Feeding)
BleedingFXSpell.Cast(victim,victim)
EndFunction

 

My next step was to attach the script to a perk, because ostensibly that is how both existing feeding abilities work. The papyrus fragment of the final perk entry point for the werewolf version reads as: (PlayerWerewolfQuest as PlayerWerewolfChangeScript).Feed(akTargetRef as Actor), so I thought I would be able to do the same. My fragment was written as...

 

(_MR_PlayerMonsterQuest as _MR_PredatorFeedingScript).AnimalPredation(akTargetRef as Actor)

 

Trouble is I get two errors. The first problem is that the _MR_PlayerMonsterQuest was "undefined", so a "none" value is being sent to the _MR_PredatorFeedingScript, thus consequently their "types are incompatible". Perhaps I made a mistake with the casting, but I admit I'm out of my depth here, so if there is anyone that would be able to share any insight on what I could do, I'd appreciate it.

Link to comment
Share on other sites

That would fix the problem, but I am ashamed to say I'm unsure as to how I'd go about doing that! I was under the impression that I'd need the code to compile first, before I would be able to allocate properties to the perk's script fragment. There seems to be a lack of tutorials on the subject of applying scripts to perks.

 

That said, I did try to declare my property at the start of the fragment i.e. quest property _MR_PlayerMonsterQuest auto. I got a different error instead "Unable to write source in a temporary location."

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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