Greetings! I'll try making this short and straight to the point:I want the game to trigger a custom sound (T51Battery_CapacityLow) when the player is in a Power Armor suit and only when the fusion core battery (AmmoFusionCore health according to the game) reaches below 45%. I was given some general instructions by kinggath down below but I could use some further help. See my own script results at the end. Any assistance is highly appreciated and will be credited in my work. ==============General Guideline:============== - Setup a Quest, add an Alias to the player, add a script to that player alias - In that script you're going to be watching an event that happens periodically, use the (OnLocationChange) event - In it, you'll check if they are using PowerArmor (IsInPowerArmor) - Once you've confirmed you're in power armor, you're going to check that power armor's inventory for a fusion core, and use (GetItemHealthPercent) on it - If it's under 25, you play your sound, and store the reference to the fusion core, so next time this triggers you can check if it's the same fusion core so that it doesn't keep playing the sound over and over. Summary: Set up: ObjectReference Property oLastFusionCore Auto Hidden at the top of your script, and then during the same check of GetItemHealthPercent < 25, you check if that ref != oLastFusionCore In fact you don't even need an alias to the fusion core with this method, just one to the player So, setup a Quest, add an Alias to the player, add a script to that player alias, use the OnLocationChange event, and then write code to do what I described above. =======My script=======
Scriptname T51DACSBatteryCapacty extends ReferenceAlias
ObjectReference Property oLastFusionCore Auto Hidden
Event OnLocationChange(Location akOldLoc, Location akNewLoc)
if (Game.GetPlayer().GetCurrentLocation() == akOldLoc)
if (Game.GetPlayer().IsInPowerArmor())
if (Game.GetPlayer().GetItemCount(AmmoFusionCore) == 1)
if (AmmoFusionCore.GetItemHealthPercent() < 45 )
int instanceID =T51Battery_CapacityLow.play(self)
endIf
endIf
endIf
endIf
endEvent