FranktheFragger Posted January 7, 2014 Share Posted January 7, 2014 Hi! I am currently in the making of a version 1.1 of my only upload to the Fallout: New Vegas Nexus, "HEV Mark IV", and need a bit of help with the scripting of the sounds.You can find the .esp here: http://www.nexusmods.com/newvegas/mods/51021/? Not a very popular/amazing modification, but it does what it's made for. Currently, this is where the script currently stands// scn hev42SCRIPT short bEquippedshort iPlayOncefloat fHPBasefloat fHPLastfloat fHPCurrentfloat fHPRatio begin OnUnequip player set bEquipped to 0 end begin OnEquip player set fHPBase to player.GetBaseActorValue Healthset fHPLast to player.GetActorValue Healthset iPlayOnce to 0set bEquipped to 1 end begin GameMode if bEquippedif player.GetDeadset bEquipped to 0PlaySound hevdeadelseset fHPCurrent to player.GetActorValue Healthif fHPLast != fHPCurrentset fHPRatio to fHPCurrent / fHPBaseif fHPRatio <= 0.10if iPlayOnce != 4set iPlayOnce to 4PlaySound hev101endifelseif fHPRatio <= 0.25if iPlayOnce != 3set iPlayOnce to 3PlaySound hev251endifelseif fHPRatio <= 0.50if iPlayOnce != 2set iPlayOnce to 2PlaySound hev501endif elseif fHPRatio <= 0.75if iPlayOnce != 1set iPlayOnce to 1PlaySound hev751endifelseif iPlayOnceset iPlayOnce to 0endifset fHPLast to fHPCurrentendifendifendif end \\ I need help adding the following functions to the script, while being able to keep those already included. This includes - - Playing a sound when 200 radiation level is hit- Playing a sound when poisoned- Playing a sound ammo is depleted I appreciate any and all help you can give me, this community has been very supportive in the past and I expect it will remain that way! If you need more information, I would be more than happy to provide! Thank you all so very much! Link to comment Share on other sites More sharing options...
jazzisparis Posted January 7, 2014 Share Posted January 7, 2014 Here ya go: scn hev42SCRIPT short bEquipped short iPlayOnceHP float fHPBase float fHPLast float fHPCurrent float fHPRatio short bPlayOnceRads short bPlayOncePoison ref rWeapon ref rAmmo short bPlayOnceAmmo begin OnUnequip set bEquipped to 0 end begin OnEquip player set fHPBase to player.GetBaseActorValue Health set fHPLast to player.GetActorValue Health set iPlayOnceHP to 0 set bPlayOnceRads to 0 set bPlayOncePoisoned to 0 set rWeapon to 0 set bEquipped to 1 end begin GameMode if bEquipped if player.GetDead set bEquipped to 0 PlaySound hevdead else set fHPCurrent to player.GetActorValue Health if fHPLast != fHPCurrent set fHPRatio to fHPCurrent / fHPBase if fHPRatio <= 0.1 if iPlayOnceHP != 4 set iPlayOnceHP to 4 PlaySound hev101 endif elseif fHPRatio <= 0.25 if iPlayOnceHP != 3 set iPlayOnceHP to 3 PlaySound hev251 endif elseif fHPRatio <= 0.5 if iPlayOnceHP != 2 set iPlayOnceHP to 2 PlaySound hev501 endif elseif fHPRatio <= 0.75 if iPlayOnceHP != 1 set iPlayOnceHP to 1 PlaySound hev751 endif elseif iPlayOnceHP set iPlayOnceHP to 0 endif set fHPLast to fHPCurrent endif if bPlayOnceRads != (player.GetActorValue RadiationRads >= 200) set bPlayOnceRads to (bPlayOnceRads == 0) if bPlayOnceRads PlaySound hevRads endif endif if bPlayOncePoison != (player.IsSpellTarget BarkScorpionPoison || player.IsSpellTarget CazadorPoison || player.IsSpellTarget NightstalkerPoison || player.IsSpellTarget RadScorpion1Poison || player.IsSpellTarget RadScorpion2Poison) set bPlayOncePoison to (bPlayOncePoison == 0) if bPlayOncePoison PlaySound hevPoison endif endif ; BEGIN low-ammo alert if rWeapon != player.GetEquippedObject 5 set rWeapon to player.GetEquippedObject 5 set rAmmo to GetWeaponAmmo rWeapon set bPlayOnceAmmo to 0 elseif rAmmo if bPlayOnceAmmo != (player.GetItemCount rAmmo < 30) set bPlayOnceAmmo to (bPlayOnceAmmo == 0) if bPlayOnceAmmo PlaySound hevAmmo endif endif endif ; END low-ammo alert endif endif end Note that the ammo part requires NVSE, so remove that segment if you don't want your mod to rely on NVSE.Moreover, for the script to compile, you need to launch the GECK via the NVSE loader, as explained here (2nd paragraph under 'Installation'). Link to comment Share on other sites More sharing options...
FranktheFragger Posted January 8, 2014 Author Share Posted January 8, 2014 Thank you so much my friend! Link to comment Share on other sites More sharing options...
Recommended Posts