Script Help for Werewolf Coding

Post » Sun May 18, 2014 10:36 am

I've been tinkering with a mod that makes vampires resurrect unless they are killed with silver or Dawnguard weapons. This is accomplished by a self-cast magic effect that a vampire will do to itself on dying when killed by a person wielding those weapons, and an else statement for another self cast magic effect that lets them resurrect if not killed that way. My problem is that I would like to make vampires killable by werewolves, and when in beast form a werewolf cannot wield those weapons.

While it's true that I can just grant a keyword or perk for the game to recognize a player in beast form as being equipped with silver or Dawnguard weapon, I would rather not treat werewolf claws as silver weapons. Instead, I'd specifically I'd like to make a werewolf stop the magic reanimation effect of the vampire by using the "feed" process to chew up the vampire's heart. My problem is, I don't know what flags the CK uses to mark an NPC corpse as "already fed" on, nor what it uses to mark a corpse as feedable by werewolves. By default, werewolves cannot feed on undead or animals, but the Savage Feeding perk allows them to feed on animals, eventually. I've tried looking at the savage feeding perk to see what it flags for animals that allows them to be fed on with the hopes that I can do the same for vampires, but I can't make sense of the script.

Does anyone know a way I can script to allow a werewolf to feed on a vampire, flag it as fed, and then use an if statement to stop the magic effect that reanimates the vampire?

User avatar
Joe Alvarado
 
Posts: 3467
Joined: Sat Nov 24, 2007 11:13 pm

Post » Sun May 18, 2014 8:15 am

Not had too much experience with Werewolves, but look under the feeding perk-- there's a "Filter Activation", and an "Activate" entry point, if memory serves; you *should* in theory be able to set it up so that normal Werewolf Feeding ignores Vampire-Keyworded NPCs, and then make one that covers them-- mimic the effects of the normal Activate EntryPoint, but add in your trigger.

So, your werewolves would have two feeding perks-- the default one, edited to not work on Vampires, and your one designed to work only Vampires, and do a bit more before reminding the game that it should do its thing.

As I say, not much experience with werewolves, but it should work in theory.

Edit : Checked, and adding "HasKeyWord Vampire == 1" to the three Filter Activations on the PLayerWerewolfFeed Perk seems to work without a problem, so that should give you a start, I think? :)

User avatar
gary lee
 
Posts: 3436
Joined: Tue Jul 03, 2007 7:49 pm

Post » Sun May 18, 2014 9:09 am

See what you can do with this function:

Function Feed(Actor victim)    Game.GetPlayer().PlayIdle(SpecialFeeding)    FeedBoost.Cast(Game.GetPlayer())    victim.SetActorValue("Variable08", 100)EndFunction
User avatar
Marie Maillos
 
Posts: 3403
Joined: Wed Mar 21, 2007 4:39 pm

Post » Sat May 17, 2014 11:58 pm

Hey hey, fantastic, guys. Let me see what I can do with those. I was looking in attached scripts instead of just under the plain perk window.

User avatar
BethanyRhain
 
Posts: 3434
Joined: Wed Oct 11, 2006 9:50 am

Post » Sun May 18, 2014 1:17 pm

Oh don't forget to declare the Idle property for SpecialFeeding. Almost forgot to mention that.

I accidentally ran across that function while looking for something else, in the vanilla scripts. It was a huge deal pre 1.6 in getting around the whole "HasBeenEaten" thing.

User avatar
Ludivine Poussineau
 
Posts: 3353
Joined: Fri Mar 30, 2007 2:49 pm

Post » Sun May 18, 2014 5:39 am

I see the filter entries, but why are some of them blank? The others only check for GetisRace Werewolf and HasMagicEffect WerewolfChangeEffect.

I believe the default feeding perk already does not work on vampires or any undead, as well as dragons, atronachs, automatons, etc. - but where is it that those keywords are specified?

User avatar
N Only WhiTe girl
 
Posts: 3353
Joined: Mon Oct 30, 2006 2:30 pm

Post » Sun May 18, 2014 6:37 am

Did you check both types? There's a Subject and Target conditions on separate tabs in the entry point-- if memory serves (not at the CK right now) the Target Conditions are something like "If Actor != 1", "If IsADoor != 1" and "If IsAnActivator != 1" which tells Skyrim to Ignore the Activate option unless the target is an Actor, Door or Activator. It was into this I added the "HasKeyword Vampire == 1" option, to get the test-version running.

User avatar
brian adkins
 
Posts: 3452
Joined: Mon Oct 01, 2007 8:51 am

Post » Sun May 18, 2014 10:14 am

Oh, I see. I found them - thanks.

So there are the entries wherein the game already filters dragons, automatons, daedra, and undead. It's that filter listing right there that prevents feeding on vampires by default, as every vampire has both keywords for vampires and undead. All I need do is delete the entry and werewolves will be able to feed on vampires... but maybe I don't want them to also feed on skeletons. So now my question is, is there a way for me to tell the filter activation to filter undead for feeding upon UNLESS the NPC also has the keyword vampire? Does the priority list have anything to do with that, or will the rule that keyworded undead must be filtered override that no matter what?

User avatar
Heather beauchamp
 
Posts: 3456
Joined: Mon Aug 13, 2007 6:05 pm

Post » Sun May 18, 2014 9:56 am

Well, not bad guys, although it does now work on all undead, the werewolf can now feed on a vampire.

Now I want to make a disintegration magic effect with ashpile place after the werewolf feed animation happens. I just need a trigger to call on when it happens. I am having trouble getting the "Variable 08" GetActorValue to work, and that might be because in the PlayerWerewolfFeed script the SetActorValue("Variable 08", 100) is ; ed out. I was thinking of an alternative like "OnAnimationEvent" with a Register onDying event, and the trigger on the Feeding idle. Do you think that would work? Can you give me some help on how to properly parse that line?

User avatar
Rob
 
Posts: 3448
Joined: Fri Jul 13, 2007 12:26 am

Post » Sun May 18, 2014 12:07 pm

Guys, I am still having trouble getting it to work as a new perk separate from the "PlayerWerewolfFeed" perk. What I have done is made a new perk called "PlayerWerewolfVampireDestroy" that requires GetDead=1 and HasKeyword Vampire = 1 as an activation entry.

When I test it in game, though, the perk isn't functional and the "Destroy" text I set instead of "Feed" does not appear on vampires - nothing does, like default.

However, if I edit the original "PlayerWerewolfFeed" perk and include HasKeyword Vampire = 1 on its activation entry point, I do at least get the "Feed" activation text for dead vampires, and the feeding happens as normal. To the PlayerWerewolfChange script attached to the PlayerWerewolf quest, which the PlayerWerewolfFeed perk calls upon, I simply added:

if victim.HasKeyword(Vampire)

DisintegrationSpell.Cast(victim, victim)

endif

and it works - vampires get destroyed when eaten by werewolves. However, I wanted to do this without editing the vanilla perk, but rather making my own perk work, for the sake of compatibility with other mods that may edit that perk (I think the fullblown werewolf mods do). Does anyone have any idea why my added perk isn't working to give an activation option on dead vampires?

Edit: I might add that I also added a line to the PlayerWerewolfChange Quest script so that

Game.GetPlayer().AddPerk(PlayerWerewolfVampireDestroy) was in there, hoping that the perk to destroy vampires would be added whenever a werewolf beast change happens, but maybe the player still isn't being assigned the perk? I also tried to added the perk via console by using its formid but it simply wasn't recognized as a perk...

User avatar
El Khatiri
 
Posts: 3568
Joined: Sat Sep 01, 2007 2:43 am

Post » Sat May 17, 2014 9:25 pm

I am guessing that having the perk be added to the player on the werewolf transformation just won't work, and I'll have to add it OnInIt through a quest? I have defaulted to just editing the base perk, which is working because the "WerewolfCanActivate" keyword somehow denies undead the ability to be fed on elsewhere in the CK. So as of now I do have werewolves feeding on vampires to kill them, and they still cannot feed on undead and draugr. All I did was remove the undead filter from one of the perk entries, and that alone allows vampires, but continues to deny draugr and the rest. Works out okay...

User avatar
Stephani Silva
 
Posts: 3372
Joined: Wed Jan 17, 2007 10:11 pm


Return to V - Skyrim