Introduction to scenarios creation

Discussion in 'Content Creation' started by Nadeox1, Jul 14, 2015.

  1. Scepheo

    Scepheo
    Expand Collapse

    Joined:
    Feb 10, 2015
    Messages:
    601
    I was curious whether this tutorial will be updated to include information on creating a scenario from scratch. Also, it currently says:
    In my experience, that's not true - failing to delete the prefab_filename value only results in the prefab being automatically saved to Documents/BeamNG.drive/levels/levelname/, rather than the editor asking for a location.
     
  2. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,614
    The download page isnt working

    Capture.PNG
     
  3. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,654
    It works fine here..
     
  4. defib

    defib
    Expand Collapse

    Joined:
    Aug 6, 2013
    Messages:
    490
    Nope. Not working for me either. May be because you have elevated permissions.

     
  5. Scepheo

    Scepheo
    Expand Collapse

    Joined:
    Feb 10, 2015
    Messages:
    601
    • Like Like x 2
  6. defib

    defib
    Expand Collapse

    Joined:
    Aug 6, 2013
    Messages:
    490
    When I pack my prefab, right after I save it the player vehicle goes away. If I try to load it (the scenario), it won't. (Because there's no vehicle)
    How do I prevent the car from disappearing when saving/packing the prefab?
     
  7. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,619
    I'm currently on v4.3.x and I am able to skip this step. My prefab contains several waypoints and the player position. The coordinates for these things are maintained correctly, and BONUS, I don't have to fool with the prefab being saved in the wrong place! When I click "Pack Prefab" it packs it into BeamNG.drive/levels/mylevel/prefabnamehere.prefab

    I'm not sure if having other objects is a problem, but right now it's much smoother than the old workflow I was using (deleting the 'prefab_filename' line, moving files around, etc).
     
  8. BBQ

    BBQ
    Expand Collapse

    Joined:
    Aug 27, 2012
    Messages:
    551
    How do you calulate what to write in the "date"-part on the .json?
     
    • Like Like x 1
  9. gabester

    gabester
    Expand Collapse
    Vehicle Director
    BeamNG Team

    Joined:
    Jun 6, 2012
    Messages:
    2,657
    • Like Like x 3
  10. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,619
    I'm glad this came up! I didn't recognize the date format but I was too stubborn to ask.
     
    • Like Like x 1
  11. Aerotactics

    Aerotactics
    Expand Collapse

    Joined:
    Dec 23, 2015
    Messages:
    57
    I don't see "My First Scenario" in my list of scenarios. My guess is that its not up-to-date with 0.5's new mod format, but I'm just a new driver peasant who has no clue, just a good idea for a scenario and the will to learn how to make it possible.
     
  12. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,654
    Oh yes, since 0.5 changed how unpacked stuff in /mods works, that method doesn't really work.
    Will put a big notice for now, until we have a better way to use unpacked mods.

    Using Documents/BeamNG.Drive/levels 'should' work too, haven't tried.
     
  13. AR162B

    AR162B
    Expand Collapse

    Joined:
    Aug 11, 2013
    Messages:
    818
    Hey, the tutorial was really helpful, thanks for making. It worked fine in the unpacked directory.

    I've got two small questions though;
    - While making a scenario is there a way to remove objects from the map without compromising the map itself?
    - Is there a way to make a lua file which can detect if a certain breakgroup is triggered? This way is could be possible to make a scenario which one will fail when a trailer is detached.
     
  14. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,654
    1. If the object is part of the map, no. You can only 'add' objects with .prefabs.
    2. Should be doable. LUA scripts are totally supported from scenarios (I don't think we have an example of that)
     
  15. AR162B

    AR162B
    Expand Collapse

    Joined:
    Aug 11, 2013
    Messages:
    818
    Hey, thanks for the reply. I'll try some creating the trigger, I'll ask around if it doesn't work out. If you've got any ideas, please let me know. I found the existing scenario lua files, the damage limit looks a bit like it but it isn't what I'm looking for.
    I couldn't find the 'Broken truck' scenario, that one looks likes it triggers random breakgroups while driving. Any idea where I can find the corresponding lua file? I couldn't find it in the east coast(/scenarios) folder.
     
  16. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,619
    • In reference to removing static objects: I haven't tried it yet, but Scepheo made a suggestion about that in post #4 of my (related) thread over here. Pretty clever, but clearly fragile.
    • In reference to the Broken Truck scenario: The files are named "minimum speed" rather than "broken truck". IIRC once you look at how the scenario works it becomes obvious why. ;-)
    • In order to check about whether a breakgroup is broken I think you'll need to write a brief function using "obj:beamIsBroken(beam.cid)", a function which came up in post #12 of this discussion. I'd just copy the function breakBreakGroup from beamstate.lua and tune it up a little. Loop through the breakgroup and set the return value to 1 for every broken beam. If the return value is =/= 0 then the breakgroup is broken.

      That said... why not just skip all of that and check a single beam from inside the breakgroup? As long as one beam in the group is broken then the whole group is broken, right?
     
    • Like Like x 1
  17. AR162B

    AR162B
    Expand Collapse

    Joined:
    Aug 11, 2013
    Messages:
    818
    Thanks for the info! :) I'll look into it, I'll see if I can make such a file.
     
  18. Aerotactics

    Aerotactics
    Expand Collapse

    Joined:
    Dec 23, 2015
    Messages:
    57
    What should I do from here?

     
  19. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,619
    Ah, that's not going to work right now. Change your path please:

    Documents/BeamNG.drive/mods/levels/Industrial/
    changes to
    Documents/BeamNG.drive/levels/Industrial/

    IMO that is the best path to use for the creation process. After you are done you'll need to create a zip file containing the "levels" folder. That zip file will be placed in the /mods/ folder as usual. Please read through the rest of the thread if you'd like. I'm not sure that Nadeox1 necessarily agrees with Scepheo's and my own input, but it's there if you want. (look at post #21 and #27 - that advice may streamline the process for you a bit)
     
  20. Aerotactics

    Aerotactics
    Expand Collapse

    Joined:
    Dec 23, 2015
    Messages:
    57
    Damn that was a quick response. Thank you sir.
     
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice