user826 Posted April 29, 2019 Share Posted April 29, 2019 Hey everyone, I'm currently working on a mod for a weapon that's supposed to do more damage the lower your health gets, but I'm not quite sure how to test it. The script compiled fine in the GECK, but since the damage is applied by script and not by the weapon's stats, I'm not sure how to most efficiently track my health, the target's health and the amount of damage that I'm dealing with each strike. Does anyone have any ideas? The following is the Effect script that I'm using: scn aaaSCPTLessHealthMoreDamage ref Victim short BonusDamage begin ScriptEffectStart set Victim to GetSelf set BonusDamage to ((Player.GetPermAV Health / 100)/(Player.GetHealthPercentage * 5)) Victim.DamageAV Health BonusDamage endI've also attached the plugin, if you want to take a closer look behind the curtain. Any help is appreciated! Link to comment Share on other sites More sharing options...
Radioactivelad Posted April 29, 2019 Share Posted April 29, 2019 The BLIND mod gives visual damage text.You could also create a test NPC with a set amount of health and measure the damage with 'GetAv Health' in the console. Link to comment Share on other sites More sharing options...
trashgarbage666 Posted April 29, 2019 Share Posted April 29, 2019 (edited) If you use New Vegas Script Extender, you could try PrintToConsole, which is a really useful command for debugging and testing code. It'll print out whatever text you ask it to! For instance, at the bottom of your ScriptEffectStart block, you could put... scn aaaSCPTLessHealthMoreDamage ref Victim short BonusDamage begin ScriptEffectStart set Victim to GetSelf set BonusDamage to ((Player.GetPermAV Health / 100)/(Player.GetHealthPercentage * 5)) Victim.DamageAV Health BonusDamage PrintToConsole "Victim: %n" Victim PrintToConsole "Bonus Damage: %g" BonusDamage end And whenever your script would fire, you would press ~ to see the text it printed out. In the example I wrote, it will tell you who's getting hit, and how much bonus damage they've just taken. When writing new code, I put these everywhere. It really helps when you can actually see what's going on under the hood in real time. Edited April 29, 2019 by punchbattle Link to comment Share on other sites More sharing options...
user826 Posted April 30, 2019 Author Share Posted April 30, 2019 PrintToConsole "Victim: %n" Victim PrintToConsole "Bonus Damage: %g" BonusDamage This was a great idea, thank you! It seems the script is working properly, although now I'm thinking the weapon itself isn't very practical, haha! The damage doesn't really ramp up fast enough to be useful before you die. Maybe it's something that can only really be used for sneak attacks, or if I make it a ranged weapon instead of melee. Link to comment Share on other sites More sharing options...
Recommended Posts