Need scripting help with duplicate Vampire Feed Perk.

Post » Sun Oct 26, 2014 9:15 am

Non-TLDR Version: Here's my goal... Duplicate the vanilla Vampire Feed Perk, assign it a unique script almost identical to the vanilla one, only make it's hardcoded properties point to ALectraVvardenfellVampireQuest, and AAVvardenfellVampireFeed, instead of the vanilla perk and vanilla vampire quest. If someone could please give me any advice what to do about this dilemma I'd be extremely thankful and really appreciate it.

I know what's in the way of my mods progress... It's the fact, that even though I was able to make a duplicate of the VampirePlayerQuest and change the scrip properties of the new quest to entirely new spells and abilities, (and it even partially working)... That the VampireFeedPerk is giving me lots of trouble. Well I duplicated VampireFeedPerk, I didn't change VampireFeedPerk itself. The custom quest I made with it's properties is working perfectly- messages, spells, abilities, stages, and everything, but the problem all lies within my VampireFeedPerk.

I even altered the VampirePlayerQuest, so it mentions you get stronger from feeding rather than weaker, (These are Vvardenfell/Morrowind vampires who are described as becoming weaker from not feeding in ingame lore, not Oblivion or Skyrim vampires who become stronger from not feeding- some way the Skyrim/Oblivion variety become closer to being daedra like from not feeding, which is why their feeding lorewise is so different- anyways entirely different subject).

If I wanted to actually alter the default VampireFeedPerk, it would be a lot easier, but for compatibility reasons, and not wanting to alter Volkihar vampires, I don't want to do that.

Yet it seems like my duplicate version of the VampireFeedPerk AAVvardenfellVampireFeed is quite simply, HARDCODED to use properties from the original VampirePlayerQuest, as well as to activate message boxes I wish it didn't, because it mentions becoming weaker from feeding (contradicting any immersion factor of my mod), and ON TOP of that, I didn't even have FROST RESISTANCE and other Volkihar specific bonuses applied BEFORE feeding (So somehow my duplicate ID perk is adding spells I don't want it to)... What's really jarring though, is the fact that even though I replaced both message properties with my own in the custom Quest, they either don't show up when feeding or show up alongside the vanilla one.

I want to add a NEW VampireFeedPerk, one that doesn't alter or effect the vanilla VampireFeedPerk. Here's some scripts related to VampireFeedPerk, or rather the script the DUPLICATE Perk has attached to it. More specifically here is my question, what's the best way to make a unique ID duplicated copy pasted version of this script? What bits would I copy and where? And how would I make this duplicate version of the script, instead point to the quest I made, INSTEAD of the vanilla VampirePlayerQuest?

After I saw this thread I thought I had my answer. http://www.gamesas.com/topic/1348984-vampireplayerquest-script-not-loading/?hl=%2Bvampirefeed#entry20326529

"n the perk fragment, you can edit the source and add your property at the very bottom. Pay attention to the comments there and do NOT edit anything between them. Then go to the Entry Point fragment and replace "PlayerVampireQuest.VampireFeed()" with your own version of it. Edit: make sure you leave Game.GetPlayer().VampireFeed(akTargetRef) there... that's what triggers the animation."

I thought I had my solution there, that all I had to do was copy paste a nearly identical script after removing the old one from this perk, and just replace the Quest/Perk it mentions with my own custom versions. So I instead, deleted the script from the duplicate perk, and under Perk Entry in Papyrus Fragment put this in...

Game.GetPlayer().StartAAVvardenfellVampireFeed(aktargetRef as actor)ALectraVvardenfellVampireQuest.AAVvardenfellVampireFeed()

However, it didn't work at all, it failed to compile... Any idea why it failed? Also below here is what the duplicate perks script copied directly from the vanilla version looks like if I don't do that.. Fortunately it doesn't effect the vanilla version but it still looks buggy. And trying to replace it with anything I can come up with, just causes it to become entirely non functional.

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 10Scriptname PRKF__040C5E29 Extends Perk Hidden;BEGIN FRAGMENT Fragment_15Function Fragment_15(ObjectReference akTargetRef, Actor akActor);BEGIN CODE;WARNING: Unable to load fragment source from function Fragment_15 in script PRKF_VampireFeedBeds_000CF02C;Source NOT loaded;END CODEEndFunction;END FRAGMENT;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akTargetRef, Actor akActor);BEGIN CODEGame.GetPlayer().StartVampireFeed(aktargetRef as actor)PlayerVampireQuest.VampireFeed();END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentPlayerVampireQuestScript Property PlayerVampireQuest  Auto  

Here is the script of the original Vampire Feed Perk.

;BEGIN FRAGMENT CODE - Do not edit anything between this and the end comment;NEXT FRAGMENT INDEX 10Scriptname PRKF_VampireFeedBeds_000CF02C Extends Perk Hidden;BEGIN FRAGMENT Fragment_0Function Fragment_0(ObjectReference akTargetRef, Actor akActor);BEGIN CODEGame.GetPlayer().StartVampireFeed(aktargetRef as actor)PlayerVampireQuest.VampireFeed();END CODEEndFunction;END FRAGMENT;END FRAGMENT CODE - Do not edit anything between this and the begin commentPlayerVampireQuestScript Property PlayerVampireQuest  Auto  
User avatar
Ridhwan Hemsome
 
Posts: 3501
Joined: Sun May 06, 2007 2:13 pm

Post » Sun Oct 26, 2014 6:27 am

The main things that are hardcorded is HasBeenEaten and GetVampireFeed condition functions.

The problem here is how you set up the perk script.

You sound upset in your post. Please confirm if I'm right, so I'm not misreading:

You want YOUR OWN VERSION of the VampireFeed Perk function?

You DO NOT WANT the vanilla feed message to display when feeding?

Both of those are easily accomplished, you don't need to use the vanilla vampire script.

I will go through this and I need you to tell me if I'm going in the right direction.

Now on to the perk.

Let's call your perk LectraVampireFeedPerk

Delete the Vanilla Perk script on the duplicate.

NOTE: If you cannot add a new perk script, even in the Perk Entry point, you must save the perk first, close it and open it again.

Create New one(you have to go in the perk entry point) with the following code:

Game.GetPlayer().StartVampireFeed(aktargetRef as actor)

STOP HERE.

Save the perk, close it.

Open it back up. The perk script should now be added. Now add your quest property to it.

Quest property ALectraVvardenfellVampireQuest auto

Go back to the entry point where you placed the StartVampireFeed() function at and add this line:

(ALectraVvardenfellVampireQuest as ALectraVvandenfellVampireQuestScript).AAVvardenfellVampireFeed(); Or whatever your quest script's name is.

So it should now look like:

Game.GetPlayer().StartVampireFeed(aktargetRef as actor)(ALectraVvardenfellVampireQuest as ALectraVvandenfellVampireQuestScript).AAVvardenfellVampireFeed()

Note: If your problem is due to StartVampireFeed(), you cannot get around it. It's a native function.

User avatar
KU Fint
 
Posts: 3402
Joined: Mon Dec 04, 2006 4:00 pm

Post » Sun Oct 26, 2014 2:24 am

One other thing..

Your Quest script needs to have it's own VampireFeed function - this will enable you to not rely on the vanilla script AT ALL. It has to be similar to the PlayerVampireQuestScript version, except you need to change the message properties to point to your feed messages. And make any other changes you need. Make this the FIRST THING YOU DO before trying out any of the above.

And any compile errors you get, please post them.

User avatar
NeverStopThe
 
Posts: 3405
Joined: Tue Mar 27, 2007 11:25 pm


Return to V - Skyrim