Andyno Posted November 30, 2017 Share Posted November 30, 2017 SCN BMTeleport01Script Int TeleportSwitch Float Timer Begin OnTriggerEnter Player If TeleportSwitch == 0 DisablePlayerControls PlaySound DRSDLC05TeleporterClose IMOD DLC05TeleportOutISFX Set TeleportSwitch to 1 endif End Begin GameMode If TeleportSwitch == 1 Set Timer to Timer + GetSecondsPassed If Timer >= 3 Player.MoveTo BMTeleportMarker01REF PlaySound DRSDLC05TeleporterOpen IMOD DLC05TeleportInISFX EnablePlayerControls Set TeleportSwitch to 0 Set Timer to 0 endif endif EndAs you can see, the purpose of the script is to teleport player to a new location. Everything works as intended, except one thing: the line EnablePlayerControls is not working as it should, because right after the teleportation process player can freely move, even if he should be stuck at same place for 3 seconds. Any suggestions highly welcomed... Link to comment Share on other sites More sharing options...
skittered Posted November 30, 2017 Share Posted November 30, 2017 The gamemode block runs as soon as the ontrigger event has finished firing .. so there is basically no delay before it starts counting .. you likely need to account for the amount of time both IMODs takes to run their FX. Link to comment Share on other sites More sharing options...
uhmattbravo Posted December 1, 2017 Share Posted December 1, 2017 When an if statement is doing a lot at once, sometimes things don't happen, or seem to happen out of order. What I do in these cases is separate the actions into multiple if statements: If TeleportSwitch == 1 Set Timer to Timer + GetSecondsPassed If Timer >= 3 Player.MoveTo BMTeleportMarker01REF PlaySound DRSDLC05TeleporterOpen Set Timer to 0 Set TeleportSwitch to 2 endif Else if TeleportSwitch == 2 IMOD DLC05TeleportInISFX EnablePlayerControls Set TeleportSwitch to 0 endif Link to comment Share on other sites More sharing options...
Mktavish Posted December 1, 2017 Share Posted December 1, 2017 That's a good Idea on setting the teleport switch to a second stage.But still ... the "EnablePlayerControls" is going to happen at the 3 second mark at the same time right after teleporting and playing the second IMOD. So what if putting another Timer check like this ... ~~~~~~~~~ If TeleportSwitch == 1Set Timer to Timer + GetSecondsPassedIf Timer >= 3Player.MoveTo BMTeleportMarker01REFPlaySound DRSDLC05TeleporterOpen Set Timer to 0Set TeleportSwitch to 2endifElse if TeleportSwitch == 2IMOD DLC05TeleportInISFX If Timer >= 6 EnablePlayerControls Set TeleportSwitch to 0 Set Timer to 0 endifendifendifEnd~~~~~~~~~~~~ The problem that has been happening ever since introducing the delayed "EnablePlayerControls"Is it is getting a 2 second black screen when teleporting , inbetween the IMOD calls.Hence an 8 second teleport instead of 6 seconds. 3 second fade out >>> 2 sec Black screen >>> 3 sec fade in>>> Enable Player Crtl Link to comment Share on other sites More sharing options...
Andyno Posted December 1, 2017 Author Share Posted December 1, 2017 I tried to test both your script suggestions, but they suddenly somehow broke my cell. I got this error from this thread...https://forums.nexusmods.com/index.php?/topic/1041005-fallout-3-black-screen/... except that every other cell I tried to load, loaded perfectly without any issues. When I put back my old script, there were no issues.GECK has still that power to suprise me after all that years of modding... :wallbash: Link to comment Share on other sites More sharing options...
skittered Posted December 1, 2017 Share Posted December 1, 2017 (edited) Just off the top of my head ... Begin OnTriggerEnter Player If TeleportSwitch == 0 DisablePlayerControls PlaySound DRSDLC05TeleporterClose IMOD DLC05TeleportOutISFX Set TeleportSwitch to 1 ENDif End Begin GameMode If TeleportSwitch > 0 IF Timer >= 6 EnablePlayerControls Set TeleportSwitch to 0 Set Timer to 0 ELSEif Timer >= 3 && TeleportSwitch == 1 Player.MoveTo BMTeleportMarker01REF PlaySound DRSDLC05TeleporterOpen IMOD DLC05TeleportInISFX set TeleportSwitch to 2 ELSE set Timer to Timer + getSecondsPassed ENDif ENDif End .. untested .. just a thought. Also, are you testing from a save in the cell with your original script in it? .. I seem to recall reading somewhere that changing script then trying to run the new stuff over top of a save with the original script in it can cause some issues. Edited December 1, 2017 by skittered Link to comment Share on other sites More sharing options...
Mktavish Posted December 2, 2017 Share Posted December 2, 2017 Just off the top of my head ... Begin OnTriggerEnter Player If TeleportSwitch == 0 DisablePlayerControls PlaySound DRSDLC05TeleporterClose IMOD DLC05TeleportOutISFX Set TeleportSwitch to 1 ENDif End Begin GameMode If TeleportSwitch > 0 IF Timer >= 6 EnablePlayerControls Set TeleportSwitch to 0 Set Timer to 0 ELSEif Timer >= 3 && TeleportSwitch == 1 Player.MoveTo BMTeleportMarker01REF PlaySound DRSDLC05TeleporterOpen IMOD DLC05TeleportInISFX set TeleportSwitch to 2 ELSE set Timer to Timer + getSecondsPassed ENDif ENDif End .. untested .. just a thought. Also, are you testing from a save in the cell with your original script in it? .. I seem to recall reading somewhere that changing script then trying to run the new stuff over top of a save with the original script in it can cause some issues. Wow nice looking script . It just feels right :D Link to comment Share on other sites More sharing options...
Mktavish Posted December 2, 2017 Share Posted December 2, 2017 Your script is working awesome with no black screen. But there is an imod at the end that shouldn't be. But I guess see what andy says ... since it's his mod ... I'm just helping Link to comment Share on other sites More sharing options...
Andyno Posted December 2, 2017 Author Share Posted December 2, 2017 skittered:Oh my, you did it! :dance: No issues at all, and the teleport feature works as I always wanted! Thanks a lot! :thumbsup: Regarding that black screen...You're right, I was loading my save in that specific cell, but I also loaded a very old save, and used COC to get here. It made no difference, so I leaved the idea of broken save behind. Really weird that uhmattbravo's and Mktavish's scripts caused this... Link to comment Share on other sites More sharing options...
Mktavish Posted December 2, 2017 Share Posted December 2, 2017 skittered:Oh my, you did it! :dance: No issues at all, and the teleport feature works as I always wanted! Thanks a lot! :thumbsup: So you see the IMOD's playing as they should ? And actually I guess it wasn't that it was playing a 3rd IMOD. It's that the first IMOD is playing backwards and there is a half second of no imod at the first teleport just before moving the player to second spot. (but the second spot is working perfectly) When stepping into teleport , it instantly goes to white screen , then fades in to a clear screen ... then the player gets moved. Link to comment Share on other sites More sharing options...
Recommended Posts