jdrfox Posted November 27, 2018 Share Posted November 27, 2018 Do you mean pc is at 1000+ rads but is not taking any more radiation? Then the script just waits til the radiation damage event is triggered. Link to comment Share on other sites More sharing options...
alliluyaforgood Posted November 27, 2018 Author Share Posted November 27, 2018 Then the script just waits til the radiation damage event is triggered.So, using of While is must-have in this situation?After all Cycle "While" will be launched only at 1000+RAD, in other time script not even touch that piece of code. Link to comment Share on other sites More sharing options...
jdrfox Posted November 27, 2018 Share Posted November 27, 2018 Oh of course, you have to check every time PC rad is >= 1000 Something like this: Scriptname RadiationPlayerDeath extends Quest import utility import debug import game ActorValue property Rads auto const ActorValue property HPs auto const Actor property PlayerRef auto const Perk property SurvivedMutant auto int TimerID = 10 float fRad = 0.0 int i = 1 int Survive = 0 bool warned = false Event OnInit() RegisterForRadiationDamageEvent(PlayerRef) EndEvent Event OnRadiationDamage(ObjectReference akTarget, bool abIngested) fRad = PlayerRef.GetValue(Rads) as float if fRad >= 1000 PrepareToDie () else RegisterForRadiationDamageEvent(PlayerRef) endif EndEvent Function PrepareToDie() if !PlayerRef.IsDead () if i == 2 i += 1 Notification(" DEADLY RAD-LEVEL! ") startTimer (2.0) elseif i == 3 i += 1 Notification(" PERFORM MEDICAL TREATMENT IMMEDIATELY! ") startTimer (5.0) elseif i == 4 if PlayerRef.HasPerk(SurvivedMutant) Notification(" I am resisting to crawling radiation death... ") if !warned warned = true startTimer (10.0) else warned = false float fHP = (PlayerRef.GetValue(HPs) as float) * 0.1 PlayerRef.DamageValue(HPS, fHP) Notification(" I am feeling really bad, should do something. ") i += 1 PlayerRef.DamageValue(HPS, fHP) startTimer (10.0) endif else Notification(" I am feeling really bad, should do something. ") i += 1 float fHP = (PlayerRef.GetValue(HPs) as float) * 0.1 PlayerRef.DamageValue(HPS, fHP) startTimer (10.0) endif elseif i == 5 Notification(" I am dying... ") i += 1 float fHP = (PlayerRef.GetValue(HPs) as float) * 0.1 PlayerRef.DamageValue(HPS, fHP) startTimer (3.0) elseif i == 6 float fHP = (PlayerRef.GetValue(HPs) as float) * 0.1 PlayerRef.DamageValue(HPS, fHP) startTimer (0.1) Survive = 1 else i += 1 Notification(" PIP-BOY BLINKING ") startTimer (2.0) endif endif EndFunction Event OnTimer(int aiTimerID) fRad = PlayerRef.GetValue(Rads) as float if fRad >= 1000 PrepareToDie () else if Survive == 1 if PlayerRef.HasPerk(SurvivedMutant) Notification(" I was so close to death... ") else PlayerRef.AddPerk(SurvivedMutant) MessageBox(" I was close to nuclear death, and now I able to survive under radiation pressure a little bit longer. ") Notification(" I am survived... ") endif endif i = 1 Survive = 0 warned = false RegisterForRadiationDamageEvent(PlayerRef) endif EndEvent Link to comment Share on other sites More sharing options...
Recommended Posts