Jump to content

alliluyaforgood

Banned
  • Posts

    15
  • Joined

  • Last visited

Reputation

0 Neutral

Nexus Mods Profile

About alliluyaforgood

Profile Fields

  • Country
    None
  1. 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.
  2. I wish to, but what about situation, when you collect more than 1000 RAD !AND! PC is out of radiation damage zone? For example, when PC in state after taking some Gamma gun shots. There will be no RadiationDamage event, I suppose. Will it work?
  3. OK I recreate the script Now it looks 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 Event OnInit() RegisterForRadiationDamageEvent(PlayerRef) EndEvent function Survival() If (i == 6)&&(fRad < 1000)&&(PlayerRef.IsDead() == 0) If (PlayerRef.HasPerk(SurvivedMutant) == 0) PlayerRef.AddPerk(SurvivedMutant) MessageBox(" I was close to nuclear death, and now I able to survive under radiation pressure a little bit longer. ") i = 1 Survive = 0 Notification(" I am survived... ") Else Notification(" I was so close to death... ") i = 1 Survive = 0 EndIf EndIf endfunction function PrepareToDie() float fHP = (PlayerRef.GetValue(HPs) as float) / 10 fRad = PlayerRef.GetValue(Rads) as float While (PlayerRef.IsDead() == 0)&&(fRad >= 1000) fRad = PlayerRef.GetValue(Rads) as float If (i == 1) Notification(" PIP-BOY BLINKING ") i += 1 Wait(2.0) ElseIf (i == 2) Notification(" DEADLY RAD-LEVEL! ") i += 1 Wait(2.0) ElseIf (i == 3) Notification(" PERFORM MEDICAL TREATMENT IMMEDIATELY! ") i += 1 Wait(5.0) ElseIf (i == 4)&&(PlayerRef.HasPerk(SurvivedMutant) == 1) Notification(" I am resisting to crawling radiation death... ") Wait(10.0) PlayerRef.DamageValue(HPS, fHP) Notification(" I am feeling really bad, should do something. ") i += 1 PlayerRef.DamageValue(HPS, fHP) Wait(10.0) ElseIf (i == 4) Notification(" I am feeling really bad, should do something. ") i += 1 PlayerRef.DamageValue(HPS, fHP) Wait(10.0) ElseIf (i == 5) Notification(" I am dying... ") i += 1 PlayerRef.DamageValue(HPS, fHP) Wait(3.0) ElseIf (i == 6) PlayerRef.DamageValue(HPS, fHP) Wait(0.1) Survive = 1 ;PlayerRef.Kill() Else i = 1 Survive = 0 EndIf EndWhile endfunction Event OnRadiationDamage(ObjectReference akTarget, bool abIngested) if !PlayerRef.isDead() fRad = PlayerRef.GetValue(Rads) If fRad >= 1000 PrepareToDie() EndIf startTimer (1.0) EndIf EndEvent Event OnTimer(int aiTimerID) RegisterForRadiationDamageEvent(PlayerRef) If Survive == 1 Survival() EndIf EndEvent Any ideas how I can optimize the code, or even - maybe I forgot something?
  4. May the Force and Atom light bless you, good human! It compiled, but night is deep around me, so I will test script later. Thank you!
  5. I port my code into your example, like this Scriptname RadiationPlayerDeathNew 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 check = 0 Event OnInit() RegisterForRadiationDamage(PlayerRef) EndEvent Event OnRadiationDamage(ObjectReference akTarget, bool abIngested) if !PlayerRef.isDead() float fHP = (PlayerRef.GetValue(HPs) as float) / 10 fRad = PlayerRef.GetValue(Rads) if fRad >= 1000 fRad = PlayerRef.GetValue(RADS) as float If (i == 1)&&(fRad >= 1000) Notification(" PIP-BOY BLINKING ") i += 1 Wait(2.0) ElseIf (i == 2)&&(fRad >= 1000) Notification(" DEADLY RAD-LEVEL! ") i += 1 Wait(2.0) ElseIf (i == 3)&&(fRad >= 1000) Notification(" PERFORM MEDICAL TREATMENT IMMEDIATELY! ") i += 1 Wait(5.0) ElseIf (i == 4)&&(PlayerRef.HasPerk(SurvivedMutant) == 1)&&(fRad >= 1000)&&(check == 0) Notification(" I am resisting to crawling radiation death... ") Wait(10.0) PlayerRef.DamageValue(HPS, fHP) check = 1 ElseIf (i == 4)&&(fRad >= 1000)&&(check == 1) Notification(" I am feeling really bad, should do something. ") i += 1 PlayerRef.DamageValue(HPS, fHP) Wait(10.0) ElseIf (i == 4)&&(fRad >= 1000)&&(check == 0) Notification(" I am feeling really bad, should do something. ") i += 1 PlayerRef.DamageValue(HPS, fHP) Wait(10.0) ElseIf (i == 5)&&(fRad >= 1000) Notification(" I am dying... ") i += 1 PlayerRef.DamageValue(HPS, fHP) Wait(3.0) ElseIf (i == 6)&&(fRad >= 1000)&&(PlayerRef.IsDead() == 0) PlayerRef.DamageValue(HPS, fHP) Wait(0.1) ;PlayerRef.Kill() EndIf ElseIf (i == 6)&&(fRad < 1000)&&(PlayerRef.IsDead() == 0) If (PlayerRef.HasPerk(SurvivedMutant) == 0) PlayerRef.AddPerk(SurvivedMutant) MessageBox(" I was close to nuclear death, and now I able to survive under radiation pressure a little bit longer. ") i = 1 check = 0 Notification(" I am survived... ") Else Notification(" I was so close to death... ") i = 1 check = 0 EndIf Else i = 1 check = 0 EndIf startTimer (1.0) EndIf EndEvent Event OnTimer(int aiTimerID) RegisterForRadiationDamage(PlayerRef) EndEvent Compiler says
  6. OK, Im back All of these sounds nice, but I can't do that without wide knowledge of Papyrus'scripting. It would be nice if you show me how to do it a bit more clear. Some sort of script-like algorithm.. Scriptname AAAA extends Quest --PROPERTIES-- --VARS--CONSTS-- Event OnXxx() ;some do EndEvent Event OnInit() ;somedo RegisterForXxx() EndEvent etc Can you introduce some examples of code using? How you see that? Thanks in advance!
  7. Well, as i say - I just another rookie I didnt even know about this event :smile: I will try. Already disable raddamage, which influence maxHP, fix HUDMenu file to show RAD in right direction with .75 alpha(now can see RAD and HP bar at one time), and create esp Script is the last. (i wish to able construct HUDWidget, but... :smile: )
  8. Much better Scriptname RadiationPlayerDeath extends Quest import utility import debug import game ActorValue property RADS auto Perk property SurvivedMutant auto int TimerID = 10 float fRad = 0.0 int i = 1 int check = 0 Event OnInit() Actor PlayerRef = GetPlayer() While (PlayerRef.IsDead() == 0) fRad = PlayerRef.GetValue(RADS) as float if fRad >= 1000 fRad = PlayerRef.GetValue(RADS) as float If (i == 1)&&(fRad >= 1000) Notification(" PIP-BOY BLINKING ") i += 1 Wait(2.0) ElseIf (i == 2)&&(fRad >= 1000) Notification(" DEADLY RAD-LEVEL! ") i += 1 Wait(2.0) ElseIf (i == 3)&&(fRad >= 1000) Notification(" PERFORM MEDICAL TREATMENT IMMEDIATELY! ") i += 1 Wait(5.0) ElseIf (i == 4)&&(PlayerRef.HasPerk(SurvivedMutant) == 1)&&(fRad >= 1000)&&(check == 0) Notification(" I am resisting to crawling radiation death... ") Wait(10.0) check = 1 ElseIf (i == 4)&&(fRad >= 1000)&&(check == 1) Notification(" I am feeling really bad, should do something. ") i += 1 Wait(10.0) ElseIf (i == 4)&&(fRad >= 1000)&&(check == 0) Notification(" I am feeling really bad, should do something. ") i += 1 Wait(10.0) ElseIf (i == 5)&&(fRad >= 1000) Notification(" I am dying... ") i += 1 Wait(3.0) ElseIf (i == 6)&&(fRad >= 1000)&&(PlayerRef.IsDead() == 0) PlayerRef.Kill() EndIf ElseIf (i == 6)&&(fRad < 1000)&&(PlayerRef.IsDead() == 0) If (PlayerRef.HasPerk(SurvivedMutant) == 0) PlayerRef.AddPerk(SurvivedMutant) MessageBox(" I was close to nuclear death, and now I able to survive under radiation pressure a little bit longer. ") i = 1 check = 0 Notification(" I am survived... ") Else Notification(" I was so close to death... ") i = 1 check = 0 EndIf Else i = 1 check = 0 EndIf EndWhile EndEvent
  9. Scriptname RadiationPlayerDeath extends Quest ActorValue property RADS auto int TimerID = 10 float fRad = 0.0 Event OnTimer(int Timer2ID) If Timer2ID == TimerID Actor PlayerRef = Game.GetPlayer() fRad = PlayerRef.GetValue(RADS) as float if fRad >= 1000 CancelTimer(TimerID) CancelTimer(Timer2ID) Debug.Notification(" DEADLY RAD-LEVEL! ") Utility.Wait(1.0) Debug.Notification(" PERFORM MEDICAL TREATMENT IMMEDIATELY! ") Utility.Wait(10.0) fRad = PlayerRef.GetValue(RADS) as float if fRad >= 1000 PlayerRef.Kill() else StartTimer(3, TimerID) EndIf EndIf EndIf EndEvent Event OnInit() StartTimer(3, TimerID) EndEvent Now is working! Well, partly, after 3 second still didnt work. Looks like event OnTimer not working twice. Also, any ideas to optimize the script? Cause it will follow player until death and eat some performance.
  10. Scriptname RadiationPlayerDeath extends Quest ActorValue property RADS auto int TimerID = 10 Function UpDate() StartTimer(3, TimerID) EndFunction Event OnTimer(int Timer2ID) If Timer2ID == TimerID Actor PlayerRef = Game.GetPlayer() float fRad = PlayerRef.GetValue(RADS) as float if fRad >= 1000 Debug.Notification("Смертельная доза радиации! Необходимо скорее понизить уровень заражения!") Utility.Wait(10.0) fRad = PlayerRef.GetValue(RADS) as float if fRad >= 1000 PlayerRef.Kill() CancelTimer(TimerID) else Self.UpDate() EndIf EndIf EndIf EndEvent Just lil fix. I forgot to second RADS check. But still wont work. Even message wont show.
  11. Well, console analog "player.kill" is working Maybe there is some wrongs with quest implementation I just create empty one, choose "Start Game Enabled" and "Run once" - and attach script with RADS property After launching quest should scan player AV for until PC death
  12. Of course i did Scriptname RadiationPlayerDeath extends Quest ActorValue property RADS auto int TimerID = 10 Function UpDate() StartTimer(10, TimerID) EndFunction Event OnTimer(int Timer2ID) If Timer2ID == TimerID Actor PlayerRef = Game.GetPlayer() float fRad = PlayerRef.GetValue(RADS) as float if fRad >= 1000 Debug.Notification("Смертельная доза радиации! Необходимо скорее понизить уровень заражения!") Utility.Wait(10.0) if fRad >= 1000 PlayerRef.Kill() CancelTimer(TimerID) else Self.UpDate() EndIf EndIf EndIf EndEvent
  13. That wont work \Source\User\RadiationPlayerDeath.psc(10,6): function variable timerid already defined in the containing script I fixed equation(missed "2" in first var) in next line, but still not working on clean save. Even message wont show. So i think script didnt work from the beginning.
  14. I create little mode for FO4 The main idea was killing player after reaching rad-level and delay with message As result What I did wrong?(lemme guess - everything) (Im reaaaaly novice and english not my native, hope you will be kind to me :laugh: ) Scriptname RadiationPlayerDeath extends Quest ActorValue property RADS auto int TimerID = 10 Function UpDate() StartTimer(10, TimerID) EndFunction Event OnTimer(int Timer2ID) If TimerID == TimerID Actor PlayerRef = Game.GetPlayer() float fRad = PlayerRef.GetValue(RADS) as float if fRad >= 1000 Debug.Notification("CRITICAL RADLEVEL! FIXIT!") Utility.Wait(10.0) if fRad >= 1000 PlayerRef.Kill() CancelTimer(TimerID) else Self.UpDate() EndIf EndIf EndIf EndEvent Maybe there is optimal solution than mine. Thanks in advance!
×
×
  • Create New...