Jump to content
bucky16

LCPDFR Crash: System.InvalidCastException

Recommended Posts

I was playing LCPDFR today after installing the 1.0b hotfix and I ended up having the first crash I've had in a while. I was aiming at a suspect who had drawn a gun at me and was shooting at me while I was trying to arrest him. The game suddenly froze and after several seconds crashed to the desktop with no error message. I checked all the log files to see what happened and the LCPDFR log file said to report this issue, so that's what I'm doing. Here are the parts of the log files starting with the LCPDFR log file: (Note the crash occurred at 1:55:30 PM)

 

[WARNING - 1:53:00 PM] [script.Lights] Process: Not a valid police vehicle, hence siren manager instance is missing. Forcing creation


[ERROR - 1:55:30 PM] [Main] CRITICAL ERROR DURING MAINLOOP! REPORT THIS ISSUE AT LCPDFR.COM BY INCLUDING THIS LOGFILE.
[ERROR - 1:55:30 PM] [] System.InvalidCastException: Unable to cast object of type 'freval_70' to type 'freval_90'.
at freval_238.eval_fr0(freval_82 A_0, Boolean A_1)
at freval_55.eval_3.eval_fr0()
at freval_55.eval_3.eval_fr0(Object[] A_0)
at LCPD_First_Response.Engine.Timers.DelayedCaller.fr0()
at LCPD_First_Response.Engine.Main.fr2()

 

The Advanced Hook log file:

[iNFO - 13:55:30] An exception occured


[iNFO - 13:55:30]
Process: FFC10000

Address: 7511C41F (¬êë”'k)

Code: E0434352

Registerdump - EAX: 5A54E9F0 EBP: 5A54EA40 EBX: 5 ECX: 5 EDI: 1 EDX: 0 EIP: 7511C41F ESI: 5A54EAB0 ESP: 5A54E9F0

 

And the ScriptHookDotNet log file:

2014-04-20 13:55:30 - Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'freval_70' to type 'freval_90'.


at freval_238.eval_fr0(freval_82 A_0, Boolean A_1)
at freval_55.eval_3.eval_fr0()
at freval_55.eval_3.eval_fr0(Object[] A_0)
at LCPD_First_Response.Engine.Timers.DelayedCaller.fr0()
at LCPD_First_Response.Engine.Main.fr2()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
2014-04-20 13:55:30 - CRASH!
2014-04-20 13:55:30 - Unhandled Exception: System.InvalidCastException: Unable to cast object of type 'freval_70' to type 'freval_90'.
at freval_238.eval_fr0(freval_82 A_0, Boolean A_1)
at freval_55.eval_3.eval_fr0()
at freval_55.eval_3.eval_fr0(Object[] A_0)
at LCPD_First_Response.Engine.Timers.DelayedCaller.fr0()
at LCPD_First_Response.Engine.Main.fr2()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
2014-04-20 13:55:30 - CRASH!

 

My guess is that it's just a bug, but I'm not sure though. Hope you guys can help.

 

Just found out that this appears to be very similar to another known issue: "System.InvalidCastException: Unable to cast object of type 'freval_77' to type 'freval_89" but they are not the same issue though. I guess it must be a bug.

Edited by bucky16

Share this post


Link to post
Share on other sites

I see you have the freval error in there. The freval error was fixed for some users by doing this: Open up your LCPDFR.ini, look under "Main", it should look something like this by default:

[Main]
AdditionalCopCarModels=
SuspectTransporterModels=POLICE;POLICE2;PSTOCKADE;
VehicleTrunkWeapons=Shotgun_Baretta;
AllTextMode=False
AmbientScenariosMaximum=2
AmbientScenariosMultiplier=250
DepartmentName=Liberty City Police Department
DepartmentShortName=LCPD
FirstStart=True
UsingPoliceStationMod=False

Now, add to the bottom of that part

PreloadAllModels=True
The "Main" part should now look like this:

[Main]
AdditionalCopCarModels=
SuspectTransporterModels=POLICE;POLICE2;PSTOCKADE;
VehicleTrunkWeapons=Shotgun_Baretta;
AllTextMode=False
AmbientScenariosMaximum=2
AmbientScenariosMultiplier=250
DepartmentName=Liberty City Police Department
DepartmentShortName=LCPD
FirstStart=True
UsingPoliceStationMod=False
PreloadAllModels=True

Share this post


Link to post
Share on other sites

I was trying to figure out how to add that option the other day. I'll try adding that. Thanks. +1 for you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×