Why does this run in editor, but crash in base game

Discuss modding questions and implementation details.
Post Reply
l3lessed
Posts: 1405
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Why does this run in editor, but crash in base game

Post by l3lessed »

So, I was about to release 1.4 updates to the shield module. I built it and launched it in base DFU game. Well, after checking the mod settings and enabling it and starting the game, it crashes before anything loads. The crash log itself is very little help,

Heres the log:

Code: Select all

DFTFU 1.8.9: scene index = 1
 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

ModManager - started loading mod: Shield Module
 
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 43)

Crash!!!
SymInit: Symbol-SearchPath: '.;F:\Games\DF Unity;F:\Games\DF Unity;C:\WINDOWS;C:\WINDOWS\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 534, UserName: 'mount'
OS-Version: 10.0.0
F:\Games\DF Unity\DaggerfallUnity.exe:DaggerfallUnity.exe (00007FF63AAA0000), size: 671744 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2018.2.21.8949
C:\WINDOWS\SYSTEM32\ntdll.dll:ntdll.dll (00007FF8BD160000), size: 2031616 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\Program Files\AVAST Software\Avast\aswhook.dll:aswhook.dll (00007FF8ABF00000), size: 77824 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 20.3.5200.0
C:\WINDOWS\System32\KERNEL32.DLL:KERNEL32.DLL (00007FF8BCC70000), size: 729088 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.778
C:\WINDOWS\System32\KERNELBASE.dll:KERNELBASE.dll (00007FF8BAAA0000), size: 2768896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
F:\Games\DF Unity\UnityPlayer.dll:UnityPlayer.dll (00007FF8338F0000), size: 23760896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2018.2.21.8949
C:\WINDOWS\System32\CRYPT32.dll:CRYPT32.dll (00007FF8BAF50000), size: 1347584 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.592
C:\WINDOWS\System32\ucrtbase.dll:ucrtbase.dll (00007FF8BA8A0000), size: 1024000 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\WINDOWS\System32\MSASN1.dll:MSASN1.dll (00007FF8BA050000), size: 73728 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\USER32.dll:USER32.dll (00007FF8BB230000), size: 1654784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\System32\win32u.dll:win32u.dll (00007FF8BA9A0000), size: 135168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\System32\GDI32.dll:GDI32.dll (00007FF8BC930000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\gdi32full.dll:gdi32full.dll (00007FF8BAD50000), size: 1654784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\System32\msvcp_win.dll:msvcp_win.dll (00007FF8BB150000), size: 647168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\WINDOWS\System32\ole32.dll:ole32.dll (00007FF8BC960000), size: 1404928 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.693
C:\WINDOWS\System32\combase.dll:combase.dll (00007FF8BCD30000), size: 3366912 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\WINDOWS\System32\RPCRT4.dll:RPCRT4.dll (00007FF8BC760000), size: 1179648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.628
C:\WINDOWS\System32\bcryptPrimitives.dll:bcryptPrimitives.dll (00007FF8BA9D0000), size: 524288 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\System32\advapi32.dll:advapi32.dll (00007FF8BB3E0000), size: 667648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.752
C:\WINDOWS\System32\msvcrt.dll:msvcrt.dll (00007FF8BC880000), size: 647168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 7.0.18362.1
C:\WINDOWS\System32\sechost.dll:sechost.dll (00007FF8BB540000), size: 618496 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.693
C:\WINDOWS\System32\SHLWAPI.dll:SHLWAPI.dll (00007FF8BBF60000), size: 335872 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\SETUPAPI.dll:SETUPAPI.dll (00007FF8BC290000), size: 4653056 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\cfgmgr32.dll:cfgmgr32.dll (00007FF8BAA50000), size: 303104 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.387
C:\WINDOWS\System32\bcrypt.dll:bcrypt.dll (00007FF8BA0F0000), size: 155648 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.267
C:\WINDOWS\System32\SHELL32.dll:SHELL32.dll (00007FF8BB800000), size: 7225344 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\WINDOWS\System32\shcore.dll:shcore.dll (00007FF8BB490000), size: 692224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\System32\windows.storage.dll:windows.storage.dll (00007FF8BA120000), size: 7856128 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\System32\profapi.dll:profapi.dll (00007FF8BA0C0000), size: 143360 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.693
C:\WINDOWS\System32\powrprof.dll:powrprof.dll (00007FF8BA070000), size: 303104 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\UMPDC.dll:UMPDC.dll (00007FF8BA020000), size: 65536 (result: 0), SymType: '-deferred-', PDB: ''
C:\WINDOWS\System32\kernel.appcore.dll:kernel.appcore.dll (00007FF8BA030000), size: 69632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\cryptsp.dll:cryptsp.dll (00007FF8BB1F0000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\WS2_32.dll:WS2_32.dll (00007FF8BC070000), size: 454656 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.387
C:\WINDOWS\System32\OLEAUT32.dll:OLEAUT32.dll (00007FF8BB730000), size: 802816 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\System32\IMM32.dll:IMM32.dll (00007FF8BC040000), size: 188416 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.387
C:\WINDOWS\SYSTEM32\HID.DLL:HID.DLL (00007FF8B8A80000), size: 57344 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\WindowsCodecs.dll:WindowsCodecs.dll (00007FF8B5350000), size: 1765376 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.778
C:\WINDOWS\SYSTEM32\VERSION.dll:VERSION.dll (00007FF8B3010000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\OPENGL32.dll:OPENGL32.dll (00007FF84B230000), size: 1400832 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.387
C:\WINDOWS\SYSTEM32\WINMM.dll:WINMM.dll (00007FF8B7EB0000), size: 147456 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\WINHTTP.dll:WINHTTP.dll (00007FF8B0100000), size: 983040 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.778
C:\WINDOWS\SYSTEM32\GLU32.dll:GLU32.dll (00007FF8B24D0000), size: 180224 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.387
C:\WINDOWS\SYSTEM32\WINMMBASE.dll:WINMMBASE.dll (00007FF8B7E80000), size: 184320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\dxcore.dll:dxcore.dll (00007FF8B8AE0000), size: 131072 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\system32\uxtheme.dll:uxtheme.dll (00007FF8B81E0000), size: 626688 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.449
F:\Games\DF Unity\Mono\EmbedRuntime\mono.dll:mono.dll (00007FF8333A0000), size: 5545984 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 1.0.0.1
C:\WINDOWS\System32\PSAPI.DLL:PSAPI.DLL (00007FF8BB3D0000), size: 32768 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\MSWSOCK.dll:MSWSOCK.dll (00007FF8B9890000), size: 421888 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\WINDOWS\System32\MSCTF.dll:MSCTF.dll (00007FF8BC0E0000), size: 1269760 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.752
C:\WINDOWS\SYSTEM32\d3d11.dll:d3d11.dll (00007FF8B7140000), size: 2469888 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.387
C:\WINDOWS\SYSTEM32\dxgi.dll:dxgi.dll (00007FF8B8B70000), size: 962560 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_9952681a7bb1dfac\nvldumdx.dll:nvldumdx.dll (00007FF8B3020000), size: 978944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 26.21.14.4587
C:\WINDOWS\SYSTEM32\cryptnet.dll:cryptnet.dll (00007FF8B2E70000), size: 192512 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\cryptbase.dll:cryptbase.dll (00007FF8B9A60000), size: 49152 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\WINTRUST.DLL:WINTRUST.DLL (00007FF8BAEF0000), size: 376832 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.387
C:\WINDOWS\System32\imagehlp.dll:imagehlp.dll (00007FF8BB210000), size: 118784 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\system32\rsaenh.dll:rsaenh.dll (00007FF8B9400000), size: 208896 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\DriverStore\FileRepository\nv_dispi.inf_amd64_9952681a7bb1dfac\nvwgf2umx.dll:nvwgf2umx.dll (00007FF875940000), size: 41762816 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 26.21.14.4587
C:\WINDOWS\system32\nvspcap64.dll:nvspcap64.dll (00007FF875400000), size: 2846720 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 3.20.3.63
C:\WINDOWS\SYSTEM32\ntmarta.dll:ntmarta.dll (00007FF8B8ED0000), size: 200704 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\clbcatq.dll:clbcatq.dll (00007FF8BD070000), size: 663552 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 2001.12.10941.16384
C:\WINDOWS\system32\wbem\wbemprox.dll:wbemprox.dll (00007FF8B00E0000), size: 69632 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\wbemcomn.dll:wbemcomn.dll (00007FF8AF0A0000), size: 540672 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\system32\wbem\wbemsvc.dll:wbemsvc.dll (00007FF8AAF80000), size: 81920 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\system32\wbem\fastprox.dll:fastprox.dll (00007FF8AAFA0000), size: 1052672 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\amsi.dll:amsi.dll (00007FF8AAEA0000), size: 86016 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\USERENV.dll:USERENV.dll (00007FF8B9F10000), size: 151552 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.387
C:\Program Files\AVAST Software\Avast\aswAMSI.dll:aswAMSI.dll (00007FF88E500000), size: 2838528 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 20.3.5200.0
C:\WINDOWS\SYSTEM32\mscms.dll:mscms.dll (00007FF8B4F60000), size: 712704 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\SYSTEM32\ColorAdapterClient.dll:ColorAdapterClient.dll (00007FF8B4F40000), size: 94208 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\SYSTEM32\icm32.dll:icm32.dll (00007FF873F40000), size: 274432 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\System32\MMDevApi.dll:MMDevApi.dll (00007FF8AF660000), size: 466944 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.387
C:\WINDOWS\System32\DEVOBJ.dll:DEVOBJ.dll (00007FF8B9E20000), size: 172032 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.387
C:\WINDOWS\SYSTEM32\AUDIOSES.DLL:AUDIOSES.DLL (00007FF8AF870000), size: 1429504 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\WINDOWS\SYSTEM32\wintypes.dll:wintypes.dll (00007FF8B5AC0000), size: 1388544 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\SYSTEM32\resourcepolicyclient.dll:resourcepolicyclient.dll (00007FF8B8520000), size: 81920 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\xinput1_3.dll:xinput1_3.dll (0000000000400000), size: 122880 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 9.18.944.0
C:\WINDOWS\SYSTEM32\TextInputFramework.dll:TextInputFramework.dll (00007FF8B1B00000), size: 647168 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.693
C:\WINDOWS\SYSTEM32\CoreUIComponents.dll:CoreUIComponents.dll (00007FF8B5C20000), size: 3317760 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.207
C:\WINDOWS\SYSTEM32\CoreMessaging.dll:CoreMessaging.dll (00007FF8B7DA0000), size: 868352 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.836
C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL:IPHLPAPI.DLL (00007FF8B95A0000), size: 237568 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\NSI.dll:NSI.dll (00007FF8BC920000), size: 32768 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.449
C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL:dhcpcsvc6.DLL (00007FF8B2AA0000), size: 90112 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL:dhcpcsvc.DLL (00007FF8B2F30000), size: 114688 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\WINDOWS\SYSTEM32\DNSAPI.dll:DNSAPI.dll (00007FF8B95E0000), size: 831488 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.815
C:\Windows\System32\rasadhlp.dll:rasadhlp.dll (00007FF8A7350000), size: 40960 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\System32\fwpuclnt.dll:fwpuclnt.dll (00007FF8AFF90000), size: 487424 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.207
C:\WINDOWS\SYSTEM32\dwmapi.dll:dwmapi.dll (00007FF8B8610000), size: 184320 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.267
C:\WINDOWS\SYSTEM32\dbghelp.dll:dbghelp.dll (00007FF8B26E0000), size: 2048000 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1
C:\WINDOWS\SYSTEM32\SspiCli.dll:SspiCli.dll (00007FF8B9F40000), size: 192512 (result: 0), SymType: '-deferred-', PDB: '', fileVersion: 10.0.18362.1

========== OUTPUTTING STACK TRACE ==================

0x00007FF8333C1022 (mono) mono_class_from_typeref
0x00007FF83342E6CD (mono) mono_reflection_get_custom_attrs_blob
0x00007FF833433F47 (mono) mono_custom_attrs_get_attr
0x00000137CE1331C4 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.Emit.TypeBuilder:create_runtime_class (System.Reflection.Emit.TypeBuilder)
0x00000137CE1328CA (Mono JIT Code) System.Reflection.Emit.TypeBuilder:CreateType ()
0x00000137E8E9F298 (Mono JIT Code) Mono.CSharp.TypeDefinition:CloseContainer ()
0x00000137E8E9F0E7 (Mono JIT Code) Mono.CSharp.TypeContainer:CloseContainer ()
0x00000137E8E9F0E7 (Mono JIT Code) Mono.CSharp.TypeContainer:CloseContainer ()
0x00000137E8E9F0E7 (Mono JIT Code) Mono.CSharp.TypeContainer:CloseContainer ()
0x00000137E8E9F046 (Mono JIT Code) Mono.CSharp.ModuleContainer:CloseContainer ()
0x00000137CE0DEC19 (Mono JIT Code) CSharpCompiler.CustomDynamicDriver:Compile (System.Reflection.Emit.AssemblyBuilder&,System.AppDomain,bool)
0x00000137CE0D9F22 (Mono JIT Code) CSharpCompiler.CodeCompiler:CompileFromCompilerSettings (Mono.CSharp.CompilerSettings,bool)
0x00000137CE0D8F1C (Mono JIT Code) CSharpCompiler.CodeCompiler:CompileAssemblyFromSourceBatch (System.CodeDom.Compiler.CompilerParameters,string[])
0x00000137CE0D7F37 (Mono JIT Code) DaggerfallWorkshop.Game.Utility.Compiler:CompileSource (string[],bool,bool)
0x00000137CE0D795F (Mono JIT Code) DaggerfallWorkshop.Game.Utility.ModSupport.ModManager:CompileFromSourceAssets (string[])
0x00000137CE0D76A8 (Mono JIT Code) DaggerfallWorkshop.Game.Utility.ModSupport.Mod:CompileSourceToAssemblies ()
0x00000137CE0D73A4 (Mono JIT Code) DaggerfallWorkshop.Game.Utility.ModSupport.ModManager:Init ()
0x00000137CE0D7109 (Mono JIT Code) DaggerfallWorkshop.Game.Utility.ModSupport.ModManager:StateManager_OnStateChange (DaggerfallWorkshop.Game.StateManager/StateTypes)
0x00000137CE0D70BC (Mono JIT Code) DaggerfallWorkshop.Game.StateManager:TriggerStateChange (DaggerfallWorkshop.Game.StateManager/StateTypes)
0x00000137CE0D701C (Mono JIT Code) DaggerfallWorkshop.Game.StateManager:ChangeState (DaggerfallWorkshop.Game.StateManager/StateTypes)
0x00000137CE0D6859 (Mono JIT Code) DaggerfallWorkshop.Game.StateManager:.ctor (DaggerfallWorkshop.Game.StateManager/StateTypes)
0x00000137CE0D67AE (Mono JIT Code) DaggerfallWorkshop.Game.GameManager:get_StateManager ()
0x00000137CE0D64C2 (Mono JIT Code) DaggerfallWorkshop.Game.Automap:Update ()
0x00000137C3C735AB (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
0x00007FF8334C671B (mono) mono_set_defaults
0x00007FF833418A71 (mono) mono_runtime_invoke
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF833EE3CE4)
0x00007FF833EE3CE4 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF833EE1260)
0x00007FF833EE1260 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF833EC58A9)
0x00007FF833EC58A9 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF833EC5A40)
0x00007FF833EC5A40 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF833C92AD0)
0x00007FF833C92AD0 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF833DCC887)
0x00007FF833DCC887 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF833DCC912)
0x00007FF833DCC912 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF833DCE72F)
0x00007FF833DCE72F (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF834489215)
0x00007FF834489215 (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF83448835A)
0x00007FF83448835A (UnityPlayer) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF83448AB0B)
0x00007FF83448AB0B (UnityPlayer) (function-name not available)
0x00007FF83448ACDB (UnityPlayer) UnityMain
  ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FF63AAA1207)
0x00007FF63AAA1207 (DaggerfallUnity) (function-name not available)
0x00007FF8BCC87BD4 (KERNEL32) BaseThreadInitThunk
0x00007FF8BD1CCE51 (ntdll) RtlUserThreadStart

========== END OF STACKTRACE ===========

A crash has been intercepted by the crash handler. For call stack and other details, see the latest crash report generated in:
 * C:/Users/mount/AppData/Local/Temp/Daggerfall Workshop/Daggerfall Unity/Crashes
I setup some Enum structures, but I don't see why those would be a problem, unless it is for some reason conflicting with the workshop enums already setup. Any help would be appreciated.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1405
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Why does this run in editor, but crash in base game

Post by l3lessed »

Here's the script:

Code: Select all

using UnityEngine;
using System;
using DaggerfallConnect;
using DaggerfallWorkshop.Game.Entity;
using DaggerfallWorkshop.Game.Items;
using DaggerfallWorkshop.Game.Utility.ModSupport;
using DaggerfallWorkshop.Game.Utility.ModSupport.ModSettings; //required for modding features
using DaggerfallWorkshop.Game.Formulas;
using DaggerfallWorkshop.Game.MagicAndEffects;
using DaggerfallWorkshop.Game.MagicAndEffects.MagicEffects;
using System.IO;
using System.Collections;

namespace DaggerfallWorkshop.Game.FPSShield
{
    public class FPSShield : MonoBehaviour
    {
        public enum ShieldStates
        {
            Idle,               // Record 0
            Raising,         // Record 1
            Raised,     // Record 2
            Lowering,         // Record 3
            Bash,        // Record 4            
        }

        public enum ShieldTypes
        {
            Buckler,               // Record 0
            Round,         // Record 1
            Kite,     // Record 2
            Tower,         // Record 3       
        }

        //shield rect. Used to store and redraw the shield on user UI.
        #region UI Rects
        Rect shieldPos = new Rect(0, Screen.height - 400, 850, 850);
        #endregion

        //sets up different class properties.
        #region Properties
        //initiates mod instances for mod manager.
        static Mod mod;
        static FPSShield instance;
        static ModSettings settings;
        GameObject mainCamera;

        //formula helper entities.
        EnemyAttack enemyAttack;
        static DaggerfallEntity enemyEntity;

        //initiates 2d textures for storing texture data.
        static Texture2D shieldTex;

        //block activate coroutine objects.
        private IEnumerator BlockActivateCoroutine;       

        //texture drawing coroutine objects.
        private IEnumerator textureDrawCoroutine;

        //individual animation coroutine objects for animation manager.
        private IEnumerator bobCoroutine;
        private IEnumerator ShieldAttackcoroutine;
        private IEnumerator currentAnimation;
        private IEnumerator hitCoroutine;
        private IEnumerator doneCoroutine;
        private IEnumerator startCoroutine;

        //Shield state object for assigning shield states.        
        ShieldStates shieldStates;
        ShieldTypes shieldTypes;

        //used for storing texture path for shield.
        public string smallTexture_Path;
        public string largeTexture_Path;

        //block key.
        string blockKey;
        //keycode object to store block key code value.
        KeyCode blockKeyCode;

        //used for lerp calculator. Need to create custom mod scripting hook files for myself and others.
        static bool lerpfinished;
        private bool breatheTrigger;
        //blocking switches to control the blocking mechanisms.
        public static bool isBlocking { get; set; }
        public static bool isHit { get; set; }
        public static bool blockStart { get; set; }
        static bool isRaised;
        static bool blockFinished;
        private bool shieldEquipped;
        private bool flip;
        private bool toggleBob;
        private bool moving;
        private bool bucklerMechanics;

        //formula helper properties.
        static float attackerDamage { get; set; }

        //lerp calculator properties.
        static float TimeCovered;
        static float totalTime;

        //Get weapon scale
        static float shieldScaleX;
        static float shieldScaleY;

        //values for actual weapon texture.
        static float xPos { get; set; }
        static float yPos { get; set; }
        static float size { get; set; }

        public bool GetEquippedShield
        {
            get { return EquippedShield(); }
            set { GetEquippedShield = value; }
        }

        //public global get current texture properties property.
        public float getxPos
        {
            get { return xPos; }
            set { xPos = value; }
        }

        public float getyPos
        {
            get { return yPos; }
            set { yPos = value; }
        }

        public float getSize
        {
            get { return size; }
            set { size = value; }
        }

        //position storing properties for texture animation.
        float startxPos = 0;
        float startyPos = 0;
        float startSize = 0;

        float currentxPos = 0;
        float currentyPos = 0;
        float currentSize = 0;

        float endxPos = 0;
        float endyPos = 0;
        float endSize = 0;

        //agility based modifers for shield timing and effectiveness.
        private float agilityMod;
        private float agilityTimeMod;

        //setting modifiers for blocking time and cost.
        private float BlockTimeMod;
        private float BlockCostMod;

        //block time properties used in below calcs.
        public float totalBlockTime = 2f;
        static float blockTimer = 0;
        private float AttackAnimeTime = 0;

        //creates general entity behavior object to assign to daggerfallunityentity objects(enemies pulled from formula helper).
        DaggerfallEntityBehaviour entityBehaviour;

        //sets up player entity class for easy retrieval and manipulation of player character.
        PlayerEntity playerEntity;

        //sets up player class instance properties for manipulation.
        public PlayerEntity PlayerEntity
        {
            get { return (playerEntity != null) ? playerEntity : playerEntity = GameManager.Instance.PlayerEntity; }
        }
        #endregion

        //starts mod manager on game begin. Grabs mod initializing paramaters.
        //ensures SateTypes is set to .Start for proper save data restore values.
        [Invoke(StateManager.StateTypes.Start, 0)]
        public static void Init(InitParams initParams)
        {
            Debug.Log("SHIELD MODULE STARTED!");
            //sets up instance of class/script/mod.
            GameObject go = new GameObject("FPSShield");
            instance = go.AddComponent<FPSShield>();
            //initiates mod paramaters for class/script.
            mod = initParams.Mod;
            //loads mods settings.
            settings = mod.GetSettings();
            //initiates save paramaters for class/script.
            //mod.SaveDataInterface = instance;
            //after finishing, set the mod's IsReady flag to true.
            mod.IsReady = true;
        }

        void Start()
        {
            //assigns the main camera engine object to mainCamera general object. Used to detect shield knock back directions.
            mainCamera = GameObject.FindGameObjectWithTag("MainCamera");

            //sets shield texture path, using the application base directory.
            smallTexture_Path = Application.dataPath + "/StreamingAssets/Textures/shields/buckler.png";
            largeTexture_Path = Application.dataPath + "/StreamingAssets/Textures/shields/heater.png";

            // Get weapon scale
            shieldScaleX = (float)Screen.width / 320;
            shieldScaleY = (float)Screen.height / 200;

            //set default shield texture properties.
            xPos = 0;
            yPos = 0;
            size = 118;

            shieldStates = ShieldStates.Idle;

            //debug coroutine for development purposes.
            //StartCoroutine(debug());

            //check if player has left handed enabled.
            flip = GameManager.Instance.WeaponManager.ScreenWeapon.FlipHorizontal;

            //register the formula calculate attack damage formula so can pull attack properties needed and zero out damage when player is blocking succesfully.
            FormulaHelper.RegisterOverride(mod, "CalculateAttackDamage", (Func<DaggerfallEntity, DaggerfallEntity, int, int, DaggerfallUnityItem, int>)CalculateAttackDamage);

            //binds mod settings to script properties.
            blockKey = settings.GetValue<string>("Settings", "blockKey");
            BlockTimeMod = settings.GetValue<float>("Settings", "BlockTimeMod");
            BlockCostMod = settings.GetValue<float>("Settings", "BlockCostMod");
            toggleBob = settings.GetValue<bool>("Settings", "ToggleBob");
            bucklerMechanics = settings.GetValue<bool>("Settings", "BucklerMechanics");

            //converts string key setting into valid unity keycode. Ensures mouse and keyboard inputs work properly.
            blockKeyCode = (KeyCode)Enum.Parse(typeof(KeyCode), blockKey);
        }

        void Update()
        {
            //if weapon is showing and no windows are open...
            if (GameManager.Instance.WeaponManager.ScreenWeapon.ShowWeapon && DaggerfallUI.UIManager.WindowCount == 0)
            {
                if (GetEquippedShield)
                {
                    //tells script the player has a valid equipped shield and has weapons showing.
                    shieldEquipped = true;

                    //starts the coroutine that draws and updates texture position.
                    textureDrawCoroutine = ShieldAnimation();
                    StartCoroutine(textureDrawCoroutine);

                    //start the coroutine that monitors the backside triggers and calculations to manage the blocking system.
                    BlockActivateCoroutine = BlockActivate();
                    StartCoroutine(BlockActivateCoroutine);
                }
            }
            else
            {
                //tells script shield is no longer equipped for use and stops above coroutines.
                shieldEquipped = false;

                if (textureDrawCoroutine != null)
                    StopCoroutine(textureDrawCoroutine);

                if (BlockActivateCoroutine != null)
                    StopCoroutine(BlockActivateCoroutine);
            }
        }

        //draws gui shield.
        private void OnGUI()
        {
            if (!shieldEquipped)
                ; //show nothing.
            //loads shield texture if weapon is showing.
            else if (GameManager.Instance.WeaponManager.ScreenWeapon.ShowWeapon == true && shieldEquipped)
            {
                GUI.DrawTextureWithTexCoords(shieldPos, shieldTex, new Rect(0.0f, 0.0f, .99f, .99f));
            }
        }

        #region AnimationManager

        //Custom built animation system. It uses IEnumerator object passthroughs and comparisons to find out what
        //current animation has already been loaded and then manages animation coroutines based
        //on input animation and vars. Look at below IENumerator animations to see how they are built.
        bool AnimationManager(IEnumerator loadAnimation, float waitTime, bool reset = false)
        {
            //checks to see if a current animation has been loaded yet by the manager. If not, load  player selected animation coroutine
            //to the current global static animation var.
            if (currentAnimation == null)
                currentAnimation = loadAnimation;

            //compare loaded animation with the current animation. If different, load new animation.
            if (currentAnimation.ToString() != loadAnimation.ToString())
            {
                Debug.Log(currentAnimation + " || " + loadAnimation);
                TimeCovered = 0;
                totalTime = 0;
                currentxPos = xPos;
                currentyPos = yPos;
                currentSize = size;
                StartCoroutine(pause(waitTime));
                StopCoroutine(currentAnimation);
                currentAnimation = loadAnimation;
                StartCoroutine(currentAnimation);
            }
            else if(currentAnimation.ToString() == loadAnimation.ToString() && lerpfinished && reset)
            {
                Debug.Log("RESET:" + currentAnimation + " || " + loadAnimation);
                TimeCovered = 0;
                totalTime = 0;
                currentxPos = xPos;
                currentyPos = yPos;
                currentSize = size;
                StartCoroutine(pause(waitTime));
                StopCoroutine(currentAnimation);
                currentAnimation = loadAnimation;
                StartCoroutine(currentAnimation);
            }
            //if animation/lerp calculator is finished reset animation/lerp calculator below and return a true for this bool.
            else if (lerpfinished)
            {
                StopCoroutine(currentAnimation);
                return true;
            }
            //if animation isn't finished return false.
            return false;
        }

        //pause timer for animations system.
        IEnumerator pause(float waitTime)
        {
            yield return new WaitForSeconds(waitTime);
            StopCoroutine("pause");
        }
        #endregion

        #region IndividualAnimationCoroutines
        //below is all the individual animation coroutines that store the individual
        //animation position and size information to pass to the lerp calculator.

        IEnumerator ShieldBob(float animeTime)
        {
            while (true)
            {

                //set lerp/animation calculation values for bobbing effect.
                startxPos = currentxPos;
                endxPos = currentxPos -.1f;

                startyPos = currentyPos;
                endyPos = currentyPos + .05f;

                startSize = currentSize;
                endSize = currentSize - 10;

                //calculate shield/lerp animation values for bob. Loop and breathe the animation to create bob.
                CalculateShieldx(animeTime, 0, "smootherstep", true, true);
                CalculateShieldy(animeTime, 0, "smootherstep", true, true);
                CalculateShieldsize(animeTime, 0, "smootherstep", true, true);

                yield return new WaitForEndOfFrame();
            }

        }

        IEnumerator AttackShield(float animeTime)
        {
            while (true)
            {
                //set lerp/animation calculation values for bobbing effect.
                startxPos = currentxPos;
                endxPos = .15f;

                startyPos = currentyPos;
                endyPos = -.05f;

                startSize = currentSize;
                endSize = 128;

                //calculate shield/lerp animation values for bob. Loop and breathe the animation to create bob.
                CalculateShieldx(animeTime, 0, "easein", false, false, 1);
                CalculateShieldy(animeTime, 0, "easein", false, false, 1);
                CalculateShieldsize(animeTime, 0, "easein", false, false, 1);

                yield return new WaitForEndOfFrame();
            }

        }

        IEnumerator BlockDone(float animeTime)
        {
            while (true)
            {

                startxPos = currentxPos;
                endxPos = -.05f;

                startyPos = currentyPos;
                endyPos = -.05f;

                startSize = currentSize;
                endSize = 118;

                CalculateShieldx(animeTime, 0, "easein", false, false, 1);
                CalculateShieldy(animeTime, 0, "easein", false, false, 1);
                CalculateShieldsize(animeTime, 0, "easein", false, false, 1);
                yield return new WaitForEndOfFrame();
            }
        }

        IEnumerator BlockStart(float animeTime)
        {
            while (true)
            {
                startxPos = currentxPos;
                endxPos = -.3f;

                startyPos = currentyPos;
                endyPos = .275f;

                startSize = size;
                endSize = 118;

                CalculateShieldx(animeTime, 0, "easein", false, false, 1);
                CalculateShieldy(animeTime, 0, "easein", false, false, 1);
                CalculateShieldsize(animeTime, 0, "easein", false, false, 1);
                yield return new WaitForEndOfFrame();
            }
        }

        IEnumerator OnHit(float animeTime)
        {
            while (true)
            {
                //set calculation values for lerp/animation calculation.
                startxPos = currentxPos;
                endxPos = -.3f;

                startyPos = currentyPos;
                endyPos = .275f;

                startSize = currentSize;
                endSize = 128;

                CalculateShieldx(animeTime, 0, "easein", false, true, 2);
                CalculateShieldy(animeTime, 0, "easein", false, true, 2);
                CalculateShieldsize(animeTime, 0, "easein", false, true, 2);
                yield return new WaitForEndOfFrame();
            }
        }

        IEnumerator OnHitVulnerable(float animeTime)
        {
            //set calculation values for lerp/animation calculation.
            startxPos = currentxPos;
            endxPos = -.3f;

            startyPos = currentyPos;
            endyPos = .275f;

            startSize = currentSize;
            endSize = 128;

            CalculateShieldx(animeTime, 0, "easein", false, true, 1);
            CalculateShieldy(animeTime, 0, "easein", false, true, 1);
            CalculateShieldsize(animeTime, 0, "easein", false, true, 4);

            yield return new WaitForEndOfFrame();
        }

        //draws shield position onces every frame.
        IEnumerator ShieldAnimation()
        {
            GUI.depth = 1;
            //sets current shield position. Below update loop moves this.
            while (true)
            {
                if ((GameManager.Instance.StateManager.CurrentState == StateManager.StateTypes.Paused) || DaggerfallUI.UIManager.WindowCount != 0)
                    shieldPos = new Rect();
                else if (DaggerfallUI.UIManager.WindowCount == 0)
                {
                    if (flip)
                    {
                        shieldPos = new Rect(Screen.width * (.825f + xPos), Screen.height * (1.275f - yPos) - size * shieldScaleY, size * shieldScaleX, size * shieldScaleY);
                        //flips the image 180 degrees.
                        shieldPos = new Rect(shieldPos.xMax, shieldPos.yMin, -shieldPos.width, shieldPos.height);
                    }
                    else
                    {
                        shieldPos = new Rect(Screen.width * (-.175f - xPos), Screen.height * (1.275f - yPos) - size * shieldScaleY, size * shieldScaleX, size * shieldScaleY);
                    }
                }

                yield return new WaitForEndOfFrame();
            }
        }
        #endregion

        #region MainBlockCoroutine
        //main blocking coroutine controller. Used for all blocking behavior/animations outside of weapon idle/attack.
        public IEnumerator BlockActivate()
        {
            //if the script detects the players weapon is drawn and has a valid shield equipped.
            //checks players inputs. If they are moving, change moving bool to true.
            if (InputManager.Instance.HasAction(InputManager.Actions.MoveRight) || InputManager.Instance.HasAction(InputManager.Actions.MoveLeft) || InputManager.Instance.HasAction(InputManager.Actions.MoveForwards) || InputManager.Instance.HasAction(InputManager.Actions.MoveBackwards))
                moving = true;
            else
                moving = false;

            //when player pushes down block key do....
            if (Input.GetKeyDown(blockKeyCode))
            {
                //figures out animation time for moving shield out of way during attack by using players live speed.
                AttackAnimeTime = (float)(100 - PlayerEntity.Stats.LiveSpeed) / 100;

                //sets up agility block modifiers for fatigue reduction and time block reductions.
                agilityMod = Mathf.Clamp((float)PlayerEntity.Stats.LiveAgility / 100, 0, .8f);
                agilityTimeMod = (float)(PlayerEntity.Stats.LiveAgility) / 100;

                //total time default block time. Can be changed as needed.
                totalBlockTime = (2f - agilityTimeMod) * BlockTimeMod;

                //resets lerping timers to ensure proper offsetting.
                blockTimer = 0;

                //triggers blocking code in below loop.
                //blockStart = true;
                shieldStates = ShieldStates.Raising;
            }
            
            //when player lets go of block key do....
            if (Input.GetKeyUp(blockKeyCode))
            {
                isBlocking = false;
                //lets below loop know user has decided to finish blocking.
                shieldStates = ShieldStates.Lowering;
            }

            //If the shield is idle....
            if(shieldStates == ShieldStates.Idle)
            {
                //bobbing system.
                if (moving && GameManager.Instance.WeaponManager.ScreenWeapon.WeaponState == WeaponStates.Idle && toggleBob)
                {
                    bobCoroutine = ShieldBob(2.5f);
                    //stops the attack animation from playing and restarts the shield bob loop.
                    AnimationManager(bobCoroutine, 0);
                }
                else if (GameManager.Instance.WeaponManager.ScreenWeapon.WeaponState != WeaponStates.Idle)
                {
                    ShieldAttackcoroutine = AttackShield(1.5f - AttackAnimeTime);
                    //stops the bob animation from playing and restarts the shield attack.
                    AnimationManager(ShieldAttackcoroutine, 0);
                }
                else if (!moving)
                {
                    doneCoroutine = BlockDone(totalBlockTime);
                    if (AnimationManager(doneCoroutine, 0))
                    {
                        //resets controls properties.
                        shieldStates = ShieldStates.Idle;
                    }
                }
            }

            //isn't idling;
            if(shieldStates != ShieldStates.Idle)
            {
                float vulnerableWindow;

                //total time before player is immune to damage; total block time thirded.
                if (shieldTypes == ShieldTypes.Buckler && bucklerMechanics)
                    vulnerableWindow = (totalBlockTime * .2f);
                else 
                    vulnerableWindow = (totalBlockTime * .5f);

                //total time block has been active.
                blockTimer += Time.deltaTime;

                if (blockTimer >= vulnerableWindow)
                    isBlocking = true;
                else
                    isBlocking = false;

                //if the player has pressed block key/is raising shield...
                if (shieldStates == ShieldStates.Raising)
                {
                    //calculate animation if player is not vulnerable.
                    if (isHit)
                    {
                        //resets trigger
                        isHit = false;
                        //grabs motor function from enemy entity behavior object and assigns it.
                        EnemyMotor targetMotor = enemyEntity.EntityBehaviour.transform.GetComponent<EnemyMotor>();
                        //how far enemy will push back after succesful block.
                        targetMotor.KnockbackSpeed = Mathf.Clamp(attackerDamage * .75f, 2f, 5f);
                        //what direction they will go. Grab the players camera and push them the direction they are looking (aka away from player since they are looking forward).
                        targetMotor.KnockbackDirection = mainCamera.transform.forward;
                        //assigns animation routine with timing.
                        hitCoroutine = OnHit(.25f);
                        //run anaimtion: returns true while it runs, flips false once done and takes fatigue from player.
                        int fatigueamount = (int)((attackerDamage * agilityMod) * BlockCostMod);
                        //subtracts the cost from current player fatigue and assigns it to players fatigue for dodge cost.
                        PlayerEntity.DecreaseFatigue(fatigueamount);
                        Debug.Log("Fatigue Mod:" + agilityMod.ToString() + " | " + "Attacker Damage:" + attackerDamage.ToString() + " | " + " Fatigue Cost:" + fatigueamount.ToString() + " | " + "Current Fatigue Amount:" + PlayerEntity.CurrentFatigue.ToString());
                        //plays hit animation.
                        AnimationManager(hitCoroutine, 0, true);
                    }
                    else if (isHit && isBlocking)
                    {
                        //resets trigger
                        isHit = false;
                        //grabs motor function from enemy entity behavior object and assigns it.
                        EnemyMotor targetMotor = enemyEntity.EntityBehaviour.transform.GetComponent<EnemyMotor>();
                        //how far enemy will push back after succesful block.
                        targetMotor.KnockbackSpeed = Mathf.Clamp(attackerDamage, 4f, 6f);
                        //what direction they will go. Grab the players camera and push them the direction they are looking (aka away from player since they are looking forward).
                        targetMotor.KnockbackDirection = mainCamera.transform.forward;
                        //assigns animation routine with timing.
                        hitCoroutine = OnHitVulnerable(totalBlockTime - getAnimeTime());
                        //run anaimtion: returns true while it runs, flips false once done and takes fatigue from player.
                        //calculates the fatigue cost of blocking an attack. Uses enemy damage as the base value.
                        int fatigueamount = (int)(attackerDamage * agilityMod * BlockCostMod);
                        //subtracts the cost from current player fatigue and assigns it to players fatigue for dodge cost.
                        PlayerEntity.DecreaseFatigue(fatigueamount);
                        Debug.Log("Fatigue Mod:" + agilityMod.ToString() + " | " + "Attacker Damage:" + attackerDamage.ToString() + " | " + " Fatigue Cost:" + fatigueamount.ToString() + " | " + "Current Fatigue Amount:" + PlayerEntity.CurrentFatigue.ToString());
                        //plays hit animation.
                        AnimationManager(hitCoroutine, 0, true);
                    }
                    //calculate animation if player is holding block key.
                    else
                    {
                        if (shieldTypes == ShieldTypes.Buckler && bucklerMechanics)
                            startCoroutine = BlockStart(totalBlockTime * .65f);
                        else
                            startCoroutine = BlockStart(totalBlockTime);

                        if (AnimationManager(startCoroutine, 0))
                            shieldStates = ShieldStates.Raised;
                    }
                }

                //if the shield has raised.
                if(shieldStates == ShieldStates.Raised)
                {
                    Debug.Log(shieldTypes.ToString());

                    if (shieldTypes == ShieldTypes.Buckler && bucklerMechanics)
                    {
                        yield return new WaitForSeconds(.1f);
                        shieldStates = ShieldStates.Lowering;
                    }
                    else if (isHit)
                    {
                        isHit = false;
                        hitCoroutine = OnHit(.3f);
                        //calculates the fatigue cost of blocking an attack. Uses enemy damage as the base value.
                        int fatigueamount = (int)((attackerDamage * agilityMod) * BlockCostMod);
                        //subtracts the cost from current player fatigue and assigns it to players fatigue for dodge cost.
                        PlayerEntity.DecreaseFatigue(fatigueamount);
                        Debug.Log("Fatigue Mod:" + agilityMod.ToString() + " | " + "Attacker Damage:" + attackerDamage.ToString() + " | " + " Fatigue Cost:" + fatigueamount.ToString() + " | " + "Current Fatigue Amount:" + PlayerEntity.CurrentFatigue.ToString());
                        //plays hit animation.
                        AnimationManager(hitCoroutine, 0, true);

                    }
                }

                if(shieldStates == ShieldStates.Lowering)
                {
                    //make player hittable again since they are leaving defensive stance.
                    isBlocking = false;
                    blockTimer = 0;

                    doneCoroutine = BlockDone(totalBlockTime);
                    if (AnimationManager(doneCoroutine, 0))
                    {
                        //resets controls properties.
                        shieldStates = ShieldStates.Idle;
                    }
                }        
            }
               

            //yield code returns at the end of the frame.
            yield return new WaitForEndOfFrame();
        }
        #endregion

        #region CalculateAnimationValues
        //calculates x, y, and values position of the shield using lerp calculator and passthrough vars. Ensures each cordinate has its own object/instance of lerpcalculator.
        //without this, the calculations with bleed into one another.
        private void CalculateShieldx(float totalBlockTime = 1, float startTime = 0, string calcType = "linear", bool loop = false, bool breathe = false, int cycles = 1)
        {
            xPos = LerpCalculator(out lerpfinished, totalBlockTime, startTime, startxPos, endxPos, calcType, loop, breathe, cycles);
        }

        private void CalculateShieldy(float totalBlockTime = 1, float startTime = 0, string calcType = "linear", bool loop = false, bool breathe = false, int cycles = 1)
        {
            yPos = LerpCalculator(out lerpfinished, totalBlockTime, startTime, startyPos, endyPos, calcType, loop, breathe, cycles);
        }

        private void CalculateShieldsize(float totalBlockTime = 1, float startTime = 0, string calcType = "linear", bool loop = false, bool breathe = false, int cycles = 1)
        {
            size = LerpCalculator(out lerpfinished, totalBlockTime, startTime, startSize, endSize, calcType, loop, breathe, cycles);
        }

        //lerping calculator. The workhorse of the animation management system and this script. Uses a time delta calculator to figure out how much time has passed in
        //since the last frame update. It uses this number and the vars the developer inputs to figure out what the output would be based on the currect percent of time
        //that has passed and the total animation duration the player inputs into the animation manager through the animation ienumerator/coroutine the developer sets up.
        float LerpCalculator(out bool lerpfinished, float duration, float startTime, float startValue, float endValue, string lerpEquation, bool loop, bool breathe, int cycles = 1)
        {
            //sets lerp calculator base properties.
            float lerpvalue = 0;
            float totalDuration = 0;
            lerpfinished = false;

            //figures out total length of lerp cycle.
            totalDuration = duration * cycles;

            //counts total time of lerp cycle.
            totalTime += Time.deltaTime;

            if (loop == true)
            {
                totalTime = 0;
            }
            //returns end value and resets triggers once lerp cycle has finished its total duration.
            else if (totalTime > totalDuration)
            {
                lerpfinished = true;

                if (!breathe)
                    return endValue;
                else
                    return startValue;
            }

            //breath trigger to allow lerp to breath naturally back and fourth.
            if (TimeCovered >= duration && breatheTrigger)
                breatheTrigger = false;
            else if (TimeCovered <= 0 && !breatheTrigger)
                breatheTrigger = true;

            //counts time up or down based on breathe switch.
            if (breatheTrigger)
                // Distance moved equals elapsed time times speed.
                TimeCovered += Time.deltaTime;
            else
                // Distance moved equals elapsed time times speed.
                TimeCovered -= Time.deltaTime;


            // Fraction of journey completed equals current time divided by total movement time.
            float fractionOfJourney = TimeCovered / duration;

            //if individual cycle is over, and breath trigger is off, reset lerp to 0 position to start from beginning all over.
            if ((fractionOfJourney < 0f || fractionOfJourney > 1f) && breathe == false)
            {
                TimeCovered = 0;
            }

            //reprocesses time passed into a sin graph function to provide a ease out movement shape instead of basic linear movement.
            if (lerpEquation == "linear" || lerpEquation == null || lerpEquation == "")
                ; //do nothing to keep basic linear lerping;
            else if (lerpEquation == "easeout")
                fractionOfJourney = Mathf.Sin(fractionOfJourney * Mathf.PI * 0.5f);
            else if (lerpEquation == "easein")
                fractionOfJourney = 1f - Mathf.Cos(fractionOfJourney * Mathf.PI * 0.5f);
            else if (lerpEquation == "exponential")
                fractionOfJourney = fractionOfJourney * fractionOfJourney;
            else if (lerpEquation == "smoothstep")
                fractionOfJourney = fractionOfJourney * fractionOfJourney * (3f - 2f * fractionOfJourney);
            else if (lerpEquation == "smootherstep")
                fractionOfJourney = fractionOfJourney * fractionOfJourney * fractionOfJourney * (fractionOfJourney * (6f * fractionOfJourney - 15f) + 10f);

            //calculate lerp.
            lerpvalue = Mathf.Lerp(startValue, endValue, fractionOfJourney);

            //return lerp value.
            return lerpvalue;
        }
        #endregion

        #region GetAnimationValues
        //gets current time in the lerp/animation calculation.
        float getAnimeTime()
        {
            return TimeCovered;
        }
        #endregion

        #region GetShieldValues
        //bool that checks if player has a shield in inventory and if he has it equipped. Returns true if player does, returns false if he doesn't.
        bool EquippedShield()
        {
            bool shieldEquipped = false;
            foreach (DaggerfallUnityItem item in PlayerEntity.ItemEquipTable.EquipTable)
            {
                if (item != null)
                {
                    if (item.IsShield && item.IsEquipped)
                    {
                        if (item.TemplateIndex == 109)
                            shieldTypes = ShieldTypes.Buckler;
                        if (item.TemplateIndex == 110)
                            shieldTypes = ShieldTypes.Round;
                        if (item.TemplateIndex == 111)
                            shieldTypes = ShieldTypes.Kite;
                        if (item.TemplateIndex == 112)
                            shieldTypes = ShieldTypes.Tower;

                        //checks what shield it is and then loads/assigns corresponding texture to shieldTex using loadPNG method.
                        if (item.TemplateIndex == 110 || item.TemplateIndex == 109)
                            shieldTex = LoadPNG(smallTexture_Path);
                        else
                            shieldTex = LoadPNG(largeTexture_Path);

                        shieldEquipped = true;
                    }
                }
            }

            return shieldEquipped;
        }
        #endregion

        #region formulaOverwrites
        public static int CalculateAttackDamage(DaggerfallEntity attacker, DaggerfallEntity target, int enemyAnimStateRecord, int weaponAnimTime, DaggerfallUnityItem weapon)
        {
            //tells script the player has been hit by an enemy.
            if (target == GameManager.Instance.PlayerEntity)
                isHit = true;

            if (attacker == null || target == null)
                return 0;

            int damageModifiers = 0;
            int damage = 0;
            int chanceToHitMod = 0;
            int backstabChance = 0;
            PlayerEntity player = GameManager.Instance.PlayerEntity;
            short skillID = 0;

            // Choose whether weapon-wielding enemies use their weapons or weaponless attacks.
            // In classic, weapon-wielding enemies use the damage values of their weapons
            // instead of their weaponless values.
            // For some enemies this gives lower damage than similar-tier monsters
            // and the weaponless values seems more appropriate, so here
            // enemies will choose to use their weaponless attack if it is more damaging.
            EnemyEntity AIAttacker = attacker as EnemyEntity;
            if (AIAttacker != null && weapon != null)
            {
                int weaponAverage = (weapon.GetBaseDamageMin() + weapon.GetBaseDamageMax()) / 2;
                int noWeaponAverage = (AIAttacker.MobileEnemy.MinDamage + AIAttacker.MobileEnemy.MaxDamage) / 2;

                if (noWeaponAverage > weaponAverage)
                {
                    // Use hand-to-hand
                    weapon = null;
                }
            }

            if (weapon != null)
            {
                // If the attacker is using a weapon, check if the material is high enough to damage the target
                if (target.MinMetalToHit > (WeaponMaterialTypes)weapon.NativeMaterialValue)
                {
                    if (attacker == player)
                    {
                        DaggerfallUI.Instance.PopupMessage(UserInterfaceWindows.HardStrings.materialIneffective);
                    }
                    return 0;
                }
                // Get weapon skill used
                skillID = weapon.GetWeaponSkillIDAsShort();
            }
            else
            {
                skillID = (short)DFCareer.Skills.HandToHand;
            }

            chanceToHitMod = attacker.Skills.GetLiveSkillValue(skillID);

            if (attacker == player)
            {
                // Apply swing modifiers
                FormulaHelper.ToHitAndDamageMods swingMods = FormulaHelper.CalculateSwingModifiers(GameManager.Instance.WeaponManager.ScreenWeapon);
                damageModifiers += swingMods.damageMod;
                chanceToHitMod += swingMods.toHitMod;

                // Apply proficiency modifiers
                FormulaHelper.ToHitAndDamageMods proficiencyMods = FormulaHelper.CalculateProficiencyModifiers(attacker, weapon);
                damageModifiers += proficiencyMods.damageMod;
                chanceToHitMod += proficiencyMods.toHitMod;

                // Apply racial bonuses
                FormulaHelper.ToHitAndDamageMods racialMods = FormulaHelper.CalculateRacialModifiers(attacker, weapon, player);
                damageModifiers += racialMods.damageMod;
                chanceToHitMod += racialMods.toHitMod;

                backstabChance = FormulaHelper.CalculateBackstabChance(player, null, enemyAnimStateRecord);
                chanceToHitMod += backstabChance;
            }

            // Choose struck body part
            backstabChance = FormulaHelper.CalculateBackstabChance(player, null, enemyAnimStateRecord);
            int struckBodyPart = FormulaHelper.CalculateStruckBodyPart();

            // Get damage for weaponless attacks
            if (skillID == (short)DFCareer.Skills.HandToHand)
            {
                if (attacker == player || (AIAttacker != null && AIAttacker.EntityType == EntityTypes.EnemyClass))
                {
                    if (FormulaHelper.CalculateSuccessfulHit(attacker, target, chanceToHitMod, struckBodyPart))
                    {
                        damage = FormulaHelper.CalculateHandToHandAttackDamage(attacker, target, damageModifiers, attacker == player);

                        damage = FormulaHelper.CalculateBackstabDamage(damage, backstabChance);
                    }
                }
                else if (AIAttacker != null) // attacker is a monster
                {
                    // Handle multiple attacks by AI
                    int minBaseDamage = 0;
                    int maxBaseDamage = 0;
                    int attackNumber = 0;
                    while (attackNumber < 3) // Classic supports up to 5 attacks but no monster has more than 3
                    {
                        if (attackNumber == 0)
                        {
                            minBaseDamage = AIAttacker.MobileEnemy.MinDamage;
                            maxBaseDamage = AIAttacker.MobileEnemy.MaxDamage;
                        }
                        else if (attackNumber == 1)
                        {
                            minBaseDamage = AIAttacker.MobileEnemy.MinDamage2;
                            maxBaseDamage = AIAttacker.MobileEnemy.MaxDamage2;
                        }
                        else if (attackNumber == 2)
                        {
                            minBaseDamage = AIAttacker.MobileEnemy.MinDamage3;
                            maxBaseDamage = AIAttacker.MobileEnemy.MaxDamage3;
                        }

                        int reflexesChance = 50 - (10 * ((int)player.Reflexes - 2));

                        if (DFRandom.rand() % 100 < reflexesChance && minBaseDamage > 0 && FormulaHelper.CalculateSuccessfulHit(attacker, target, chanceToHitMod, struckBodyPart))
                        {
                            int hitDamage = UnityEngine.Random.Range(minBaseDamage, maxBaseDamage + 1);
                            // Apply special monster attack effects
                            if (hitDamage > 0)
                                FormulaHelper.OnMonsterHit(AIAttacker, target, hitDamage);

                            damage += hitDamage;
                        }
                        ++attackNumber;
                    }
                }
            }
            // Handle weapon attacks
            else if (weapon != null)
            {
                // Apply weapon material modifier.
                chanceToHitMod += FormulaHelper.CalculateWeaponToHit(weapon);

                // Mod hook for adjusting final hit chance mod and adding new elements to calculation. (no-op in DFU)
                chanceToHitMod = FormulaHelper.AdjustWeaponHitChanceMod(attacker, target, chanceToHitMod, weaponAnimTime, weapon);

                if (FormulaHelper.CalculateSuccessfulHit(attacker, target, chanceToHitMod, struckBodyPart))
                {
                    damage = FormulaHelper.CalculateWeaponAttackDamage(attacker, target, damageModifiers, weaponAnimTime, weapon);

                    damage = FormulaHelper.CalculateBackstabDamage(damage, backstabChance);
                }

                // Handle poisoned weapons
                if (damage > 0 && weapon.poisonType != Poisons.None)
                {
                    FormulaHelper.InflictPoison(target, weapon.poisonType, false);
                    weapon.poisonType = Poisons.None;
                }
            }

            damage = Mathf.Max(0, damage);

            FormulaHelper.DamageEquipment(attacker, target, damage, weapon, struckBodyPart);

            // Apply Ring of Namira effect
            if (target == player)
            {
                DaggerfallUnityItem[] equippedItems = target.ItemEquipTable.EquipTable;
                DaggerfallUnityItem item = null;
                if (equippedItems.Length != 0)
                {
                    if (IsRingOfNamira(equippedItems[(int)EquipSlots.Ring0]) || IsRingOfNamira(equippedItems[(int)EquipSlots.Ring1]))
                    {
                        IEntityEffect effectTemplate = GameManager.Instance.EntityEffectBroker.GetEffectTemplate(RingOfNamiraEffect.EffectKey);
                        effectTemplate.EnchantmentPayloadCallback(EnchantmentPayloadFlags.None,
                            targetEntity: AIAttacker.EntityBehaviour,
                            sourceItem: item,
                            sourceDamage: damage);
                    }
                }
            }
            //Debug.LogFormat("Damage {0} applied, animTime={1}  ({2})", damage, weaponAnimTime, GameManager.Instance.WeaponManager.ScreenWeapon.WeaponState);

            //checks to see if player is blocking yet and if the target is the player. If so, assign damage to attackerDamage, enemy object to enemyEntity, and
            //0 out the damage, so player doesn't take any.
            if (isBlocking == true && target == instance.PlayerEntity)
            {
                attackerDamage = damage;
                damage = 0;
                enemyEntity = attacker;
            }

            return damage;
        }

        private static bool IsRingOfNamira(DaggerfallUnityItem item)
        {
            return item != null && item.ContainsEnchantment(DaggerfallConnect.FallExe.EnchantmentTypes.SpecialArtifactEffect, (int)ArtifactsSubTypes.Ring_of_Namira);
        }
        #endregion

        //texture loading method. Grabs the string path the developer inputs, finds the file, if exists, loads it,
        //then resizes it for use. If not, outputs error message.
        public static Texture2D LoadPNG(string filePath)
        {

            Texture2D tex = null;
            byte[] fileData;

            if (File.Exists(filePath))
            {
                fileData = File.ReadAllBytes(filePath);
                tex = new Texture2D(2, 2);
                tex.LoadImage(fileData); //..this will auto-resize the texture dimensions.
            }
            else
                Debug.Log("FilePath Broken!");

            return tex;
        }

        //Debug coroutine for fine tuning.
        IEnumerator debug()
        {
            while (true)
            {
                DaggerfallUI.Instance.PopupMessage("Blocking: " + isBlocking.ToString() + " | Finished: " + blockFinished.ToString() + " | Lerp: " + lerpfinished.ToString() + " | BlockTime: " + blockTimer.ToString());
                yield return new WaitForSeconds(.16f);
            }
        }
    }
}
Last edited by l3lessed on Mon Jun 08, 2020 8:41 am, edited 2 times in total.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1405
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Why does this run in editor, but crash in base game

Post by l3lessed »

Still doing it, even when I moved the script out of the daggerfall workshop name space to ensure my enums were part of their own name space.

Hmm, maybe I screwed up setting up the mod setting file. But, wouldn't that crash the editor too?

This is where I'm getting confused. Editor launches the mod just fine, main game doesn't, dump log doesn't point to any specific code lines or issues to zone in on.

I'm calling it for the night. If any one can point me in the right direction, I would really appreciate it. I need to setup these enums to get more advanced mechanics in and better code flow, but I'm unsure if they are crashing the normal game or if I accidently fubared something else, since I have no real logs or compile errors to run from as of now.

Here is my mod settings:

Code: Select all

{
    "Version": null,
    "Sections": [
        {
            "Name": "Settings",
            "Description": null,
            "IsAdvanced": false,
            "Keys": [
                {
                    "Value": "Mouse0",
                    "Name": "blockKey",
                    "Description": null,
                    "$version": "v1",
                    "$type": "DaggerfallWorkshop.Game.Utility.ModSupport.ModSettings.TextKey"
                },
                {
                    "Min": 0.1,
                    "Max": 10.0,
                    "Value": 1.0,
                    "Name": "BlockTimeMod",
                    "Description": null,
                    "$version": "v1",
                    "$type": "DaggerfallWorkshop.Game.Utility.ModSupport.ModSettings.SliderFloatKey"
                },
                {
                    "Min": 0.1,
                    "Max": 10.0,
                    "Value": 1.0,
                    "Name": "BlockCostMod",
                    "Description": null,
                    "$version": "v1",
                    "$type": "DaggerfallWorkshop.Game.Utility.ModSupport.ModSettings.SliderFloatKey"
                },
                {
                    "Value": true,
                    "Name": "ToggleBob",
                    "Description": null,
                    "$version": "v1",
                    "$type": "DaggerfallWorkshop.Game.Utility.ModSupport.ModSettings.ToggleKey"
                },
                {
                    "Value": false,
                    "Name": "BucklerMechanics",
                    "Description": null,
                    "$version": "v1",
                    "$type": "DaggerfallWorkshop.Game.Utility.ModSupport.ModSettings.ToggleKey"
                }
            ],
            "$version": "v1"
        }
    ]
}
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Why does this run in editor, but crash in base game

Post by BadLuckBurt »

I think the mod builder has trouble with enums. Try using constants and see if the problem goes away
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

l3lessed
Posts: 1405
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Why does this run in editor, but crash in base game

Post by l3lessed »

Thanks. I'll save this, in case it is ever resolved.

K, I'll use case switches instead, even though which could use types because of their simplicity.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1405
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Why does this run in editor, but crash in base game

Post by l3lessed »

Oh man, I wish enums were working. Turning this into a case switch just puts me back to using tons of bool switches or requires restructuring the whole code structure. Oh well, I'll get it.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Why does this run in editor, but crash in base game

Post by BadLuckBurt »

l3lessed wrote: Mon Jun 08, 2020 6:58 pm Oh man, I wish enums were working. Turning this into a case switch just puts me back to using tons of bool switches or requires restructuring the whole code structure. Oh well, I'll get it.
Enums are nothing but integers behind the scenes, the main purpose of them is to make code more readable. If you don't mind keeping a list of integers and their meaning next to you while you're coding, there's really not a big difference.
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

l3lessed
Posts: 1405
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Why does this run in editor, but crash in base game

Post by l3lessed »

K, got it. I just ignored my gut instinct to over complicate it to mimic a switch statement setup, and instead went to an old school simple int method for tracking differing states.

I changed the state objects into basic ints. Each int just references a shield state and shield type, like an enum would. I just don't get the fancy enum object properties and easy to read language. If you do this yourself, just ensure your notate clearly, so it is easy to track the int states through out the code flow, and ensure the user never has public access to the integer, unless it is clamped to max out at the highest integer number in the "state" switches. As long as this is done, this is an old school simple way to mimic enum type setups without enums.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1405
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Why does this run in editor, but crash in base game

Post by l3lessed »

BadLuckBurt wrote: Mon Jun 08, 2020 7:17 pm
l3lessed wrote: Mon Jun 08, 2020 6:58 pm Oh man, I wish enums were working. Turning this into a case switch just puts me back to using tons of bool switches or requires restructuring the whole code structure. Oh well, I'll get it.
Enums are nothing but integers behind the scenes, the main purpose of them is to make code more readable. If you don't mind keeping a list of integers and their meaning next to you while you're coding, there's really not a big difference.

Yep, that is exactly what I decided to do. I just liked having the extra labeling. As I develop C.O.P. for daggerfall, it would be nice to be able to track states between all the scripts I'll be using through ENUMS, but if not, I'll keep it old school, use a chart sheet to track int states, and just update the sheet as I add more (Oh man, I haven't had to code in this way for a while). No biggy though.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Why does this run in editor, but crash in base game

Post by BadLuckBurt »

l3lessed wrote: Mon Jun 08, 2020 7:39 pm Yep, that is exactly what I decided to do. I just liked having the extra labeling. As I develop C.O.P. for daggerfall, it would be nice to be able to track states between all the scripts I'll be using through ENUMS, but if not, I'll keep it old school, use a chart sheet to track int states, and just update the sheet as I add more (Oh man, I haven't had to code in this way for a while). No biggy though.
It's a limitation of the compiler that's used to compile the mod source code as it's loaded. That's about all I know :D Not sure if that will ever change either, maybe with the new Unity version that DFU will move to later this year?
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

Post Reply