Advertisement
skk50

SKKDelayDLC01.PSC

Mar 30th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.08 KB | None | 0 0
  1. Scriptname SKK_DDLC01MainScript extends Quest
  2.  
  3. ;**************************************************************************
  4. ;SKKDelayDLC01.PSC Papyrus script for Fallout4
  5. ;Delay the start of DLC01 Automatron to a configured player level
  6. ;Can be installed at any time as there is no DLC master dependency
  7. ;But must be installed and enabled before the player reaches level 15
  8. ;parent quest is start game enabled run once with a high priority
  9.  
  10. ;*********************************************************
  11. ;Form properties
  12.  
  13. GlobalVariable Property pSKK_DDLC01Playerlevel Auto Mandatory
  14. {The player level to start DLC01 Automatron, base game value is 15. Change this value with the console SET SKK_DDLC01Playerlevel TO Number}
  15.  
  16. ;*********************************************************
  17. ;Local variables
  18.  
  19. Quest rDLC01MQ00
  20. Quest rDLC01MQ01
  21. Quest rDLC01MQ01Radio
  22.  
  23. ;*********************************************************
  24. Event OnInit()
  25. ; never use
  26. EndEvent
  27. ;*********************************************************
  28.  
  29. Event OnQuestInit()
  30.  
  31. If Game.IsPluginInstalled("DLCRobot.esm") == TRUE && Game.GetPlayer().GetLevel() < 15
  32.  
  33. rDLC01MQ00 = Game.GetFormFromFile(0x00000805, "DLCRobot.esm") as Quest
  34. rDLC01MQ01 = Game.GetFormFromFile(0x00000806, "DLCRobot.esm") as Quest
  35. rDLC01MQ01Radio = Game.GetFormFromFile(0x0000fdae, "DLCRobot.esm") as Quest
  36.  
  37. If rDLC01MQ00.GetCurrentStageID() < 100 || rDLC01MQ00.GetCurrentStageID() <= 10 ; Stage10 runs QuestScript testing OnLocationChange which at player leve l15 triggers Stage100 which triggers DLC01MQ01.Start()
  38. Debug.Trace( "SKK_DDLC01MainScript OnInit Registering Remote events" )
  39. RegisterForRemoteEvent(rDLC01MQ00, "OnStageSet")
  40. RegisterForRemoteEvent(rDLC01MQ01, "OnStageSet")
  41. DebugTrace("OnInit End")
  42. Else
  43. Debug.Trace( " " )
  44. Debug.Trace( "*******************************************************************************" )
  45. Debug.Trace( "SKK_DDLC01MainScript Conditions failed, stopping" )
  46. Debug.Trace( "SKK_DDLC01MainScript DLC01MQ00 Stage below 100 " + rDLC01MQ00.GetCurrentStageID() )
  47. Debug.Trace( "SKK_DDLC01MainScript DLC01MQ01 Stage below 10 " + rDLC01MQ01.GetCurrentStageID() )
  48. Debug.Trace( "*******************************************************************************" )
  49. Debug.Trace( " " )
  50. Self.Stop()
  51. Endif
  52.  
  53. Else ; too late
  54. Debug.Trace( " " )
  55. Debug.Trace( "*******************************************************************************" )
  56. Debug.Trace( "SKK_DDLC01MainScript Conditions failed, stopping" )
  57. Debug.Trace( "SKK_DDLC01MainScript IsPluginInstalled DLCRobot.esm " + Game.IsPluginInstalled("DLCRobot.esm") )
  58. Debug.Trace( "SKK_DDLC01MainScript Player level is not below 15 " + Game.GetPlayer().GetLevel() )
  59. Debug.Trace( "*******************************************************************************" )
  60. Debug.Trace( " " )
  61. Self.Stop()
  62. EndIf
  63.  
  64. EndEvent
  65.  
  66. ; *********************************************************
  67.  
  68. Event Quest.OnStageSet(Quest akSender, int auiStageID, int auiItemID)
  69.  
  70. Debug.Trace( "SKK_DDLC01MainScript OnStageSet " + akSender + " StageID " + auiStageID + " ItemID " + auiItemID )
  71.  
  72. If (akSender == rDLC01MQ00 && auiStageID == 100) || (akSender == rDLC01MQ01 && auiStageID == 10)
  73. While rDLC01MQ01.IsStarting()
  74. Utility.WaitMenuMode(0.1)
  75. EndWhile
  76. rDLC01MQ01.Stop()
  77. rDLC01MQ01Radio.Stop()
  78. UnRegisterForRemoteEvent(rDLC01MQ00, "OnStageSet")
  79. UnRegisterForRemoteEvent(rDLC01MQ01, "OnStageSet")
  80. RegisterForRemoteEvent(Game.GetPlayer(), "OnLocationChange")
  81. DebugTrace("OnStageSet")
  82. Endif
  83.  
  84. EndEvent
  85.  
  86. ;*********************************************************
  87.  
  88. Event Actor.OnLocationChange(Actor akSender, Location akOldLoc, Location akNewLoc)
  89.  
  90. If Game.GetPlayer().GetLevel() >= pSKK_DDLC01Playerlevel.GetValue()
  91. UnRegisterForRemoteEvent(Game.GetPlayer(), "OnLocationChange")
  92. rDLC01MQ01Radio.Start()
  93. rDLC01MQ01.Start()
  94. rDLC01MQ01.SetStage(10)
  95. rDLC01MQ01Radio.SetStage(10)
  96. DebugTrace("OnLocationChange")
  97. Self.Stop()
  98. EndIf
  99.  
  100. EndEvent
  101.  
  102. ;*********************************************************
  103. ;cqf SKK_DDLC01 "SKK_DDLC01MainScript.DebugTrace"
  104. Function DebugTrace(String sCaller = "Console")
  105.  
  106. Debug.Trace( " " )
  107. Debug.Trace( "*******************************************************************************" )
  108. Debug.Trace( "SKK_DDLC01MainScript " + sCaller + " SKK_DDLC01 IsRunning " + Self.IsRunning() )
  109. Debug.Trace( "SKK_DDLC01MainScript " + sCaller + " DLC01MQ00 IsRunning " + rDLC01MQ00.IsRunning() + " GetCurrentStageID() " + rDLC01MQ00.GetCurrentStageID() )
  110. Debug.Trace( "SKK_DDLC01MainScript " + sCaller + " DLC01MQ01 IsRunning " + rDLC01MQ01.IsRunning() + " GetCurrentStageID() " + rDLC01MQ01.GetCurrentStageID() )
  111. Debug.Trace( "SKK_DDLC01MainScript " + sCaller + " DLC01MQ01Radio IsRunning " + rDLC01MQ01Radio.IsRunning() + " GetCurrentStageID() " + rDLC01MQ01Radio.GetCurrentStageID() )
  112. Debug.Trace( "*******************************************************************************" )
  113. Debug.Trace( " " )
  114.  
  115. EndFunction
  116.  
  117. ;*********************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement