Some 10 years ago I spiced up BILL_MarksDaedraScript so it would spawn a little more than only the one daedra lord once. This has worked well ever since then, but became a bit too predictable lately.
Last saturday morning I thought of a way more subtle approach which was easily programmed in only a couple of minutes. The original script now fires background script (CIB) if it isn't already running, CIB checks your level and luck and responds accordingly with a wide variation of Daedra, up to the most horrendous ones at player's highest levels.
BUT IT CRASHES QUITE OFTEN, at any point, and after four days of tweaking and testing I still have no clue what causes that. Maybe I do something utterly stupid that shouldn't be done in a Started Script, something I don't recognize as such.
I have run out of ideas how to discover whatever the error is. I've stripped the script to its bare essentials and still it's CTD at the randomest of moments.
If ANYONE out there has any idea how to successfully squash this bug, I would be very very grateful.
Azurolf
The Code :
=============================My changes to the Bill Script=============================begin BILL_MarksDaedraSummon; Summon an Daedra when an item is removed from altar;; script location: should be placed upon an object on a Daedric Altar ;; variables short done;; # 15303 - if this fixes it, i'll be very disappointed; # Just for Debugging CTD in started Script - maybe this makes a diffif ( menuMode == 1 ) returnendif; # Of course, now one can avoid the Curse simply by having INV open, take the item and drop it there; # Alas Ancestral Tomb - this doesn't fix it either;if ( onActivate == 1 ) if ( scriptRunning rtk_cursed_item_bg == 1 ) messageBox "CIB adding one more Foe" set rtkg_cib_1_more to rtkg_cib_1_more + 1 else messageBox "CIB starting" startScript rtk_cursed_item_bg endif Activate endif;return;End=======================================The Randomly Crashing Background Script=======================================begin rtk_cursed_item_bg;; # 15228 My update from 2005 in Bill_marks_Daedra etc completely svcks due to old age; # Time to start from scratch with a script that ; # A # Runs in the background so you can exit but not escape; # B # Adds a lot more variation in the Spawnees (been doing that quite a lot lately); # C # Other Things;; # Unfortunately, this scriptlet CTDs at seemingly random moments:; # # Often when picking up a Cursed Item straight after Game Load; # # # Leaving and returning to the Cell sometimes prevents this - or is that part of the Random deception ??? ; # # When first pickup worx OK, then second may fail between the Gong (initial Bell) and the first Spawn; # # First pickup may work well for a while and then CTD anywhere; # # Opening a Container / Corpse while script runs sometimes leads to immediate CTD ;; # 15228-15303 Originally this scriptlet did the spawning as well, but I put that in a second BG script; # # - which isn't performed - yet; # # - in an attempt to locate the error; # # - this baby still crashes;short swInit;short PL ; # player Levelshort PS ; # player 'stage';short spawnCount ; # Number of Spawnsshort spawnMax ; # Total to Spawn; float timer ; # float tSpawn ; # Time between Spawns;; # 'registers' :short ranshort s1short s2;SHORT RN ; # Frames Delay after leaving Menu Mode - doesnt fix it;;;;messageBox "CIB Poll";if ( menuMode == 1 ) SET RN TO 5 returnendif;if ( RN > 0 ) MESSAGEBOX "CIB Menu Mode Delay %G - Init:%G" RN swInit SET RN TO RN - 1 returnendif;if ( swInit == 0 ) set swInit to 1 playSound "bell6"; messageBox "CIB Initializing"; set PL to ( player->getLevel ) set spawnMax to 1 + ( PL + 1 ) / 10 ; # 9 -> 1 , 10 -> 2 etc set s1 to ( player->getLuck ) ;;;if ( Random100 < s1 ) ; # Luck = More Fun ! set ran to ( random 100 ) if ( ran < s1 ) ; # Luck = More Fun ! set spawnMax to spawnMax + 1 endif set spawnCount to 0 set tSpawn to ( 100.0 - PL ) / 5 ;set timer to 0 ;set timer to tSpawn set timer to tSpawn - 1.0; set PS to 1 + ( PL + 5 ) / 10 set rtkg_cib_ps to PS; ; # messageBox "The Daedric Curse is upon You" messagebox "CIB Time %.2f , Total %G" tSpawn spawnMax "OK" messageBox "More : %G" rtkg_cib_1_more returnendif;if ( rtkg_cib_1_more > 0 ) set spawnMax to spawnMax + rtkg_cib_1_more set rtkg_cib_1_more to 0 returnendif;set timer to timer + getSecondsPassed;;;messageBox "CIB Running...( %.2f / %.2f )" timer tSpawn;if ( timer < tSpawn ) returnendif;set timer to 0 ;set spawnCount to spawnCount + 1;messageBox "Here comes number %G/%G" spawnCount spawnMax ;;; "OK";if ( spawnCount < spawnMax ); set ran to ( random 100 ) set s1 to ran / 25 messageBox "Thunder %G" s1; if ( s1 == 0 ) ; playSound "Thunder0" elseif ( s1 == 1 ) ; playSound "Thunder1" elseif ( s1 == 2 ) ; playSound "Thunder2" elseif ( s1 == 3 ) ; playSound "ThunderClap" else ; # NOT - too weak , that's why / 25 , not / 20 ; playSound "Thunder3" endif;else; playSound "bell1";endif;;;;startScript rtk_cursed_item_bg_sel;if ( spawnCount < spawnMax ) messageBox "CIB More will follow" returnendif;messageBox "CIB Stopping" ;;; "OK"set swInit to 0;stopScript rtk_cursed_item_bg;;;;return;end;