Jump to content

Auto-RadAway script problem


Recommended Posts

I'm working on an Auto-RadAway script, but I've hit a snag. I based my code on my already successful Auto-Hydration script, which is included as a component.

 

 

Below is a segment of my code. Believe me when I say the rest of the code won't fit within a reasonably sized post, as this script does far more than manage radiation. (The rest of the code not shown is confirmed to function as intended)

		If (SuitOperator.GetValue(Rads) >= RadDanger)
		;If (OperatorRadLevel >= RadDanger)
			If(!RadAwayCooldown && (SuitOperator.GetItemCount(RadAway) > 0))
				If (SuitOperator.GetValue(HC_ThirstEffect) <= Dehydrated)		
					SuitOperator.EquipItem(RadAway)
					RadAwayCooldown = true
					StartTimer(CooldownRadAway, RadAwayID)
					ImmunityDown = true
					StartTimer(ImmuneSystemDown, ImmunityDownID)
				EndIf
			EndIf
                EndIf

Where Rads is an ActorValue just like HC_ThirstEffect, RadDanger is a float just like Dehydrated, and SuitOperator is the actor wearing the armor piece in question. I've already confirmed that the timers and equipitems all work and that my If statements are properly formatted (though I may have messed up and EndIf during the copy to here). When I run a Auto-Hydrate script, it works perfectly fine, so I can only assume there's something wrong with the Rads or where I am getting them from, though I took the format from conversation triggers in the Creation Kit.

Link to comment
Share on other sites

Nothing about your snippet jumps out at me like it wouldnt function. What details am I missing that has you convinced the problem is within your posted snippet? I understand the need to keep things brief but if your code is to large to reasonably be posted, then thats an indication your script is too large and does too many things (of course exceptions to every rule). You should at least mention the extending script type and post the entire method and body.

 

Other things you should explore are your papyrus logs for errors in case you forgot to fill a property or attach a script in the CK. Creating your own trace logs is also very useful in tracking down issues.

Link to comment
Share on other sites

Nice power armor mod. Is this for a medic kind of variant? I see some room for improvement on the script side though. You are constantly polling for radiation, health, and addiction changes. There are already events for catching these changes directly like OnRadiationDamage, OnMagicEffectApply, and OnHit.

 

If its not broke then dont fix it I guess.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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