Jump to content

Scripting help for an "Armor Epoxy" - Geck


Norfuer

Recommended Posts

So I've done my first foray into porting a mod from FO3 that actually involves scripting. In this case, BEArbiter's Alien Aroxy - http://www.nexusmods.com/fallout3/mods/11486/?

 

I tested it out, and for some reason, it wasn't as effective as you would expect when you have 100 Repair.

 

Not knowing jack about GECK, I nevertheless have SOME background in CS, so I decided to give it a whirl and try to understand the problem. Found out that the script for the original Epoxy uses "GetWeaponHealthPerc" (Percent of Health), while NVSE uses, for equipment, "GetEquippedCurrentHealth" (raw numbers). Which meant it was adding 30HP instead of 30% HP. Fair enough. I improvised a variable (armorHealthMult) to stand for the armor's health percentage, modified THAT, and then set the final health to armorHealthMult x armorMaxHealth.

 

It worked well enough. The problem arose when I added some code for it to fix helmets as well. For some reason, it stopped working altogether. So I have no idea what the problem is other than how it's somehow connected to the helmet code. Maybe there's some kind of conflict between the two, I dunno.

 

So, here's the script... any help would be appreciated. Thanks, and sorry for my rambling. :smile:

 

 

 

 

scn AlienArpoxyEffectSCRIPT



ref rArmor

ref rHelmet

float armorHealthMult

float armorMaxHealth

float armorCurrentHealth

float helmetHealthMult

float helmetMaxHealth

float helmetCurrentHealth





BEGIN ScriptEffectStart



set rArmor to player.GetEquippedObject 2             

set armorMaxHealth to GetHealth rArmor                                        ;// Gets Max Health of Armor

set armorCurrentHealth to player.GetEquippedCurrentHealth 2             ;// Gets Current Health of Armor

set armorHealthMult to armorCurrentHealth / armorMaxHealth            ;// Gets Current Armor Health Percent

set rHelmet to player.GetEquippedObject 9

set helmetMaxHealth to GetHealth rHelmet                                        ;// Gets Max Health of Helmet

set helmetCurrentHealth to player.GetEquippedCurrentHealth 9            ;// Gets Current Health of Helmet

set helmetHealthMult to helmetCurrentHealth / helmetMaxHealth        ;// Gets Current Helmet Health Percent





;// Runs through player skill and augments appropriately

IF ( player.getAV Repair < 25 )

    set armorHealthMult to armorHealthMult + 0.15                                

    set armorCurrentHealth to armorMaxHealth * armorHealthMult         

    set helmetHealthMult to helmetHealthMult + 0.15                            

    set helmetCurrentHealth to helmetMaxHealth * helmetHealthMult



ELSEIF ( player.getAV Repair >= 25 && player.getAV Repair < 50 )

    set armorHealthMult to armorHealthMult + 0.20

    set armorCurrentHealth to armorMaxHealth * armorHealthMult

    set helmetHealthMult to helmetHealthMult + 0.20

    set helmetCurrentHealth to helmetMaxHealth * helmetHealthMult



ELSEIF ( player.getAV Repair >= 50 && player.getAV Repair < 75 )    

    set armorHealthMult to armorHealthMult + 0.25

    set armorCurrentHealth to armorMaxHealth * armorHealthMult

    set helmetHealthMult to helmetHealthMult + 0.25

    set helmetCurrentHealth to helmetMaxHealth * helmetHealthMult



ELSEIF ( player.getAV Repair >= 75 )    

    set armorHealthMult to armorHealthMult + 0.30

    set armorCurrentHealth to armorMaxHealth * armorHealthMult

    set helmetHealthMult to helmetHealthMult + 0.30

    set helmetCurrentHealth to helmetMaxHealth * helmetHealthMult



ENDIF



;// Set the Armor and Helmets to New Health Percent

player.SetEquippedCurrentHealth armorCurrentHealth 2

player.SetEquippedCurrentHealth helmetCurrentHealth 9



END



 

Edited by Norfuer
Link to comment
Share on other sites

  • Recently Browsing   0 members

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