Half-bug reports:
Clicking on "Get Variable Index" will bring up the error list, if there are errors.
Bad references still have the odd vanilla CS error tag, at the right line. While your better description comes at the end. Script is
Spoiler scn cobGrindListCoblItemsOS
begin onAdd
cobGrindListCont.AddItem cobGrindListCoblItems 1
;--Gems------------------------------------------------
;--Gold
set cobGrindFAR.rOldItem to Gem0GoldNugget
set cobGrindFAR.rNewItem to cobGeoGoldDust
cobGrindFAR.Activate cobGenActRef, 1
;--Silver
set cobGrindFAR.rOldItem to Gem0SilverNugget
set cobGrindFAR.rNewItem to cobGeoSilverDust
cobGrindFAR.Activate cobGenActRef, 1
;--Pearl
set cobGrindFAR.rOldItem to Gem1Pearl
set cobGrindFAR.rNewItem to cobGeoPearlDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem1PearlFlawed
set cobGrindFAR.rNewItem to cobGeoPearlDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem1PearlFlawless
set cobGrindFAR.rNewItem to cobGeoPearlDust
cobGrindFAR.Activate cobGenActRef, 1
;--Topaz
set cobGrindFAR.rOldItem to Gem2Topaz
set cobGrindFAR.rNewItem to cobGeoTopazDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem2TopazFlawed
set cobGrindFAR.rNewItem to cobGeoTopazDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem2TopazFlawless
set cobGrindFAR.rNewItem to cobGeoTopazDust
cobGrindFAR.Activate cobGenActRef, 1
;--Ruby
set cobGrindFAR.rOldItem to Gem3Ruby
set cobGrindFAR.rNewItem to cobGeoRubyDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem3RubyFlawed
set cobGrindFAR.rNewItem to cobGeoRubyDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem3RubyFlawless
set cobGrindFAR.rNewItem to cobGeoRubyDust
cobGrindFAR.Activate cobGenActRef, 1
;--Sapphire
set cobGrindFAR.rOldItem to Gem4Sapphire
set cobGrindFAR.rNewItem to cobGeoSapphireDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem4SapphireFlawed
set cobGrindFAR.rNewItem to cobGeoSapphireDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem4SapphireFlawless
set cobGrindFAR.rNewItem to cobGeoSapphireDust
cobGrindFAR.Activate cobGenActRef, 1
;--Emerald
set cobGrindFAR.rOldItem to Gem5Emerald
set cobGrindFAR.rNewItem to cobGeoEmeraldDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem5EmeraldFlawed
set cobGrindFAR.rNewItem to cobGeoEmeraldDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem5EmeraldFlawless
set cobGrindFAR.rNewItem to cobGeoEmeraldDust
cobGrindFAR.Activate cobGenActRef, 1
;--Diamond
set cobGrindFAR.rOldItem to Gem6Diamond
set cobGrindFAR.rNewItem to cobGeoDiamondDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem6DiamondFlawed
set cobGrindFAR.rNewItem to cobGeoDiamondDust
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to Gem6DiamondFlawless
set cobGrindFAR.rNewItem to cobGeoDiamondDust
cobGrindFAR.Activate cobGenActRef, 1
;--Metals/Ores --------------------------------------
;--Dwemer Scrap Metal
set cobGrindFAR.rOldItem to cobTiDwemerScrapMetal
set cobGrindFAR.rNewItem to cobTiDwemerFilings
cobGrindFAR.Activate cobGenActRef, 10
;--Copper
set cobGrindFAR.rOldItem to cobTiRawCopperContaminated
set cobGrindFAR.rNewItem to cobGrindSoilContaminants
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawCopperImpure
set cobGrindFAR.rNewItem to cobTiCopperFilings
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawCopperPure
set cobGrindFAR.rNewItem to cobTiCopperFilings
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawCopperPristine
set cobGrindFAR.rNewItem to cobTiCopperFilings
cobGrindFAR.Activate cobGenActRef, 10
;--Iron
set cobGrindFAR.rOldItem to cobTiRawIronContaminated
set cobGrindFAR.rNewItem to cobGrindSoilContaminants
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawIronImpure
set cobGrindFAR.rNewItem to cobTiIronFilings
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawIronPure
set cobGrindFAR.rNewItem to cobTiIronFilings
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawIronPristine
set cobGrindFAR.rNewItem to cobTiIronFilings
cobGrindFAR.Activate cobGenActRef, 10
;--Adamantium
set cobGrindFAR.rOldItem to cobTiRawAdamantiumContaminated
set cobGrindFAR.rNewItem to cobGrindSoilContaminants
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawAdamantiumImpure
set cobGrindFAR.rNewItem to cobTiAdamantiumFilings
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawAdamantiumPure
set cobGrindFAR.rNewItem to cobTiAdamantiumFilings
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawAdamantiumPristine
set cobGrindFAR.rNewItem to cobTiAdamantiumFilings
cobGrindFAR.Activate cobGenActRef, 10
;--Ebony
set cobGrindFAR.rOldItem to cobTiRawEbonyContaminated
set cobGrindFAR.rNewItem to cobGrindSoilContaminants
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawEbonyImpure
set cobGrindFAR.rNewItem to cobTiEbonyFilings
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawEbonyPure
set cobGrindFAR.rNewItem to cobTiEbonyFilings
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawEbonyPristine
set cobGrindFAR.rNewItem to cobTiEbonyFilings
cobGrindFAR.Activate cobGenActRef, 10
;--Glass
set cobGrindFAR.rOldItem to cobTiRawGlassContaminated
set cobGrindFAR.rNewItem to cobGrindSoilContaminants
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawGlassImpure
set cobGrindFAR.rNewItem to cobTiGlassPowder
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawGlassPure
set cobGrindFAR.rNewItem to cobTiGlassPowder
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawGlassPristine
set cobGrindFAR.rNewItem to cobTiGlassPowder
cobGrindFAR.Activate cobGenActRef, 10
;--Stalhrim
set cobGrindFAR.rOldItem to cobTiRawStalhrimContaminated
set cobGrindFAR.rNewItem to cobGrindSoilContaminants
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawStalhrimImpure
set cobGrindFAR.rNewItem to cobTiStalhrimFilings
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawStalhrimPure
set cobGrindFAR.rNewItem to cobTiStalhrimFilings
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to cobTiRawStalhrimPristine
set cobGrindFAR.rNewItem to cobTiStalhrimFilings
cobGrindFAR.Activate cobGenActRef, 10
;--Bones----------------------------------------
set cobGrindFAR.rOldItem to skelBigBone01
set cobGrindFAR.rNewItem to bonemeal
cobGrindFAR.Activate cobGenActRef, 10
set cobGrindFAR.rOldItem to skelBoneThin01
set cobGrindFAR.rNewItem to bonemeal
cobGrindFAR.Activate cobGenActRef, 10
set cobGrindFAR.rOldItem to skelClavicle01
set cobGrindFAR.rNewItem to bonemeal
cobGrindFAR.Activate cobGenActRef, 1
set cobGrindFAR.rOldItem to skelPelvis01
set cobGrindFAR.rNewItem to bonemeal
cobGrindFAR.Activate cobGenActRef, 15
set cobGrindFAR.rOldItem to skelRibcage01
set cobGrindFAR.rNewItem to bonemeal
cobGrindFAR.Activate cobGenActRef, 15
set cobGrindFAR.rOldItem to skull01
set cobGrindFAR.rNewItem to bonemeal
cobGrindFAR.Activate cobGenActRef, 15
;RemoveMe ;Script only runs once, so this isn't really necessary
end
errors are
[CS] Script 'cobGrindListCoblItemsOS', line 4:
Syntax error. Invalid reference 'cobGrindListCont' (only object references and reference variables are allowed in this context).
[CS] Script 'cobGrindListCoblItemsOS', line 199:
Unknown referenced object 'cobGrindListCont'.
So, I have some idea of what checks you're doing and why the bad reference bit comes at the end of the script. However, as far as usability the vanilla error message is meaninglessly general while yours explains exactly what the problem is, but without saying which lines had the bad reference. (Err... that is, the vanilla message could be a bad reference or bad variable name, and IIRC even a base object instead of a reference.)
[and 2 more]The error "Script command "PlayMagicShader" not found." references the line before the error. Stemming from the same error, I get a "Unknown function code 0." - it's on the correct line
but it's meaning isn't clear.
Spoiler ;--DO NOT MODIFY THIS SCRIPT!!!
; DOING SO WILL CAUSE CTDS AND STRANGE BEHAVIOR FOR USERS.
; If you need this script to do more, have a suggestion, or an alteration:
; contact the Cobl team at: http://www.uesp.net/wiki/Tes4Mod:Cobl/Modding/Board
;--VERSION HISTORY
; v1.73 Grinder overhaul
; v1.30 Fix silver to gold transmutation.
; v1.?? Rewrite so that grinding processes one item at a time.
; v1.06 First version.
scn cobGrinderOS
;--Script for grinder container
ref rSelf
short OpenStage ;Must wait for menu screen to open, so 1 for opening and 2 for 'menu has opened'
float SecondsUntilDone
float TimePassed
float NoiseTimer
float gameHourPrev
short gameDaysPrev
;--Obsolete
short action
float pause
begin onActivate
if SecondsUntilDone
Message "Ouch! That's hot! (%f seconds until done)" SecondsUntilDone
;cast a 0 pt Fire spell at player
else
Activate
set OpenStage to 1
endif
end
begin menuMode 1008
if OpenStage
set OpenStage to 2
endif
end
begin gameMode
if (OpenStage == 2)
;--Reset variables
set OpenStage to 0
set rSelf to GetSelf
set NoiseTimer to 0
set TimePassed to 0
set GameHourPrev to GetCurrentTime
set GameDaysPrev to GameDaysPassed
set SecondsUntilDone to 1 ;Always give a second for the tokens to run
;--Grind FAR global variables
set cobGrindFAR.rCont to rSelf
set cobGrindFAR.MoreSeconds to 0
;--Run the tokens by moving them here
cobGrindListCont.RemoveAllItems rSelf
;--Make that grinder look and sound like it's grinding (grind it, grind it good)
PlayMagicShader cobGrinderFX
PlaySound3d cobGrinderSND
endif
if SecondsUntilDone
if (GetInSameCell player) ;--Keeps the activator from running when player leaves the cell (setting variables makes the script run once more, so if a variable is set every time the script keeps running)
;--Calculate the amount of time that has passed
set TimePassed to ((GetCurrentTime - GameHourPrev) + 24*(GameDaysPassed - GameDaysPrev))*3600/TimeScale
if (TimePassed <= 0)
set TimePassed to GetSecondsPassed
endif
if (TimePassed <= 0) ;Ultra-paranoid check - I can't imagine why GSP would be 0, but just in case
set TimePassed to 0
endif
set GameHourPrev to GetCurrentTime
set GameDaysPrev to GameDaysPassed
;--Figure out new SecondsUntilDone
if cobGrindFAR.MoreSeconds
set SecondsUntilDone to (SecondsUntilDone + MoreSeconds)
set cobGrindFAR.MoreSeconds to 0
endif
set SecondsUntilDone to (SecondsUntilDone - TimePassed)
;--Keep running or stop
if (SecondsUntilDone > 0)
set NoiseTimer to (NoiseTimer + TimePassed)
if (NoiseTimer >= 1)
set NoiseTimer to 0
PlaySound3D cobGrindSND
endif
else
set SecondsUntilDone to 0
;play some kind of winding-down sound
StopMagicShader cobGrinderFX
endif
endif
endif
end
Errors complete
Spoiler [CS] Script 'cobGrindRegisterFAS', line 6:
Syntax Error. Unknown command 'rToken'.
[CS] Script 'cobGrinderOS', line 59:
Script command "PlayMagicShader" not found.
[CS] Script 'cobGrinderOS', line 91:
Script command "StopMagicShader" not found.
[CS] Script 'cobGrinderOS', line 58:
Syntax error. Invalid reference 'cobGrindListCont' (only object references and reference variables are allowed in this context).
[CS] Script 'cobGrinderOS', line 60:
Unknown function code 0.
[CS] Script 'cobGrinderOS', line 78:
Syntax Error. Unknown command 'MoreSeconds'.
[CS] Script 'cobGrinderOS', line 78:
Syntax Error. Missing expression in set command.
[CS] Script 'cobGrinderOS', line 87:
Item 'cobGrindSND' not found for parameter Sound.
Compiled script not saved!
[CS] Script 'cobGrinderOS', line 92:
Unknown function code 0.
[CS] Script 'cobGrinderOS', line 96:
Unknown referenced object 'cobGrindListCont'.
and important ones
...
[CS] Script 'cobGrinderOS', line 59:
Script command "PlayMagicShader" not found.
[CS] Script 'cobGrinderOS', line 91:
Script command "StopMagicShader" not found.
...
[CS] Script 'cobGrinderOS', line 60:
Unknown function code 0.
...
[CS] Script 'cobGrinderOS', line 92:
Unknown function code 0.