Open rcambrj opened 2 years ago
Is this the problem? I'm not super familiar with C#
I haven't played this game in a while, nor looked at the code. A quick check does have that as the problem, you can comment out that part of the "OR" statement.
I did need to change the project to .net 4.7.2 for it to build for me. Thats under the "right click > properties > Application" under the project under the solution explorer
The log still seems to dump a bunch of errors in game but it does appear to work. Likely due to it not having loaded in the users inventory when checking if the mod should run its logic.
That piece of code I grabbed from a different mod, cant remember which one, but you might be able to find a other mods which have been updated to work with newer versions of the game and replace the code. Its likely that you would have to get the inventory from the player rather than from the "InventoryStartingItems" class directly. It used to be static, it now is not hence the error. or maybe check if the player is loaded in.
Theres no guarantees this still works with all loco types or with the remote controller or with multiple engines slaved, but the shunter did seem to work in the starting area. I believe there was an update a while back that implemented the functionality from the "MultipleUnits" mods so this may have broken more stuff.
It looks like you have the environment set up if you wanted to continue development on this. A few notes on how its set up.
It worked! Thanks for the advice :)
Hi @Matthew-J-Green and @rcambrj
Thanks to your comments on this page, I managed to get the mod working for me with the Saitek Throttle Quadrant and I'm so glad I did! So I committed my code for your review and to help others.
I'm not sure when this broke (I haven't played in a while), but this is the error I'm getting in the log.
I notice that the nexus mods page is now hidden. This mod made Derail Valley. IMO not worth playing this game without this mod. So I hope you can find the time to fix this, or perhaps guide me a little bit so I can make a PR 🙌