Jump to content

VampireFeeding on knockedout people


jarod2012

Recommended Posts

Hi, i'm new in Oblivion modding, and I wanted to make vampires able to feed on knocked out enemies (when fatigue reaches zero) , the vampire bonus in hand to hand will finally be useful.

But I have a problem, I made a spell with a script attached, it works when feeding on sleeping people but not on knocked out enemies.

Can you help me ? Thank you.

 

Scriptname VampirismBloodHunger

 

Ref Target

 

begin ScriptEffectStart

set Target to GetSelf

if (Target.GetKnockedState > 0 || Target.GetSleeping == 3)

Player.VampireFeed Target

endif

End

Link to comment
Share on other sites

Info from CSWiki:

"Adds a vampire feed package to the reference it is called on. VampireFeed takes one actor parameter, which becomes the target of the vampire feed package. This function only works if the calling NPC is a vampire, and the target is asleep in a bed."

So to make you able to feed upon knock down enemies you need to make a whole system(and I mean a big one), allowing player to feed upon such enemies is one thing(maybe when player is nearby try this: set player angle, so that he looks in targets direction, setisghost to 1, disable all his controls - mouse too, setrestrained to 1, and play feed specialanim), and implementing this for NPCs is much more difficult, but possible: I mean proper packages + animations, and most likely will require knowledge of using OBSE arrays(for one NPC one package is enough, but imagine situation where there are 5 vamps, which want to start feeding in that way - there must be some kind of algorithm which will give them proper packages etc.).

Link to comment
Share on other sites

Thanks for your answer. Animations are not important to me, I just want vampires (only the player not npc) to be able to feed on knocked out opponents.

I suppose Player.HasVampireFed cannot be set to 1 by a spell ?

If that the case I think I will set vampday and vamphour in vampirescript as global variables so I can copy just the following code directly in the feeding spell. (but that's not pretty). If you have ideas, thanks for sharing.

 

... some code ...

If ( PCVampire >= 1 && Target.GetKnockedState > 0 )

Set PCVampire to 1

 

;remove any spell from higher states

... some code ...

;re-add state 1 spells

... some code ...

set vampday to GameDay

set vamphour to GameHour

MessageBox "Your hunger for blood has been satisfied... for now."

endif

Link to comment
Share on other sites

If only player should be affected, then this is much easier to create. I will not give you code, but I will list some things, how to do it:

to start effect:

*distance between player and target < 160 units + necessary conditions

*target.setactorvalue paralysis 1

*now set proper heading angle by using getheadingangle and setangle, so that player will look in targets direction

*create special idle in idle manager, create a global variable lets say startfeeding, in idle manager give in conditions if getglobalvariable startfeeding == 1 (writing it from memory, maybe this commmand looks a little different) - feeding anims may be found in one of oblivion bsa archives - this anim sould be marked as specialidle(can not be overwritten) of wholebody(can be overwritten by recoil or stagger - your choice) -> in bsa should be 2 feeding anims: one is a little different and will require setting heading angle in a little different way

*in script:

set startfeeding to 1

player.pickidle

set startfeeding to 0

*now good would be timer - check how long last this anim in nifskope - it should last about 5-6sec, when time elapsed:

target.setactorvalue paralysis 0

+ add this lines, which you have written above.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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