Locoswap Tool

Discussion in 'General Discussion' started by andy.malcolm, Nov 23, 2022.

  1. JustRight

    JustRight New Member

    Joined:
    Dec 12, 2016
    Messages:
    6
    Likes Received:
    4
    Hi mate. Yeah, I also run as 'Administrator', but that does not seem to help whatever is happening here. There is something about that process.Start() statement that in that particular module that is causing me an issue.
     
  2. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    Hi,
    Thank you for your analysis.
    This isn't somerhing that has been touched since 1.1 so I don't have a particular insight...
    The Serz process is he TS utility that comes with TS to unpack the .bin files to readable .xml.
    What happens if you try to directly give a Scenario.bin file to Serz.exe, without Locoswap in the mix ?
    Btw I never run as admin myself ;)
     
  3. JustRight

    JustRight New Member

    Joined:
    Dec 12, 2016
    Messages:
    6
    Likes Received:
    4
    Hi mate, thanks for your response.

    So you think that the start.Process() is attempting to use Serz.exe? I have just tried running Serz from a non admin command prompt to convert a scenario.bin file and it generated the xml without any problem. I had a closer look and have only just realised that the failing module was actually a call to InvokeSerz(string path). I have no idea how I missed that yesterday! So I will investigate further on my system and see what I can turn up.

    Cheers, Trevor.
     
    Last edited: Jan 18, 2023
    • Like Like x 1
  4. JustRight

    JustRight New Member

    Joined:
    Dec 12, 2016
    Messages:
    6
    Likes Received:
    4
    Hi All,

    I have managed to resolve this issue on my system.

    Turned out that at some time in the distant past I had added a compatibility entry for Serz.exe and made it run as Administrator. Once I changed Serz.exe back to 'normal' LocoSwap ran correctly. It seems that because Serz.exe was set to run as Administrator the attempt to invoke Serz.exe from within LocoSwap also needed to be elevated or the process would fail, as I found out.

    Thanks to Frankoi1337 and Reef for their input.
     
    • Like Like x 3
  5. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,729
    Likes Received:
    1,791
    Glad to hear you figured it out, nothing worse than being an isolated case, I had a similar thing with a missing mouse curser if I ran TS with the vulkan sdk, took me an age to figure that one out.

    So now that we know 22H2 wasn't to blame I'm back to wondering whether I should upgrade to it from 21H2, it's sat their waiting for me I just keep putting it off, lol.
     
  6. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    LocoSwap 1.4.0.0 has just arrived :)
    Can be downloaded here : https://github.com/flicard/LocoSwap/releases/tag/v1.4.0.0

    What's new in this version ?
    - Length of missing and available vehicles displayed
    - Filters added for routes and scenarios lists
    - Scenarios completion status now displayed
    - Scenario author now displayed
    - French language added
    - Free roam and Quick drive scenarios now identified as such in the `Player train` field

    Hope you like it ;)
     
    • Like Like x 7
    • Helpful Helpful x 1
  7. KeithG

    KeithG Member

    Joined:
    Jan 18, 2023
    Messages:
    85
    Likes Received:
    71
    Excellent, Many Thanks.
    Do I have to rewrite all my replacement rules again ? or can I copy a file across from V1.3 to V1.4
     
  8. andy.malcolm

    andy.malcolm Active Member

    Joined:
    Mar 31, 2019
    Messages:
    315
    Likes Received:
    180
    wow, those are some fantastic changes!
     
    • Like Like x 1
  9. 390001

    390001 Well-Known Member

    Joined:
    Jan 18, 2018
    Messages:
    1,938
    Likes Received:
    1,267
    an already amazing mod getting better wow thanks!
     
    • Like Like x 1
  10. chrisreb

    chrisreb Member

    Joined:
    Dec 12, 2016
    Messages:
    46
    Likes Received:
    7
    I have same question
     
  11. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    If you overwrite the existing LocoSwap files with the new ones, no rule should be lost :)
     
  12. stefangschmidt

    stefangschmidt New Member

    Joined:
    Dec 15, 2016
    Messages:
    2
    Likes Received:
    1
    Hello a fine interssting feature has been added, but it didn'T work properly:
    upload_2023-1-26_16-20-24.png
    Which Base is used to get the length, because ths was an missing rolling Stock.?
     
  13. heardturkey

    heardturkey Active Member

    Joined:
    Mar 6, 2020
    Messages:
    134
    Likes Received:
    197
    The manual says that some lengths come up as obviously incorrect and quotes a JT example. You've found another one.
    Just use the more likely to be correct 19.88 mtrs unless you think that 319.19 is right.:)
     
  14. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    I find this length by calculating the difference between two values found in the Scenario.bin file. I honestly have no idea what they actually are :D, probably some kind of linear coordinates along the track.
    I quickly found out that some values would come up as obviously erroneous, thus making the prospect of automated length checks impossible (that was my initial plan: LocoSwap automatically warning you that you had extended a consist).

    BUT I also found out that in the vast majority of cases, it would be possible to determine the real length because a missing vehicle will often come in multiple occurrences in a rake (indeed in your case, it's easy to conclude that the wagon must be around 19m).
    I may automatically hide absurd values in the future, but less obvious mistakes will remain.

    By the way, this is not related to a particular stock, it clearly can happen at random with any vehicle.
     
    • Like Like x 1
  15. class2ldn2801

    class2ldn2801 Active Member

    Joined:
    Dec 23, 2019
    Messages:
    175
    Likes Received:
    85
    It deleted mine unfortunately, not the end of the world but annoying all the same.
     
  16. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    I believe that if you install the new version in the same directory than before it should work.
    If it doesn't, here is a "manual" solution : you will find the LocoSwap profile file under C:\Users\<You>\AppData\Local\LocoSwap.
    Then there are two subdirectories, one called LocoSwap.exe_Url_XXXXXX, and again one with the version number ("1.3.0.0" for instance).
    Based on the folder dates, or just by looking inside the user.config files, you should be able to figure out which is which, and move files to recover your presets :)
     
    • Like Like x 1
  17. class2ldn2801

    class2ldn2801 Active Member

    Joined:
    Dec 23, 2019
    Messages:
    175
    Likes Received:
    85
    Oh well bit late now lol, like I say not a massive deal as id swapped most of the stuff I needed anyway, i know for next time.
    I did install it in the same directory and overwrote the files and it deleted the rules so definitely make a backup lol

    Edit
    Just to say your solution worked, copied the text over to 1.4 and my presets are back, thanks very much
     
    Last edited: Jan 27, 2023
    • Like Like x 1
  18. Blazin

    Blazin Well-Known Member

    Joined:
    Jan 12, 2022
    Messages:
    1,300
    Likes Received:
    3,353
    Hi everyone, I am brand new to this program and since I have never used it before I would just like to clear some things up before I start swapping some things.
    When editing a scenario, does a green dot next to a consist or loco mean you have everything required? and red means you don't I assume?
    Also I don't create scenarios so sorry if this is a silly question, but if I were to replace say an old Class 37 that's an AI driven train with a new Class 37 for that AI train, that when driven, it's different to the old Class 37 (for example I mean that this new Class 37 would for example have different acceleration, braking, etc) would there be any issues or would it all work as normal (as an AI train in the scenario)?

    Thanks in advance.
     
  19. 390001

    390001 Well-Known Member

    Joined:
    Jan 18, 2018
    Messages:
    1,938
    Likes Received:
    1,267
    Bingo green means you have the livery/asset installed red means you do not.

    I have swapped older stock for the newer stock and can honestly say have had 0 isses with player or AI train so you should be good.
     
    • Helpful Helpful x 1
  20. Blazin

    Blazin Well-Known Member

    Joined:
    Jan 12, 2022
    Messages:
    1,300
    Likes Received:
    3,353
    Thank you very much for your help!
     
  21. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,166
    Likes Received:
    1,057
    Let me clear up the red quickly. You may find red on official scenarios that come with a route, These items will be red elsewhere, too. Check for an AP file if the source is from Steam. If you have that, treat it as green.
     
    • Helpful Helpful x 1
  22. Blazin

    Blazin Well-Known Member

    Joined:
    Jan 12, 2022
    Messages:
    1,300
    Likes Received:
    3,353
    Thanks for letting me know!
     
  23. Blazin

    Blazin Well-Known Member

    Joined:
    Jan 12, 2022
    Messages:
    1,300
    Likes Received:
    3,353
    Alright after a bit of exploring the program, I have noticed that there is no career scenarios listed. Is there any way to access career scenarios or is this program for standard scenarios only? And I am a bit confused about this because I own Cajon Pass and it lists some of the career variation scenarios there but when I go to other routes that use career scenarios such as Arizona Divide, no scenarios appear.

    Update: I've noticed this isn't just on career scenarios, but even for some routes with standard scenarios, the scenarios won't appear
     
    Last edited: Feb 1, 2023
  24. 390001

    390001 Well-Known Member

    Joined:
    Jan 18, 2018
    Messages:
    1,938
    Likes Received:
    1,267
    Please do not post inacurate posts. Locoswap DOES show and read ap files. Proof is below.

    Here is proof i am showing a file that IS in an AP format.
    upload_2023-2-1_6-57-10.png

    Here is the route showing in Locoswaps list showing scenarios.
    upload_2023-2-1_6-57-42.png

    And here is a scenario that uses default stock which is inside that AP file.

    upload_2023-2-1_6-58-24.png

    Notice they are ALL green even the selected ones which are inside that AP file.
     
    • Like Like x 1
  25. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,166
    Likes Received:
    1,057
    Scenarios cannot be read unless extracted from an AP file. Locos may show as red unless extracted, and I have seen locos I own shown as unowned so can confirm this. However, if swapping locos, the search can look inside AP files.
     
  26. 390001

    390001 Well-Known Member

    Joined:
    Jan 18, 2018
    Messages:
    1,938
    Likes Received:
    1,267
    Well i just proved they can. The screenshot above shows a scenario that is NOT extracted from the AP files showing fully in the screenshot. Here let me post it again and show you.

    upload_2023-2-1_7-35-29.png

    ALL GREEN.

    upload_2023-2-1_7-36-7.png
    Showing ALL assets again in the AP file.

    upload_2023-2-1_7-36-34.png
    And the fille in an AP FORMAT.

    So it reads Ap files perfectly fine and wont red them
     
    • Like Like x 1
  27. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    2,389
    Likes Received:
    8,861
    What does yellow mean?

    Thx
     
  28. 390001

    390001 Well-Known Member

    Joined:
    Jan 18, 2018
    Messages:
    1,938
    Likes Received:
    1,267
    oh and here are ALL scenarios for that route which is in an AP files showing in Locoswap. So seems to read that AP file perfectly fine
    upload_2023-2-1_7-37-32.png
     
  29. 390001

    390001 Well-Known Member

    Joined:
    Jan 18, 2018
    Messages:
    1,938
    Likes Received:
    1,267
    Yellow means you have ticked the box previously when you have swapped an asset and had this box ticked
    upload_2023-2-1_7-38-5.png
    Basically you have told Locoswap to set a previous swap as a rule so anytime that asset you were missing appears in a scenario locoswap will swap it automatically as you have set it as a rule.
     
    • Like Like x 2
  30. JetWash

    JetWash Well-Known Member

    Joined:
    Mar 6, 2021
    Messages:
    2,389
    Likes Received:
    8,861
    Excellent, thanks!
     
  31. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,166
    Likes Received:
    1,057
    It sounds like different versions of LocoSwap behave differently. My version does not fully use AP files. That is all I can say about that from my experience. I have official routes with no scenarios visible, but am not home to show it right now. I have shown pictures in the past.
     
    • Like Like x 2
  32. 390001

    390001 Well-Known Member

    Joined:
    Jan 18, 2018
    Messages:
    1,938
    Likes Received:
    1,267
    Your very welcome.
     
  33. dtg_jd

    dtg_jd Staff Member

    Joined:
    Mar 18, 2021
    Messages:
    47
    Likes Received:
    105
    Quick comment - because people have different experiences, doesn't make one person right or one person wrong. Sometimes things behave differently for different people. Please be civil, and accept someone might have had an alternative experience.
     
    • Like Like x 5
  34. class2ldn2801

    class2ldn2801 Active Member

    Joined:
    Dec 23, 2019
    Messages:
    175
    Likes Received:
    85
    I think this tool is brilliant and the changes that have been made recently have made it even better. Being able to apply all rules has been a game changer for me, the time it saves having to go though every scenario looking for the rules to apply is fantastic.
    The lengths is quite a handy thing aswell although I have noticed that when you changed the consist the original length remains , not the length of the new coach etc, not a massive deal anyway, brilliant tool for me.
     
    • Like Like x 2
  35. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    I still believe computer science, at least wrt what we are dealing with here, should behave in a deterministic manner :D

    Let me clarify things to the best of my knowledge :
    - LocoSwap will NOT read scenarios inside AP files. That would require a new logic of duplicating the scenario on save (or modifying inside the .ap but that would be very bad practise IMO), where it's actually pretty simple to just clone it before editing.
    390001, if you click "open scenario directory" on your New Jersey scenarios, I think you will see these scenarios are actually not .ap'd
    - LocoSwap WILL read stocks inside AP's.
    Cyclone, if you have an instance of LocoSwap showing red for a stock you own, please share the details :)
    - LocoSwap showing green doesn't necessary mean everything is OK. For example, if missing a .GeoPcDx or texture file (e.g. a badly installed reskin), LocoSwap will not see that. This is detailed in the FAQ section of the manual ;)
     
    Last edited: Feb 1, 2023
    • Like Like x 2
  36. class2ldn2801

    class2ldn2801 Active Member

    Joined:
    Dec 23, 2019
    Messages:
    175
    Likes Received:
    85
    Now we've got the apply all rules would it be possible to add an apply all rule for each route to save going through each scenario individually, its already massively quicker anyway but if that was possible it would be amazing.
     
  37. westcastlerail

    westcastlerail Active Member

    Joined:
    Mar 11, 2018
    Messages:
    235
    Likes Received:
    167
    Would electrification type be an issue for a rule to apply to all routes and scenarios?

    For instance, if you swapped a Voyager for a Pendilino on WCML, you probably would not want the same swap on a not electrified route (ie Western Mainline)
     
  38. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,166
    Likes Received:
    1,057
    Ah, TS-Tools does something like this, but it is very slow I think with a large folder. It can take over a minute for a single scenario, but it also works slower than LocoSwap, so maybe it is possible. Will let the current dev figure that out. :)
     
    Last edited: Feb 1, 2023
    • Like Like x 1
  39. class2ldn2801

    class2ldn2801 Active Member

    Joined:
    Dec 23, 2019
    Messages:
    175
    Likes Received:
    85
    No I what I mean is when you select a route the list of scenarios for that route pop up so if you applied all it could apply just for the route that you've selected and not the whole library of routes, obviously don't know if that's something that can be implemented and I appreciate its probably a complex thing to do . At the moment the apply all only comes up once you select a scenario in that route, this way you could bulk swap the whole route rather then going through each scenario if you wished.
    Just an idea.
     
  40. chrisreb

    chrisreb Member

    Joined:
    Dec 12, 2016
    Messages:
    46
    Likes Received:
    7
    Thank you!!
     
  41. slomo1965

    slomo1965 New Member

    Joined:
    Jan 27, 2023
    Messages:
    3
    Likes Received:
    1
    Hi all,

    i am relatively new to this...

    I installed LocoSwap 1.4 today, because it seems to be, what i allways searched for: A simple way, to use my most liked locos in the scenarios of my most liked scenario-creators.

    Everything seems to wok like intended, but when i open TS and look for the edited scenario, i see it without preview-loco ( Name and type of loco are correct ). When i try to start the scenario, i see a blck box " missing content etc...", if i scip with F2 i am in the scenario, but withot loco :-(

    Using the backup-files works fine btw... Tried the swap with different locos, and running LocoSwap as admin: No success until now...

    Any ideas here ?

    I don´t know enough of the file-structure of TS ( and the structure Steam creates...) to search in the scenario-files for some hints....

    Hoping for help

    Stefan
     
    • Like Like x 1
  42. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    Hello,
    Could you share a few screenshots ? Mainly the player consist in LocoSwap and the error message you get in TS ?
     
  43. slomo1965

    slomo1965 New Member

    Joined:
    Jan 27, 2023
    Messages:
    3
    Likes Received:
    1
    In LocoSwap i didn´t get any hint about problems. Original contant and the new oco are shown as green in the list. (first symbol for "to be changed" and after reopening "green" ) I will try to make a screenshot of the error in TS.
     
  44. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,729
    Likes Received:
    1,791
    Sounds like this issue if you ask me.
     
  45. 749006

    749006 Well-Known Member

    Joined:
    Dec 10, 2016
    Messages:
    8,485
    Likes Received:
    2,707
    I'm editing this scenario
    LocoSwap.png

    The train M 111 is in Red as I don't own part or all of the stock used in it.
    In the second column it tells me it is a BR928_04
    In the third column it shows it as a Railtraction BR 628 -
    I don't have a picture as that is generated from the Assets\Railtraction\BR628 folder which I don't own
     
  46. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    It's just the way the numbering scheme works I guess ?
    Indeed, from Railtraction's website :
     
  47. slomo1965

    slomo1965 New Member

    Joined:
    Jan 27, 2023
    Messages:
    3
    Likes Received:
    1
    Hi all, thx a lot for your help !

    I got it managed, but it works only for Locos, which have a propper preview-picture in the Loco-section of TSC.
    So, i found out, that some of my Addons are not correct installed....

    Regards

    SloMo
     
  48. tsme

    tsme New Member

    Joined:
    Dec 11, 2016
    Messages:
    21
    Likes Received:
    9
    Fantastic tool! Thank you :D
     
    • Like Like x 1
  49. tsme

    tsme New Member

    Joined:
    Dec 11, 2016
    Messages:
    21
    Likes Received:
    9
    Figuring out where stuff lives can be problematic. Any quick and easy way of finding correct folder etc for a loco or wagon?
     
  50. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    The easiest ways I can think of are :
    - Check who made what you look for, that will probably be the root assets folder (keeping in mind that DTG stuff dating back to RailWorks days are under "RSC")
    - Edit a scenario you know has the thing you look for and write down its path
    - Windows search in folders by file names ;)
     

Share This Page