I'm currently pulling my hair out as one of the core features of my project has given up the ghost.
What Im trying to do from the below is have it so that every 15 seconds, the timer will get a random number, then if that random number equals to one of the conditions below, it runs the 'event'.
Seems simple in principle.
But yesterday, when tweaking, I added another of these 'events' only for the whole script to decide to stop working.
I can't fathom exactly what I've done wrong, and was hoping someone with a fresh perspective could look at it and give me a helping hand?
scn TARDISrandomEncounter SCRIPTshort deathTrueshort vortexencounterfloat Encounterbegin GameMode If Encounter == 1 ; Initialises the TARDISrandomTimer between random events set deathTrue to 0 if TARDISrandomTimer < 15 set TARDISrandomTimer to TARDISrandomTimer + GetSecondsPassed else set vortexencounter to getrandompercent showMessage TARDISbroke vortexencounter set TARDISrandomTimer to 0 set Encounter to 2 endif endif If Encounter == 2 Set Encounter to 0 if vortexencounter >= 95 ;Big bad explosion set TARDISrandomTimer to 0 showMessage TARDISemergency imod MegatonNukeISFX ;set tardiscode to 2 set tardisshields to tardisshields - 25 set tardisalert to 1 tardisemerg.enable TriggerHitShader 15 consolefire1.enable consolefire2.enable consolefire3.enable consolefire4.enable consolefire5.enable consolefire6.enable set Encounter to 1 elseif vortexencounter >= 25 && <= 94 ;minor turbulence set TARDISrandomTimer to 0 set tardisshields to tardisshields - 5 TriggerHitShader 30 PlaySound FXExplosionGrenadePlasmaLow set Encounter to 1 elseif vortexencounter >= 0 && <= 24 ;nothing set TARDISrandomTimer to 0 set Encounter to 1 endif endif if deathTrue == 0 if tardisshields <= 0 set deathTrue to 1 player.killActor imod FadeToWhiteISFX PlaySound FXExplosionNukeSmall3D PlaySound FXExplosionNukeSmall2D PlaySound TARDIScloisterBell endif endifend
Cheers
Kris