Jump to content

Expand list of used finishing moves in "Stealthy Takedowns mod"


Recommended Posts

Hey there,

 

i want to expand the killing animations used by said mod, but i don´t know how, since i´m a noob when it comes to scripting.

As an example i want to make it so, that every weapon type uses it´s own unique killing animation- by default there are only four animations. For instance, the neck breaking animation plays regardless if you are unarmed or got a baton in your hands- looks very dumb. And while the knife stabbing looks good on short blades, a two-handed sword does not fit the animation set very well, so it could use another "blunt-weapon" related one...

i´ve created a few sets of paired idles and wanted to add them to the main script, but adding a new property gives me an error message.

This is what the script source looks like:

 

Scriptname FST:FST_MainQuestScript extends Quest Conditional

Group Actors
Actor Property PlayerREF auto
EndGroup

Group Factions
Faction Property FST_SneakKillFaction auto
EndGroup

Group Globals
GlobalVariable Property FST_Notifications auto
GlobalVariable Property FST_Knockout auto
EndGroup

Group Keywords
Keyword Property AnimsStabWeapon auto
Keyword Property WeaponTypePistol auto
Keyword Property WeaponTypeRifle auto
Keyword Property WeaponTypePlasma auto
Keyword Property WeaponTypeGaussRifle auto
Keyword Property WeaponTypeLaser auto
EndGroup

Group PairedIdles
Idle Property FST_NeckBreak auto
Idle Property FST_StabNeck auto
Idle Property FST_PistolButtKill auto
Idle Property FST_RifleButtKill auto
EndGroup

Group Perks
Perk Property FST_TakedownPerk auto
Perk Property FST_SneakSkill auto
Perk Property Sneak01 auto
Perk Property Sneak02 auto
Perk Property Sneak03 auto
Perk Property Sneak04 auto
Perk Property Sneak05 auto
Perk Property MisterSandman01 auto
Perk Property MisterSandman02 auto
Perk Property MisterSandman03 auto
EndGroup

Group Quests
Quest Property FST_Pacify auto
Quest Property FST_ResetHostiles auto
EndGroup

Keyword RSEII_PlayerCaptive
Bool WarnRSE = False
Bool NoKill = False
Bool Property BlockKills auto conditional
Bool Property IsSneaky auto conditional
Bool Property IsSandman auto conditional
Bool KnockoutInstalled = False

Event OnQuestInit()
RegisterForRemoteEvent(PlayerREF,"OnPlayerLoadGame")
RegisterForRemoteEvent(PlayerREF,"OnEnterSneaking")
CheckPerk()
CheckSneakPerks()
CheckRSE()
CheckKnockout()
RegisterForExternalEvent("OnMCMSettingChange|Flashy_StealthyTakedowns", "OnMCMSettingChange")
EndEvent

Function OnMCMSettingChange(string modName, string id)
If modName == "Flashy_StealthyTakedowns"
If id == "takedownkey"
If KnockoutInstalled == True
Debug.Notification("Stealthy Takedowns Hotkey Updated.")
Else
Debug.Notification("Knockout Framework is not installed.")
Endif
Endif
Endif
EndFunction

Event OnControlDown(string control)
If control == "takedownkey"
If KnockoutInstalled == True
If FST_Knockout.GetValueInt() == 0
FST_Knockout.SetValueInt(1)
Debug.Notification("Stealthy Takedowns: Knockout Targets")
Else
FST_Knockout.SetValueInt(0)
Debug.Notification("Stealthy Takedowns: Kill Targets")
Endif
Else
Debug.Notification("Knockout Framework is not installed.")
Endif
Endif
EndEvent

Event Actor.OnPlayerLoadGame(actor akSender)
RegisterForRemoteEvent(PlayerREF,"OnEnterSneaking")
CheckPerk()
CheckSneakPerks()
CheckRSE()
CheckKnockout()
RegisterForExternalEvent("OnMCMSettingChange|Flashy_StealthyTakedowns", "OnMCMSettingChange")
EndEvent

FST_MainQuestScript Function GetScript() Global
return (Game.GetFormFromFile(0x00000F99, "Flashy_StealthyTakedowns.esp") as Quest) as FST_MainQuestScript
EndFunction

Function CheckPerk()
If !PlayerREF.HasPerk(FST_TakedownPerk)
PlayerREF.AddPerk(FST_TakedownPerk)
Endif
EndFunction

Function CheckRSE()
If Game.IsPluginInstalled("RSE_II_CSA.esp")
RSEII_PlayerCaptive = Game.GetFormFromFile(0x000026AA ,"RSE_II_Resources.esm") as Keyword
If WarnRSE == False
Debug.MessageBox("<p align='justify'>RSE II Combat Surrender and Abductions has been detected as installed. Stealthy Takedowns will be disabled during Player Abduction events to prevent breaking functions within the abduction.")
WarnRSE = True
Endif
Endif
EndFunction

Function CheckKnockout()
If Game.IsPluginInstalled("Knockout Framework.esm")
KnockoutInstalled = True
Else
KnockoutInstalled = False
Endif
EndFunction

Function Assassinate(actor akTarget)
FST_Pacify.Stop()
FST_Pacify.Start()
PlayerREF.SetGhost(true)
PlayerREF.DrawWeapon()
PlayerRef.StartSneaking()
Actorbase Killed = akTarget.GetBaseObject() as ActorBase
Int KilledLevel = Killed.GetLevel()
Game.ForceThirdPerson()
Utility.Wait(0.25)
If PlayerREF.WornHasKeyword(AnimsStabWeapon)
PlayerREF.playIdleWithTarget(FST_StabNeck,akTarget)
Utility.Wait(2)
Elseif PlayerREF.WornHasKeyword(WeaponTypePistol)
PlayerREF.playIdleWithTarget(FST_PistolButtKill,akTarget)
Utility.Wait(2)
Elseif PlayerREF.WornHasKeyword(WeaponTypeRifle) || PlayerREF.WornHasKeyword(WeaponTypePlasma) || PlayerREF.WornHasKeyword(WeaponTypeGaussRifle) || PlayerREF.WornHasKeyword(WeaponTypeLaser)
PlayerREF.playIdleWithTarget(FST_RifleButtKill,akTarget)
Utility.Wait(2)
Else
PlayerREF.playIdleWithTarget(FST_NeckBreak,akTarget)
Utility.Wait(3)
Endif
If FST_Knockout.GetValueInt() == 1 && KnockoutInstalled == True
KoFrameworkFunctions.KnockOutActor(akTarget, PlayerREF, False)
Else
If NoKill == False
akTarget.KillSilent(None)
Else
akTarget.KillSilent(None)
Endif
Endif
Game.RewardPlayerXP((KilledLevel * 3), false)
Utility.Wait(0.25)
PlayerRef.StartSneaking()
Utility.Wait(0.5)
Game.ForceFirstPerson()
PlayerREF.SetGhost(False)
FST_SneakKillFaction.SetPlayerEnemy(False)
FST_Pacify.Stop()
FST_ResetHostiles.Start()
While !FST_ResetHostiles.IsRunning()
Utility.Wait(0.5)
EndWhile
FST_ResetHostiles.Stop()
EndFunction

Event Actor.OnEnterSneaking(actor akSender)
If Game.IsPluginInstalled("RSE_II_CSA.esp") && PlayerREF.HasKeyword(RSEII_PlayerCaptive)
BlockKills = True
Return
Else
BlockKills = False
Endif
If IsSneaky == False || IsSandman == False
CheckSneakPerks()
Endif
If PlayerREF.HasPerk(Sneak04)
If NoKill == False
NoKill = True
Endif
PlayerREF.AddPerk(FST_SneakSkill)
If FST_Notifications.GetValueInt() == 1
Debug.Notification("Enhanced Stealh Mode On.")
Endif
StartTimer(2,100)
Endif
EndEvent

Function CheckSneakPerks()
If PlayerRef.HasPerk(Sneak01) || PlayerRef.HasPerk(Sneak02) || PlayerRef.HasPerk(Sneak03) || PlayerRef.HasPerk(Sneak04) || PlayerRef.HasPerk(Sneak05)
IsSneaky = True
Endif
If PlayerRef.HasPerk(MisterSandman01) || PlayerRef.HasPerk(MisterSandman02) || PlayerRef.HasPerk(MisterSandman03)
IsSandman = True
Endif
EndFunction

Event OnTimer(int TID)
If TID == 100
If PlayerREF.IsSneaking()
StartTimer(2,100)
Else
PlayerREF.RemovePerk(FST_SneakSkill)
If FST_Notifications.GetValueInt() == 1
Debug.Notification("Enhanced Stealh Mode Off.")
Endif
CancelTimer(100)
Endif
Endif
EndEvent
Idle Property FST_NonLeathalUnarmedTakedown Auto Const

Idle Property FST_NonLeathalUnarmedTakedown Auto Const

 

So, can anybody tell me, how to get additional idles to work just like the default ones? Can´t be that hard i guess..

 

 

Thanks in advance

Link to comment
Share on other sites

  • Recently Browsing   0 members

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