Locoswap Tool

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

  1. andy.malcolm

    andy.malcolm Active Member

    Joined:
    Mar 31, 2019
    Messages:
    318
    Likes Received:
    182
    • Like Like x 3
    • Helpful Helpful x 2
  2. peterchambers

    peterchambers Active Member

    Joined:
    Mar 21, 2018
    Messages:
    190
    Likes Received:
    149
    Thank you very much for this info and link.
     
  3. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    That someone is me :D
    Just so you know, I did try to reach out to the original dev in private but he didn't reply, so I took the liberty to fork the projet, after all, this is what open source is about :)

    So yeah, the changes brought by 1.2 are :
    • Automatically create replacement rules every time you hit Replace all (can be disabled with a ticking box)
    • Vehicles missing but with existing replacement rules will now show with yellow dots, and an Apply all rules button is provided to apply all your rules at once
    • Drastically speed up the scanning of .ap files by first looking for a RailVehicles folder (and only looking in it if there is one)
    • Scanned vehicles list does not empty anymore when scanning a new folder
    • Fixed some portals or waypoints breaking (those containing line returns, Tonbridge Dn Fast on the Chatham is your typical suspect)
    • Edited scenario names now appended with a [LoSw] suffix
    • Fixed crash when wagon blueprint does not feature a cCargoComponent
     
    • Like Like x 7
    • Helpful Helpful x 3
  4. andy.malcolm

    andy.malcolm Active Member

    Joined:
    Mar 31, 2019
    Messages:
    318
    Likes Received:
    182
    Nice one :)
     
    • Like Like x 1
  5. class2ldn2801

    class2ldn2801 Active Member

    Joined:
    Dec 23, 2019
    Messages:
    175
    Likes Received:
    85
    This is awesome, the apply all for the rules is the one thing for me that it was missing, means I can just add them in for all routes now and just hit replace instead of having to click through them for each scenario which took forever lol, great stuff.
     
    • Like Like x 1
  6. ajpardy

    ajpardy Member

    Joined:
    Feb 7, 2021
    Messages:
    125
    Likes Received:
    4
    .
    could you add a way to save a list of replacement locos, like ts tools had frankoi1337
     
  7. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    Unless I don't understand correctly, it already exists in LocoSwap (in fact, it already existed in 1.1). Just hit "Replacement rules" on the top right corner and you will visualize your personal list.
     
    • Like Like x 1
  8. ajpardy

    ajpardy Member

    Joined:
    Feb 7, 2021
    Messages:
    125
    Likes Received:
    4
    sorry, i miss typed. i meant when you search for Locos/coaches, usually the search results go away when changing selected train. Can this be altered? frankoi1337
     
  9. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    From 1.2, the box listing all the stock found will not clear if you start a new search in another directory.
    But il will indeed clear when you close the Scenario edit window. To avoid that, a whole "library"/sorting system would have to be developed to store your entire collection of stock (or you would end with a very long and unfriendly list to deal with...)
     
  10. ajpardy

    ajpardy Member

    Joined:
    Feb 7, 2021
    Messages:
    125
    Likes Received:
    4
    ok,thats helpful.thanks
     
  11. class2ldn2801

    class2ldn2801 Active Member

    Joined:
    Dec 23, 2019
    Messages:
    175
    Likes Received:
    85
    Not sure if its a bug but if I've got a unit in that I want to swap like the old northern 319 skin and replace it with the AP one it seems because its green the apply all rules dont seem to work, it only seems to work on red or yellow items
     
  12. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,170
    Likes Received:
    1,060
    You mean the filenames in the directory? The ones that would become Scenario.bak, you would now change them to [LoSw]Scenario.bin instead or something like that?

    A bug I've noticed in the version before this: selecting a train and then clicking "Change number" without selecting a car to change causes an application exit. Can this lead to an error asking to select a vehicle to change and keep the app open? Great way to lose a lot of work as it is currently.
     
  13. USRailFan

    USRailFan Active Member

    Joined:
    Jul 2, 2018
    Messages:
    462
    Likes Received:
    126
    He probably means the name of the scenario in the in-game scenario listing
     
    • Like Like x 1
  14. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,170
    Likes Received:
    1,060
    I thought that too, but it makes me wonder how he does that when I don't see a way to do that with the application. Also, I personally DON'T want the name of the scenario changing, so that is something I don't like. It just means I'd have to edit the name manually in the file later. Not a big deal, but an extra step added to the process.
     
  15. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    The suffix is added automatically upon saving to the scenario name, as it shows in TS.
    You can rename any scenario either by editing the ScenarioProperties.xml, or within the game in the Build section.
    The idea is to remind you that you prepared the scenario (so probably it's ready to be played), and is also a reminder that a backup can be found in the scenario folder.
    I shall take a look at it and maybe add it as an option.
     
  16. class2ldn2801

    class2ldn2801 Active Member

    Joined:
    Dec 23, 2019
    Messages:
    175
    Likes Received:
    85
    Is it possible to make the option to change all include stock thats not actually missing ie green not yellow or red rather then go through the rules list to do it on each individual consist?
     
  17. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    That's going on my todo :)
     
    • Like Like x 2
  18. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,729
    Likes Received:
    1,791
    I actually like the Suffix, although an option for those that don't want it can disable it is of course the all round "keep everyone happy" solution, if you wanted to make it less intrusive you could do it as [*] or [LS] instead or something, either way I'm fine with it as is.
     
  19. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,170
    Likes Received:
    1,060
    Let me make sure I understand. Are you changing the name of the scenario itself, or only the name of the file?

    If only the file, that's fine.
     
  20. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,729
    Likes Received:
    1,791
    Having actually used LocoSwap since the update I understand fully what frankoi1337 has done/changed..

    Funny that innit.
     
    • Like Like x 1
  21. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,170
    Likes Received:
    1,060
    It's not that at all. I didn't understand the way it was worded, and thought he meant the scenario name, hence the question. Now that I understand...yeah, nothing wrong. :)
     
  22. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,729
    Likes Received:
    1,791
    Nice.
     
  23. Jon from Rhode Island

    Jon from Rhode Island Well-Known Member

    Joined:
    Aug 20, 2021
    Messages:
    244
    Likes Received:
    339
    This is fantastic and solves a lot of the frustrations that I had been experiencing with the original. Thank you!!
     
    • Like Like x 2
  24. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    I did mean the scenario name indeed, renaming the files wouldn't make any sense as the scenarios would then not be seen by TS at all ;)
     
    • Like Like x 1
  25. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,170
    Likes Received:
    1,060
    I didn't even mean that. I meant actually changing the name, within ScenarioProperties, under the DisplayName tag. :) But if it doesn't do that, then no issues. ;)
     
  26. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    And it does do that ;) The idea is you can spot the scenarios you have prepared when scrolling in TS.
    But I will make it optional in the future, no worries !
     
  27. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,170
    Likes Received:
    1,060
    I'm not sure that is something that would not bother me. I mean, if I take and edit a scenario, I already know where it is and have chosen the name for it already. Changing the name of the scenario via DisplayName puts it somewhere else in the list and undoes my name selection. If I'm editing the scenario in LocoSwap, I already know where it is, and I don't want to edit the file manually again just to remove it. So yeah, stick to filenames I'd say, or make it an optional checkbox. Some might like it, but some have reasons to edit for means of making alternate versions of a scenario intended to be provided in multiple versions and this just hinders that. Ts-Tools is what I edit with, and changing a train number should not be accompanied with a new name.:)

    For now I'll stay on the version I have. I'm used to it, so it's fine for the time being. I don't use it enough to warrant an update at present. It stays in the background most of the time and is there for when I need quick research. Better for that purpose than Ts-Tools. ;)
     
    Last edited: Dec 2, 2022
  28. ajpardy

    ajpardy Member

    Joined:
    Feb 7, 2021
    Messages:
    125
    Likes Received:
    4
    Hi, i was just using Locoswap, the “apply all rules” at top of program didn’t work, the button near middle works ok? frankoi1337
     
  29. Johnno124

    Johnno124 Active Member

    Joined:
    Dec 8, 2016
    Messages:
    221
    Likes Received:
    220
    If its a suffix being added then its just at the end so it will remain sorted as it is. TS Sorts Alphabetically from the start not the end
     
  30. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,729
    Likes Received:
    1,791
    It does yes.
     
  31. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,170
    Likes Received:
    1,060
    Ah, fair enough. Still something I'd prefer disabled. Just my personal taste.
     
  32. IronBladder

    IronBladder Well-Known Member

    Joined:
    Sep 5, 2017
    Messages:
    925
    Likes Received:
    1,751
    Are there any instructions for installing it please? There's nothing in the zip I can see to explain.
     
  33. Johnno124

    Johnno124 Active Member

    Joined:
    Dec 8, 2016
    Messages:
    221
    Likes Received:
    220
    Fair enough. Each to their own then.
     
  34. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,729
    Likes Received:
    1,791
    Unzip to a location of your choice, open the folder, click on the .exe
     
    • Helpful Helpful x 1
  35. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    It only applies to stocks you have a rule for AND that are missing (ie they appear in yellow).
    I already mentionned I will make an option to apply all rules also to stocks that are not missing (typical use : replace a default stock with a better quality one). In the meantime you still have to open the "Replacement rules" box, tick the rules and apply them.
     
    • Like Like x 1
  36. ajpardy

    ajpardy Member

    Joined:
    Feb 7, 2021
    Messages:
    125
    Likes Received:
    4
    ah ok, thanks.
     
  37. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    Hello everyone,

    I am pleased to announce that LocoSwap 1.3 is now released [​IMG]
    It can be downloaded here : https://github.com/flicard/LocoSwap/releases/tag/v1.3.0.0

    Here are the highlights of this new version :
    • A manual is now included, based on the 1.1 manual by dodo0822
    • Option to apply rules to all stocks added
    • The [LoSw] suffix is now a setting and can be modified or disabled
    • Scenarios list now shows scenario informations (time of day, season, duration)
    • Replacement rules and scanned vehicles can now be filtered with a text field
    • App now has an icon [​IMG]
    • Various quality of life improvements
    Hope you appreciate it, and as always feel free to suggest any evolutions or report any bugs !
     
    • Like Like x 5
  38. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,170
    Likes Received:
    1,060
    Not a bad idea, though there are scenario makers who complain the date does nothing. It actually contributes to the sunrise and sunset, from what I understand. The season setting has nothing to do with that. My guess is the season setting adds the wheelslip settings and other season-related driving conditions.
     
  39. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,729
    Likes Received:
    1,791
    Thanks for the continued development of this great little tool
     
    • Like Like x 1
  40. andy.malcolm

    andy.malcolm Active Member

    Joined:
    Mar 31, 2019
    Messages:
    318
    Likes Received:
    182
    This might be impossible, but can Locoswap see into the SDBCache.bin file and check whether you have completed a scenario or not? That would be a dream feature for me :) Thanks for continuing to develop this brilliant tool.
     
  41. andy.malcolm

    andy.malcolm Active Member

    Joined:
    Mar 31, 2019
    Messages:
    318
    Likes Received:
    182
    doesn't the season mainly determine the textures you get? i.e. snow for winter?
     
  42. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    Actually I am not so sure, I kinda believe it only depends on the season... I recall AP once updated their pack to amend the sunrise/sunset times for the spring season, for instance. It also determine which textures you get indeed.
    Actually I didn't even know where to search that info... I may have a look !
     
    • Like Like x 1
  43. cscarpenter

    cscarpenter Well-Known Member

    Joined:
    Jun 15, 2020
    Messages:
    1,170
    Likes Received:
    3,438
    Thank you so much for sharing your work with the community, it is genuinely appreciated.
    I have used LocoSwap as my goto tool for swapping stock in scenarios for months now but your updates have added so much more useful info and features, it really is becoming the have to have tool for TSC users :love:
    Thanks again
     
    Last edited: Dec 22, 2022
    • Like Like x 1
  44. Cyclone

    Cyclone Well-Known Member

    Joined:
    Feb 29, 2020
    Messages:
    3,170
    Likes Received:
    1,060
    One thing that I complained about before with LocoSwap is that the car number automatically changes when you swap. Are you able to retain the same car number on swap? I know Ts-Tools has a checkbox for this, and many require a revisit anyway, but having the original numbering helps avoid situations like one that actually exists on one of the two original Port Road scenarios (see UKTS) where the same wagon is used twice, and you have to release the one that doesn't count after driving most of the route. I showed how to edit this in a video on it - using LocoSwap coincidentally - but if I were changing the stock fully and not just the number, the automatic numbers might result in even more of that car number showing up and causing more chaos, or similar problems with swapped stock. Control over that would be nice.
     
  45. 390001

    390001 Well-Known Member

    Joined:
    Jan 18, 2018
    Messages:
    1,938
    Likes Received:
    1,267

    Thank you so much for this. It amazes me in this day and age people still complaing about people dedicating FREE time to help us in the community. Will never understand why people find the need to complain. Love your programd and so easy to use thank you.
     
    • Like Like x 1
  46. ajpardy

    ajpardy Member

    Joined:
    Feb 7, 2021
    Messages:
    125
    Likes Received:
    4
    would it be possible to add a search box to search for a specific route/& scenario @frankoi
     

    Attached Files:

  47. frankoi1337

    frankoi1337 Member

    Joined:
    Apr 20, 2021
    Messages:
    91
    Likes Received:
    88
    Will have a look :)
     
    • Like Like x 1
  48. JustRight

    JustRight New Member

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

    I have recently downloaded and installed LocoSwap v1.3

    I found though that when running the program, after selecting a route and then a scenario, when I click on the 'Edit Scenario' button the scenario edit panel opens very briefly and then the program closes back to the desktop. No errors or anything in event viewer that I can see. After a lot of trial and error I found that the only way I could get LocoSwap to run was to run it as 'Administrator'.

    The documentation does not mention that this is a requirement, and obviously lots of others are running it without this problem. My Steam directory is not on the Windows drive and is not in any of the default Windows 'Program Files' directories. All the files in my Railworks directory tree are set to be Read/Write. I have tried installing LocoSwap on the same drive as Railworks but nothing seems to help. If I run LocoSwap without Admin privileges then it crashes as soon as the Scenario Edit panel displays. The only unusual thing is that my 'Games' drive is on an array of 4 2TB SSD's using a thin provisioned Microsoft Storage Space. But the file system is standard NTFS, so that should not have anything to do with this.

    I downloaded the source for v1.3 but I don't have the correct NuGet packages to enable me to compile and run the project under debug so that I could see what it was failing on.

    Can you suggest what this issue might be? I am at a loss as to why it won't run unless it runs as Administrator.

    Cheers mate, Trevor.
     
    Last edited: Jan 18, 2023
  49. JustRight

    JustRight New Member

    Joined:
    Dec 12, 2016
    Messages:
    6
    Likes Received:
    4
    OK, so I finally got all the NuGet packages installed after correcting the NuGet package source url. DOH!

    The ScenarioEditWindows.xaml.cs fails at the process.Start() statement;

    I am running on Windows 11Pro version 22H2 (22621.1105) I wonder if this might be a Windows issue? I know that Microsoft have implemented some security changes recently that impacted things like programs navigating via NTFS Junctions. I wonder if there are any other hidden security 'features'.
     
    Last edited: Jan 18, 2023
  50. Reef

    Reef Well-Known Member

    Joined:
    Jul 27, 2018
    Messages:
    2,729
    Likes Received:
    1,791
    I'm running 11 Pro Version 21H2 (22000.1455), I've not had any issues using LocoSwap, don't know if that's useful or not.

    Oh I run as Administrator but I don't have too, I just tend to do that to negate any possible copy write issues (yes, read write is also enabled in folder/file structure).
     
    Last edited: Jan 18, 2023

Share This Page