Jump to content

Help Testing Weapon Damage Applied by Script


user826

Recommended Posts

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
end

I'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

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 by punchbattle
Link to comment
Share on other sites

 

    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

  • Recently Browsing   0 members

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