Tutorial Plugin Creation

Discussion in 'PC Editor Discussion' started by DTG Matt, Sep 29, 2023.

  1. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    Something simple to get started.

    Always put your content in its own plugin, and try and keep plugins focused on a particular role.

    In a route pack you will notice:

    "NewYorkTrenton"
    "NewYorkTrenton_Route_Gameplay"
    "NYT_AMTK_ACS64"
    "NYT_AMTK_Amfleet"
    "NYT_NJT_ALP46"
    "NYT_NHT_BiLevels"

    The route is in its own plugin, all aspects of the gameplay are in their own plugin, and each relatable set of vehicles are in their own plugin - so locos usually in one, coach sets in one, wagons in one, multiple units in one.

    Even if you're testing something, make a scratch plugin to put it in.

    How to make a plugin? Easy.

    First - go to the Edit menu and then select Plugins.
    upload_2023-9-29_16-4-1.png

    On the window that pops up, click New Plugin on the bottom right:
    upload_2023-9-29_16-4-15.png

    Next, click "Content-Only" (if you forget this, nothing else works, so don't forget this bit :) ) and then type the name of the plugin:

    upload_2023-9-29_16-5-2.png

    Notice your plugin will now be visible in the content browser:
    upload_2023-9-29_16-5-18.png

    More to follow...
     

    Attached Files:

    • Like Like x 13
    • Helpful Helpful x 5
  2. eldomtom2

    eldomtom2 Well-Known Member

    Joined:
    Jul 31, 2022
    Messages:
    2,331
    Likes Received:
    2,500
    Can we get a pinned thread with links to these tutorials?
     
    • Like Like x 1
  3. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    If you can't see the content browser, it may be hidden, click this icon:

    upload_2023-9-29_16-6-48.png

    Alternatively, you can have multiple content browsers open on different windows/monitors too.

    upload_2023-9-29_16-7-8.png


    All the content you now make for this purpose, goes in the plugin you've just created.
     
    • Like Like x 2
    • Helpful Helpful x 1
  4. ScottN

    ScottN Active Member

    Joined:
    Sep 1, 2020
    Messages:
    223
    Likes Received:
    137
    I see there isn’t a way to cook content.
     
    • Like Like x 1
  5. bremen

    bremen Active Member

    Joined:
    Aug 24, 2023
    Messages:
    127
    Likes Received:
    105
    Looking at other plugins, something like this (for the moment) should be ok for a route. Right?
    In Map I have the route main file, tiles and, for the moment, the SRTM.

    TSW4_00005.JPG
     
    Last edited: Sep 29, 2023
    • Like Like x 2
    • Helpful Helpful x 1
  6. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    That all looks fine for a route plugin yeah
     
    • Like Like x 2
    • Helpful Helpful x 1
  7. bremen

    bremen Active Member

    Joined:
    Aug 24, 2023
    Messages:
    127
    Likes Received:
    105
    Thank you.

    I'm rebuilding the tiles inside the new plugin directory and the terrain generation is more stable.
    No flying chunk of terrain and no random pop up to prompt to save the tiles before finishing a generation.

    Building from good foundation is the first step :)
     
    • Like Like x 2
    • Helpful Helpful x 1
  8. Evolinox#6389

    Evolinox#6389 Member

    Joined:
    Aug 5, 2022
    Messages:
    29
    Likes Received:
    46
    Hey, i started experimenting with a custom Route, ive setup a RouteDefinition, a Timetable and a ContentManifest, but i cant get my Route to show up in the Route Selection Menu? The Timetable works, when im playing in the Editor on my custom Level :/
     
  9. fecrails

    fecrails Active Member

    Joined:
    Sep 23, 2023
    Messages:
    139
    Likes Received:
    183
    Thanks Matt!
     
    • Like Like x 1
  10. Rudolf

    Rudolf Well-Known Member

    Joined:
    Dec 9, 2016
    Messages:
    2,606
    Likes Received:
    3,443
    If you create a scenario, multiple content browser come handy. I sue one the get the route map, so it does not clutter with the scenario project. Not sure yet is this is important though.
     
  11. KrisKol

    KrisKol Active Member

    Joined:
    Apr 2, 2023
    Messages:
    155
    Likes Received:
    90
    Great stuff Matt. Thanks!
    I had a pretty good idea that created Routes, Trains, etc are Plug Ins.

    Now that I have had a good 10 hours sleep, and have a nice fresh brain on a Saturday morning...

    Time for me to get busy with the editor again.
    I did a bit of an explore of the DTG content, and strangely it was the NewYorkTrenton route Then its Gameplay folder that I choose to explore inside. And I opened its Map.
    It all came up pretty fast for me. No crashes.
     
  12. emil#3734

    emil#3734 Well-Known Member

    Joined:
    Sep 25, 2023
    Messages:
    363
    Likes Received:
    274
    The first tutorial arrived?
    I'm trying this right away.
    Thx Matt :]
     
  13. OldVern

    OldVern Well-Known Member

    Joined:
    Nov 2, 2020
    Messages:
    18,176
    Likes Received:
    37,047
    So does the PlugIn replace setting up our own folder structure in the ..\TS2Prototype\Content folder, as shown in the demonstration video? And if so where does the PlugIn get saved?
     
  14. Boingleboeing

    Boingleboeing Member

    Joined:
    Jul 31, 2021
    Messages:
    85
    Likes Received:
    45
    Yes, and it is saved in ..\TS2Prototype\Plugins\{the name of the plugin}
     
    • Like Like x 2
  15. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    504
    Likes Received:
    511
    How can I export my plugin as .pak
     
    • Like Like x 1
  16. greggryan2

    greggryan2 Active Member

    Joined:
    Dec 21, 2018
    Messages:
    419
    Likes Received:
    179
    You can't due to issues with the cooking process.
     
    • Helpful Helpful x 2
  17. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    504
    Likes Received:
    511
    Oh thats not good
     
    • Like Like x 2
  18. jonad6700

    jonad6700 New Member

    Joined:
    May 22, 2022
    Messages:
    8
    Likes Received:
    18
    Hi DTG Matt , if we are creating a new timetable for an existing route should we also create a new plugin or should the timetable be saved where the existing route timetables are located?.

    thanks.
     
    • Like Like x 2
  19. Yorkshirelad

    Yorkshirelad Well-Known Member

    Joined:
    Jun 8, 2020
    Messages:
    180
    Likes Received:
    457
    Was wondering the same tbf
     
    • Like Like x 1
  20. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    New plugin, don't add things to existing plugins because it won't work - they're locked inside the pak files. Do your work in your new plugin and then later when packaging works you can just package your plugin and that'll make the pak file you share.

    Always put your work in your own plugin(s). That's a 100% hard rule you need to follow to have minimal pain later on :)

    Matt.
     
    • Helpful Helpful x 4
    • Like Like x 1
  21. OldVern

    OldVern Well-Known Member

    Joined:
    Nov 2, 2020
    Messages:
    18,176
    Likes Received:
    37,047
    Just a quick question about folder structure.
    Does the plug in become the "root" directory of the route project or do I need to create a separate route sub folder within it alongside those for terrain, placemarks etc.?
     
  22. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    Yes to both I think.

    Take the Manchester route for example:

    upload_2023-10-2_11-32-28.png

    There's nothing like KML files and DEM in here as those arent put in our packages but essentially just make subfolders. In my test route I've put things like "markers", "srtm" and "lidar" just to keep it organised. What you call them and where is up to you but yes definitely organise with folders. You may want to make a "source" folder and put things like kml/dem etc in there so it's out of the main folder structure too - actually not sure how it's done here since I generally dont see have any source files.

    Always manage the folder structure in unreal, don't mess with it in explorer, there's no need to. even copying things in - just drag and drop it from wherever you've got it, into the content browser pointing at the right place, and unreal will manage it for you. Adding things to explorer that are in plugin folders can get icky, let ue4 manage the folders at all times and your life will have one less pain ;)

    Here's what my scratch area looks like:

    upload_2023-10-2_11-36-25.png

    Again - all done in UE4, never use explorer to mess in a UE4 plugin unless you *absolutely* need to.

    Matt.
     
    • Like Like x 2
    • Helpful Helpful x 2
  23. ScottN

    ScottN Active Member

    Joined:
    Sep 1, 2020
    Messages:
    223
    Likes Received:
    137
    Does this work for scenarios too with packaging files?
     
  24. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    If you mean should they be in their own plugin? You can put multiple scenarios in a plugin, you could make lots of plugins with one each, but whatever you choose - make sure YOUR work is always in YOUR plugin(s) one way or another and you will be fine.

    Matt.
     
  25. greggryan2

    greggryan2 Active Member

    Joined:
    Dec 21, 2018
    Messages:
    419
    Likes Received:
    179
    Just want to check this Matt, I am correct in saying if someone did put their stuff within the plugin of the route and it's just the pak being read, there is a chance the stuff someone has added timetable or scenario could get deleted when the editor reads the pak file on say next load or something?

    Just thought I'd ask as it might outline to someone what may happen by putting their stuff within the plugin pak rather than their own plugin :).
     
  26. ScottN

    ScottN Active Member

    Joined:
    Sep 1, 2020
    Messages:
    223
    Likes Received:
    137
    I notice that you mentioned formation editors coming too can we still build formations in plugins?
     
  27. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    You can build formations too by creating a data asset of type "Train Formation" into your plugins yes.

    Dont think you'll lose anything - the files are saved locally, you're just going to run into problems when you try and package it to share it for others or try to put it in the game.

    Matt.
     
  28. greggryan2

    greggryan2 Active Member

    Joined:
    Dec 21, 2018
    Messages:
    419
    Likes Received:
    179
    Arr right okay, sounds like it's still best to just keep it in a separate plugin.
     
  29. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    504
    Likes Received:
    511
    I'm currently building a timetable and I got the problem, that if I spawn in after the creation time the service does not spawn and run, is there a way to fix that? And should I create a Formation for every service?
     
  30. ScottN

    ScottN Active Member

    Joined:
    Sep 1, 2020
    Messages:
    223
    Likes Received:
    137
    Wait a minute so you can’t package files into a game right now?
     
  31. greggryan2

    greggryan2 Active Member

    Joined:
    Dec 21, 2018
    Messages:
    419
    Likes Received:
    179
    Theres a couple of factors that might contribute to your issue. Have a look at firstly have you got a data track as without one services may not begin if you spawn in after the time they are due to start.

    So you can daisy chain one formation to do different services or have multiple formations doing different service etc. Just keep in mind you can only have one formation do one service at a time. and if you have it begin another service from one it's just finished it won't jump across map your new service would continue from where last one left off if your daisy chaining two services. Hope that make sense :)
     
  32. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    504
    Likes Received:
    511
    How do I fix that
     
  33. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    You need a formation for each train that runs - normally a train will run multiple services.

    In order to make a timetable work AFTER its service start time, you need to have the timetable simulated and data track(s) saved as it uses those to put the trains in the right places at the given times and set them up accordingly.

    Matt.
     
    • Helpful Helpful x 2
  34. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    Not aware of this no - however it might be as simple as nobody knows the command. I don't, and the people I need to ask about it are busy dealing with xbox crash problems so i'm holding off pestering them on that for the time being.

    Matt.
     
    • Like Like x 3
  35. ScottN

    ScottN Active Member

    Joined:
    Sep 1, 2020
    Messages:
    223
    Likes Received:
    137
    I appreciate the work you do Matt
     
  36. mickelmickle

    mickelmickle Active Member

    Joined:
    Dec 9, 2016
    Messages:
    103
    Likes Received:
    97
    How do you Access CMD in the editor ?
     
  37. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    not sure what you're asking. what is it you want to do?
     
  38. mickelmickle

    mickelmickle Active Member

    Joined:
    Dec 9, 2016
    Messages:
    103
    Likes Received:
    97
    i wanted to use it to change time and date, i saw Will use it on your Editor stream, but i cant find how to access it,
     
  39. KTL_Rob Powell

    KTL_Rob Powell Well-Known Member

    Joined:
    Aug 18, 2018
    Messages:
    237
    Likes Received:
    325
    the tilde (`) (above tab usually and next to 1/!) key on a UK keyboard - not sure which key it is on European or US keyboards
     
    • Like Like x 2
  40. mickelmickle

    mickelmickle Active Member

    Joined:
    Dec 9, 2016
    Messages:
    103
    Likes Received:
    97
    Thank you KTL, much appreciated
     
    • Like Like x 1
  41. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    ah yes that's the console.

    When you said CMD i wondered if you mean tthe command line in windows (which is accessed with the command "cmd") :)
     
    • Like Like x 1
  42. ethankuo

    ethankuo New Member

    Joined:
    Mar 19, 2023
    Messages:
    10
    Likes Received:
    14
    Hi, I have a little question
    Is route expand possible?
    For example: I have already owned the Schnellfahrtstrecke Köln Aachen DLC, can I used the DLC and PC editor to cross the Rhine to extended to Köln Messe/Deutz?
     
  43. DTG Matt

    DTG Matt Executive Producer Staff Member

    Joined:
    Nov 17, 2016
    Messages:
    3,350
    Likes Received:
    18,937
    No, changing existing routes is not possible i'm afraid.
     
  44. mickelmickle

    mickelmickle Active Member

    Joined:
    Dec 9, 2016
    Messages:
    103
    Likes Received:
    97
     
  45. mickelmickle

    mickelmickle Active Member

    Joined:
    Dec 9, 2016
    Messages:
    103
    Likes Received:
    97
    Sorry Matt, i meant to say what it was lol, ive been up all night, getting to grips with Editor, its a huge learning curve, one im sure will be worth it, with lots of patience
     
  46. BR143_Fan

    BR143_Fan New Member

    Joined:
    Sep 2, 2020
    Messages:
    9
    Likes Received:
    4
    Hello DTG Matt!

    How can I tell the player for example to go to the drivers seat at the other train end? I found the blueprint type, but i dont know how to add objectives for that…. :)

    thanks for help!
     
  47. greggryan2

    greggryan2 Active Member

    Joined:
    Dec 21, 2018
    Messages:
    419
    Likes Received:
    179
    You would use Objective actions within scenario manager to do this but I have not been able to get them working so might be something DTG look into cause yeah I was unable to achieve a simple objective action telling player to sit in driver seat. Also, the objective actions aren't actually showing up under the add component drop down so I think something is broke with them.
     
  48. cadeshr6s

    cadeshr6s Well-Known Member

    Joined:
    Aug 2, 2020
    Messages:
    504
    Likes Received:
    511
    And how do I do that?
     
  49. greggryan2

    greggryan2 Active Member

    Joined:
    Dec 21, 2018
    Messages:
    419
    Likes Received:
    179
    You would copy and past one of the .bat files and edit a command which when ran will simulate the timetable you tell it and it'll crash but when you reload the editor it will have auto assigned the generated data track to the timetable.

    "(Replace with your Path to this file ->TrainSimWorldPublicEditor.exe)" TS2Prototype -run=SimulateTimetable Timetable=RouteTimetableDefinition(the reference to the timetable you want to simulate)
     
    • Like Like x 1
  50. ScottN

    ScottN Active Member

    Joined:
    Sep 1, 2020
    Messages:
    223
    Likes Received:
    137
    I notice when I made a scenario for Clinchfield Railroad is there’s a go via instruction for the first instruction but not any of the other instructions. As I play in editor
     

Share This Page