If (Victim as Actor).GetActorValuePercentage("Health" <= 0.4) MyFunction()EndIfHere is the full Function. It is part of Vampire Siring. Currently being worked on for the next update of my mod. The idea I'm trying to formulate is the player chooses to kill the target by over-feeding on the victim. After which the target dies, rises again and becomes a slave of the vampire.
However at the moment it is not triggering "Infect()" function because I believe my syntax for GetActorValuePercentage is incorrect. If I remove the GetActorValuePrecentage the function triggers and works. Turning the target into a new slave (based on an alias reference. Written mostly by my good bud rmbackslash, hes the man). I appreciate any help, thanks.
Function VampireFeed(ObjectReference Victim)(Victim as Actor).DamageActorValue("Health", 35) If (Victim as Actor).GetActorValuePercentage("Health" <= 0.4) (Victim as Actor).KillSilent() Utility.Wait(5.0) (Victim as Actor).Resurrect() Infect(Victim as Actor) (Victim as Actor).MakePlayerFriend() Endif ;Effects for hiding the change ;VampireChangeFX.play(game.getPlayer()) VampireTransformDecreaseISMD.applyCrossFade(2.0) utility.wait(2.0) imageSpaceModifier.removeCrossFade() ;VampireChangeFX.stop(game.getPlayer()) Game.IncrementStat( "Necks Bitten" ) VampireFeedMessage.Show() VampireFeedReady.SetValue(0) ;Player has fed, regress to Stage 1 Vampirisim ;Remove Stage 2 buffs and spells LastFeedTime = GameDaysPassed.Value VampireStatus = 1 VampireProgression(Game.GetPlayer(), 1) ;Start checking GameTime again if we weren't already UnregisterforUpdateGameTime() RegisterForUpdateGameTime(12) EndFunction
