skk50

FO4 Papyrus RDS radio display

Dec 2nd, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 KB | None | 0 0
  1. Scriptname RadioStation_Main extends Quest
  2.  
  3. ; CreationKit Papyrus Fallout4 script by skk50@nexusmods.com July 2017
  4. ; Radio station random track selection and RDS track display using debug messages (so PC only).
  5. ;
  6. ; Replace RadioStation with your unique mod name or id
  7. ; Create Global variable RadioStation_Track set default value to 1
  8. ; Add this script to your RadioStation quest under Scripts / New, set properties for RadioStation_Track
  9. ; On each Quest phase start tab conditions add GlobalVariable RadioStation_Track == phase number
  10. ; On each Quest phase start tab fragment set kmyQuest dropdopwn and paste kmyQuest.PhaseDisplay(phase number)
  11.  
  12. GlobalVariable Property pRadioStation_Track Auto Const Mandatory ; create this global variable set default value to 1
  13.  
  14. ;******************************************************
  15.  
  16. Function PhaseDisplay(int iPhaseNumber)
  17.  
  18. Int iNextTrack = iPhaseNumber
  19. While (iNextTrack == iPhaseNumber)
  20. iNextTrack = Utility.RandomInt(2,4) ; your number of phase tracks, but don't pick the first scene loop init phase
  21. EndWhile
  22. pRadioStation_Track.SetValue(iNextTrack)
  23.  
  24. If Game.IsPlayerRadioOn() && Game.GetPlayerRadioFrequency() == 99 ; Validate player radio is on and tuned to RadioStation frequency
  25.  
  26. If iPhaseNumber == 1
  27. Debug.Notification("RadioStation playlist")
  28. ElseIf iPhaseNumber == 2
  29. Debug.Notification("Phase 2 track display name")
  30. ElseIf iPhaseNumber == 3
  31. Debug.Notification("Phase 3 track display name")
  32. ElseIf iPhaseNumber == 4
  33. Debug.Notification("Phase 4 track display name")
  34. Endif
  35.  
  36. Else
  37. Utility.Wait(5) ; stop constant loop when station is not selected, but avoid a long silence when first switched on
  38. Endif
  39.  
  40. EndFunction
Add Comment
Please, Sign In to add comment