PJMail Posted January 7, 2022 Share Posted January 7, 2022 I want to make my Vertibird weapons a bit more 'realistic' (maybe 'properly leveled'/'not overpowered' is a better statement).I can find no existing 'practice dummy' type mod to test them on (must be an NPC so I can use 'floating damage' to see the result). Can't use my companions for obvious reasons (they soon hate me).Killed all my captured cats (inconclusive, and too mortal, and I am a cat lover).Dogmeat still loves me but has limited armor so gives odd results. How do people mod their weapon stats to be 'ok'? Especially when working with multiple weapon mods (Laser,Cryo,Beam,impact) Obviously I am not a weapon modder or an "FO4 overhaul" person, and don't have acces to anyone with that experience... Where do I begin?Help! Link to comment Share on other sites More sharing options...
SKKmods Posted January 7, 2022 Share Posted January 7, 2022 I wrote a script that automatically equips weapons, omods and perks on an npc and measures their damage on another npc. Probably too complex to repuprose, but here it is anyway: Scriptname SKK_toolsWeaponsScript extends Quest group BaseGame Static Property pXmarker Auto Const Mandatory Armor Property pArmor_Highschool_UnderArmor Auto Const Mandatory Perk Property pGunslinger01 Auto Const Mandatory Perk Property pRifleman01 Auto Const Mandatory CombatStyle Property csRaiderRangedOffenseHigh Auto Const Mandatory ActorBase property pWorkshopNPC Auto Const Mandatory ActorValue Property pHealth Auto Const Mandatory ActorValue Property pPerception Auto Const Mandatory EndGroup group SKK Quest Property pSKK_toolsWeaponsQuest Auto Const Mandatory FormList Property pSKK_toolsWeaponsWEAPList Auto Const Mandatory FormList Property pSKK_toolsWeaponsAMMOList Auto Const Mandatory FormList Property pSKK_toolsWeaponsOMODList Auto Const Mandatory Outfit Property pSKK_toolsWeaponsOutfit Auto Const Mandatory Faction Property pSKK_toolsWeaponsFactionA Auto Const Mandatory Faction Property pSKK_toolsWeaponsFactionB Auto Const Mandatory Message Property pSKK_toolsWeaponsMessageBase Auto Const Mandatory Message Property pSKK_toolsWeaponsMessagePerks Auto Const Mandatory Message Property pSKK_toolsWeaponsMessageMods Auto Const Mandatory ReferenceAlias Property Alias_Container Auto Const Mandatory ReferenceAlias Property Alias_ShooterMarker Auto Const Mandatory ReferenceAlias Property Alias_TargetMarker Auto Const Mandatory ReferenceAlias Property Alias_Shooter Auto Const Mandatory ReferenceAlias Property Alias_Target Auto Const Mandatory ReferenceAlias Property Alias_ThisWeapon Auto Const Mandatory EndGroup LeveledItem ThisLeveledItem Weapon ThisWeapon Int ThisWeaponMods Int Perks Int ThisWeaponIndex String ThisWeaponName ;******************************************************************************************** Event OnQuestInit() ; startquest SKK_toolsWeaponsQuest Debug.Trace("SKK_toolsWeaponsScript.OnQuestInit") ; startquest SKK_toolsWeaponsQuest Utility.Wait(3.0) StartTest() EndEvent ;******************************************************************************************** Function StartTest() Debug.Trace("SKK_toolsWeaponsScript.StartTest") Debug.Notification("Weapon Damage test START") ObjectReference ThisREF ThisRef = Alias_Container.GetReference().PlaceAtMe(pXmarker) ThisRef.MoveTo(ThisRef,100.0, 100.0, 16.0) ThisRef.SetAngle(ThisRef.GetAngleX(), ThisRef.GetAngleY(), (ThisRef.GetAngleZ() + ThisRef.GetHeadingAngle(Alias_Container.GetReference())) ) Alias_ShooterMarker.ForceRefTo(ThisRef) ThisRef = Alias_Container.GetReference().PlaceAtMe(pXmarker) ThisRef.MoveTo(ThisRef,-100.0, -100.0, 16.0) ThisRef.SetAngle(ThisRef.GetAngleX(), ThisRef.GetAngleY(), (ThisRef.GetAngleZ() + ThisRef.GetHeadingAngle(Alias_Container.GetReference())) ) Alias_TargetMarker.ForceRefTo(ThisRef) ThisREF = Alias_ShooterMarker.GetReference().PlaceActorAtMe(pWorkshopNPC, aiLevelMod = 4, akZone = None) Alias_Shooter.ForcerefTo(ThisREF) ThisREF = Alias_TargetMarker.GetReference().PlaceActorAtMe(pWorkshopNPC, aiLevelMod = 4, akZone = None) Alias_Target.ForcerefTo(ThisREF) Actor ThisShooter = Alias_Shooter.GetActorReference() Actor ThisTarget = Alias_Target.GetActorReference() Alias_Container.TryToDisable() ;so actors cant loot it ThisShooter.RemoveFromAllFactions() ThisTarget.RemoveFromAllFactions() ThisShooter.AddToFaction(pSKK_toolsWeaponsFactionA) ThisTarget.AddToFaction(pSKK_toolsWeaponsFactionB) ThisShooter.SetValue(pHealth, 100) ThisShooter.SetValue(pPerception, 10) ThisShooter.SetCombatStyle(csRaiderRangedOffenseHigh) ThisShooter.SetOutfit(pSKK_toolsWeaponsOutfit, false) ThisShooter.UnequipAll() ThisShooter.RemoveAllItems() ThisShooter.AddItem(pArmor_Highschool_UnderArmor) ThisShooter.EquipItem(pArmor_Highschool_UnderArmor, abPreventRemoval = true, abSilent = true) ThisTarget.SetValue(pHealth, 100) ThisTarget.IgnoreFriendlyHits(TRUE) ThisTarget.SetNoBleedOutRecovery(TRUE) ThisTarget.SetEssential(False) ThisTarget.SetProtected(False) ThisTarget.SetRestrained(TRUE) ThisTarget.SetOutfit(pSKK_toolsWeaponsOutfit, false) ThisTarget.UnequipAll() ThisTarget.RemoveAllItems() ThisTarget.AddItem(pArmor_Highschool_UnderArmor, 1, abSilent =true) ThisTarget.EquipItem(pArmor_Highschool_UnderArmor, abPreventRemoval = true, abSilent = true) Int iIndex = 0 While iIndex < pSKK_toolsWeaponsAMMOList.GetSize() Ammo ThisAmmo = pSKK_toolsWeaponsAMMOList.getAt(iIndex) as Ammo ThisShooter.AddItem(ThisAmmo, 1, abSilent = true) iIndex +=1 EndWhile ThisWeaponIndex = 0 ThisWeaponMods = 0 Perks = 0 TestWeapon() EndFunction ;******************************************************************************************** Function TestWeapon() ;Debug.Trace("SKK_toolsWeaponsScript.TestWeapon " + ThisWeaponIndex) Actor ThisShooter = Alias_Shooter.GetActorReference() Actor ThisTarget = Alias_Target.GetActorReference() ThisTarget.ResetHealthandLimbs() If ThisWeaponIndex < pSKK_toolsWeaponsWEAPList.GetSize() If (ThisWeaponIndex == 0) ThisWeaponName = "PipeGun" Elseif (ThisWeaponIndex == 1) ThisWeaponName = "10mm" Elseif (ThisWeaponIndex == 2) ThisWeaponName = "PipeRevolver" Elseif (ThisWeaponIndex == 3) ThisWeaponName = ".44" Elseif (ThisWeaponIndex == 4) ThisWeaponName = "PipeBolt" Elseif (ThisWeaponIndex == 5) ThisWeaponName = "Laser" Elseif (ThisWeaponIndex == 6) ThisWeaponName = "HuntingRifle" Elseif (ThisWeaponIndex == 7) ThisWeaponName = "CombatRifle" Elseif (ThisWeaponIndex == 8) ThisWeaponName = "AssaultRifle" Else ThisWeaponName = "Unknown" EndIf ThisShooter.RemovePerk(pGunslinger01) ThisShooter.RemovePerk(pRifleman01) If (ThisWeaponMods == 0) && (Perks == 0) ThisLeveledItem = pSKK_toolsWeaponsWEAPList.getAt(ThisWeaponIndex) as LeveledItem ObjectReference ThisItem = ThisShooter.PlaceAtMe(ThisLeveledItem) Alias_ThisWeapon.ForceRefTo(ThisItem) ThisWeapon = ThisItem.GetBaseObject() as Weapon ThisShooter.AddItem(ThisItem, 1, abSilent = true) ElseIf (ThisWeaponMods == 1) && (Perks == 0) ObjectMod ThisMOD = pSKK_toolsWeaponsOMODList.getAt(ThisWeaponIndex) as ObjectMod ThisShooter.UnequipItem(ThisWeapon) ThisShooter.AttachModToInventoryItem(ThisWeapon, ThisMOD) ThisWeaponName = ThisWeaponName + " Powerful" ElseIf (Perks == 1) ThisShooter.AddPerk(pGunslinger01) ThisShooter.AddPerk(pRifleman01) ThisWeaponName = ThisWeaponName + " Perks" EndIf ThisShooter.EquipItem(ThisWeapon) ThisShooter.DrawWeapon() Self.RegisterForHitEvent(ThisTarget) pSKK_toolsWeaponsFactionA.SetEnemy(pSKK_toolsWeaponsFactionB, abSelfIsNeutralToOther = false, abOtherIsNeutralToSelf = true) ThisShooter.StartCombat(ThisTarget, abPreferredTarget = true) Else Debug.Trace("SKK_toolsWeaponsScript END") Debug.Notification("Weapon Damage test END") ThisTarget.SetRestrained(FALSE) Alias_Container.TryToEnable() Endif EndFunction ;******************************************************************************************** Event OnHit(ObjectReference akTarget, ObjectReference akAggressor, Form akSource, Projectile akProjectile, bool abPowerAttack, bool abSneakAttack, bool abBashAttack, bool abHitBlocked, string apMaterial) pSKK_toolsWeaponsFactionA.SetAlly(pSKK_toolsWeaponsFactionB, abSelfIsFriendToOther = false, abOtherIsFriendToSelf = false) (akAggressor as Actor).StopCombat() Float fDistance = akAggressor.GetDistance(akTarget) Float fDamage = (akTarget.GetBaseValue(pHealth) - akTarget.getValue(pHealth)) Debug.Trace ("SKK_toolsWeaponsScript," + ThisWeaponIndex + "," + (akTarget as Actor).GetActorBase() + ",Health," + akTarget.getValue(pHealth) as Int + "/" + akTarget.GetBaseValue(pHealth) as Int + ",Damage," + fDamage as Int + ",Distance," + fDistance as Int + "," + ThisWeapon + "," + ThisWeaponName + ",OMOD," + ThisWeaponMods + ",Perks," + Perks ) If (ThisWeaponMods == 0) && (Perks == 0) pSKK_toolsWeaponsMessageBase.Show(ThisWeaponIndex, fDamage) ;[%.0f] <alias=ThisWeapon> damage %.0f ElseIf (ThisWeaponMods == 0) && (Perks == 1) pSKK_toolsWeaponsMessagePerks.Show(ThisWeaponIndex, fDamage) ;[%.0f] <alias=ThisWeapon> damage %.0f with perks ElseIf (ThisWeaponMods == 1) && (Perks == 0) pSKK_toolsWeaponsMessageMods.Show(ThisWeaponIndex, fDamage) ;[%.0f] <alias=ThisWeapon> damage %.0f with mods EndIf (akAggressor as Actor).Evaluatepackage() (akTarget as Actor).ResetHealthandLimbs() Utility.Wait(3.0) If (ThisWeaponMods == 0) && (Perks == 0) Perks += 1 ElseIf (ThisWeaponMods == 0) && (Perks == 1) Perks = 0 ThisWeaponMods +=1 Else Alias_ThisWeapon.Clear() (akAggressor as Actor).UnequipItem(ThisWeapon) akAggressor.RemoveItem(ThisWeapon,1,TRUE, Alias_Container.GetReference()) Perks = 0 ThisWeaponMods = 0 ThisWeaponIndex +=1 EndIf TestWeapon() EndEvent ;******************************************************************************************** Link to comment Share on other sites More sharing options...
PJMail Posted January 7, 2022 Author Share Posted January 7, 2022 Not at all too complex as it gives me ideas if (when) I have to write it myself.Valuable information in fact - SetRestrained (I did not know it would work in combat) and ignorefriendlyhits (a function I distrust but clearly works in this situation). Was hoping someone else had already made a entire mod - as I don't want to spend time Inventing the wheel someone has already (and probably built a car)...Thanks SKK - as always - for giving me a direction if I have to walk that road myself. Link to comment Share on other sites More sharing options...
PJMail Posted January 8, 2022 Author Share Posted January 8, 2022 Took your insights and modified one of those existing 'NPC' style mannequin mods.Works fine, though I wish I could disable the 'knockback' effect somehow (selectively - not game wide). Link to comment Share on other sites More sharing options...
SKKmods Posted January 8, 2022 Share Posted January 8, 2022 Thats great. Offline / PM I'd be interested in (a) Without the outcomes video would you be able to follow the code ? (b) How easy my variable naming and code structure is to understand and reuse ? as I'm doing a thing on software maintenance and this could be a useful example. Link to comment Share on other sites More sharing options...
PJMail Posted January 8, 2022 Author Share Posted January 8, 2022 PM'd. Link to comment Share on other sites More sharing options...
Recommended Posts