Alehazar Posted September 26, 2018 Share Posted September 26, 2018 I need to set up two timers: upon Moriarty's death my current script checks whether my player killed Moriarty with or without being added to the MegatonCrimeFaction. A New quest is started and I need to incorporate these timers within this Quest. If killed without a crime report, I need a countdown of 24 ingame hours and then add a specific note to my character. If killed with a crime report, the timer needs to be three days, as after 72 ingame hours the people of Megaton won't care anymore about my PC killing Moriarty (provided my PC left Megaton and stays away for those 72 hours.) And then the letter needs to be added Since time (ingame hours ) is handled as a Float, I really don't know understand what I need to do, I do not understand the notation of seconds, minutes, hours within a script; or, more in general, how the game registers the passing of time and how specific actions can be attached when a certain amount of time has expired. Link to comment Share on other sites More sharing options...
TheRealNachoNinjaGnome Posted September 26, 2018 Share Posted September 26, 2018 I'm still a bit new to scripting as well, but I was looking through scripts last night and saw a potential solution to your problem. In the HD00LabScript, they use the "GameDaysPassed" function. Basically, you need to set a float variable that, for this example, we'll call "MoriartyDeathTime". When Moriarty dies, do a "Set MoriartyDeathTime to GameDaysPassed". Then when checking against it, do an "If ( GameDaysPassed - MoriartyDeathTime >= x )". "x" will be "1" for a single game day and "3" for 3 game days. You can also use decimals for calculating fractions of days. Hope this helps. Link to comment Share on other sites More sharing options...
AmaccurzerO Posted September 30, 2018 Share Posted September 30, 2018 (edited) Hello, Alehazar You can try this script on Moriarty: --------------------------------------------------------------- short MoriartyIsDeadshort DoOnce Begin OnDeath set MoriartyIsDead to GameDaysPassed if (DoOnce == 0)if (GameDaysPassed - MoriartyIsDead ) >= 3player.addnote "mynote"set DoOnce to 1endifendif END ---------------------------------------------------- I used a similar script for my mod "Confessor Cromwell decay" at it worked. Hope this works for you. Good luck. Edited September 30, 2018 by AmaccurzerO Link to comment Share on other sites More sharing options...
Alehazar Posted October 2, 2018 Author Share Posted October 2, 2018 @AmaccurzerO: I'll give it a go to see if it pans out -right now, I created the mod without the timer, so when Moriarty dies the required effect isinstantaneous -no notes and no quests involved. I do appreciate the input, but my frustration in getting the timer to work (epic fail), somewhat curbed my enthusiasm to create this mod as I initially intended. I certainly see this as a future release.So, many thanks for your time and advice. Link to comment Share on other sites More sharing options...
Mktavish Posted October 2, 2018 Share Posted October 2, 2018 Try using "GetTimeDead" http://geck.bethsoft.com/index.php?title=GetTimeDead But it has to be in a "GameMode" block to continually check how much time has passed.Begin OnDeath ; would only run its code once ... but would be the best way to start the script running.So use the 2 blocks together , something like this. ~~~~~~~~~~~SCN Myscript Short DeathTrigger Begin OnDeath ColinMoriartyRef ; means this must be an object script Set DeathTrigger to 1 End Begin GameMode If DeathTrigger == 1 && GetFactionCombatReaction MegatonCrimeFaction PlayerFaction != 1 If ColinMoriarty.GetTimeDead >= 24 AddNote MyNote Set DeathTrigger to 2 ElseIf DeathTrigger == 1 && GetFactionCombatReaction MegatonCrimeFaction PlayerFaction == 1 If ColinMoriarty.GetTimeDead >= 70 ; made this less than the 3 day crime flag clearing AddNote MyNote Set DeathTrigger to 2 endif endif endifEnd ~~~~~~~~~~~~~~~~ There is probably a cleaner way to do it , and since the OnDeath block is used , it can't be a quest script.So maybe a GetDead check in the GameMode block of a quest script ??? But you could just put this onto his script , although that is not advised for mod compatibility. As far as understanding the time float ... it is a 24 hr clock , not a12 hr with am/pm.But it only lists the hrs with the decimal places describing tenths and hundreds of an hour.15 min = .2530 min = .549min & 15sec = .82 approx Hope that helps. Link to comment Share on other sites More sharing options...
Recommended Posts