1. Stuck, Having problems with creating your mod? Let us help you: Mod Support

Introduction to scenarios creation

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

  1. azkavabK

    azkavabK
    Expand Collapse

    Joined:
    Jun 28, 2018
    Messages:
    25
    Without your help it would have been impossible to create a two suspects chase scenario. Thanks for your help Gamergull.
    And please play and review my scenario "West Coast Chase Series"
     
  2. Dat-Mudkip

    Dat-Mudkip
    Expand Collapse

    Joined:
    Dec 6, 2015
    Messages:
    11
    I've run into a problem that I can't explain.
    I'm on the main menu, and I load my scenario via the main menu. (Bear in mind my scenario takes place on a custom map "Desert_Highway", which is in the repository.)
    The map will load, as will the scenario interface, but my car will not load and nothing else does.


    I'll get a countdown if I agree to start the scenario, but attempts to reload it by pressing "r" do nothing except freeze the timer.
    I open up my level editor, and find my scenario sitting among the other files. The scenario is unloaded.

    Upon manually loading the scenario, I get all my stuff...the car, the checkpoints, the props...even the "MUDK1P" license plate.

    So I'll hit F11 and attempt to play the game, but find that despite the game informing me there are 20 checkpoints, none of them seem to load.
    But in this case, for some reason I hit F11 and spawned in as a tire barrier...

    (Edit: I found out I misplaced a file, and this resulted in me spawning as the first thing listed...in this case, a tire barrier. So that issue has been sorted out, and I'm now spawning as the Covet, but all other issues remain.)
    I've spent several hours trying all sorts of things, including rewriting a good portion of my coding. (Bear in mind that I am an idiot with coding.) I even made sure EVERYTHING had a name.
    Here's an image of said scenario coding; let me know if there's anything amiss with it.

    (BTW, the reason that the checkpoints are counting down is because I messed up when naming everything...)
     
    #222 Dat-Mudkip, Nov 21, 2018
    Last edited: Nov 21, 2018
  3. azkavabK

    azkavabK
    Expand Collapse

    Joined:
    Jun 28, 2018
    Messages:
    25
    • Informative Informative x 1
  4. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    208
    @Dat-Mudkip You're missing commas at the end of the maxTime and waitTime lines. Although this doesn't usually cause fatal errors, it would be good to correct that.

    Also, try pressing tilde (~) while in gameplay, there might be an error log that can point out the issue.
     
    • Informative Informative x 1
  5. Dat-Mudkip

    Dat-Mudkip
    Expand Collapse

    Joined:
    Dec 6, 2015
    Messages:
    11
    If you're talking about the file name, it's "my_first_scenario.prefab".
    Before you ask, it's under Documents>BeamNG.drive>levels>Desert_Highway

    Thanks for pointing out the comma issue. That's been fixed.

    The error log spat this out:


    I'm not an expert, but it looks like it cannot locate the mission file for some reason...
    It's located in Documents>BeamNG.drive>levels>Desert_Highway>scenarios, so I'm not sure what the issue is.
     
  6. azkavabK

    azkavabK
    Expand Collapse

    Joined:
    Jun 28, 2018
    Messages:
    25
    @Dat-Mudkip try to give the checkpoint names in this order I mean (starting from 1, 2, 3...) or if that doesn't work download a scenario pack and see how others did it. I think this will solve your problem
     
  7. Dat-Mudkip

    Dat-Mudkip
    Expand Collapse

    Joined:
    Dec 6, 2015
    Messages:
    11
    Not to come off as rude, but what difference would it make?
    I was thinking about that just a little while ago. I may very well take a look at that.
     
  8. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    208
    I think I know what it is. "my_first_scenario already exists in level", hmm, seems that you saved the map after you finished working on the prefab file. You have to avoid saving and only pack the prefab when you're done. To correct this, try to open the map in Freeroam mode, then edit it, and delete the prefab object from the scene tree. Don't worry, this won't delete your scenario. Hopefully this fixes things.
     
  9. Dat-Mudkip

    Dat-Mudkip
    Expand Collapse

    Joined:
    Dec 6, 2015
    Messages:
    11
    It now works! I must've saved it by accident at some point...not sure when or why, but there we go!

    Since I got you on the line, I got two more questions:

    How do I change "skins" on a vehicle? For example, the tire barriers below...I want to change the direction the arrows are going, and I know in game you are given an option to spawn it with different skins. Could you tell me how to do that?



    My second question:
    As much as I like the Covet, there's not way this scenario will function properly with it. I want to use a semi-custom car for this scenario. The vehicle is a Sunburst with a high-performance radiator, slightly increased top speed, about half the fuel load, and it has a recolored paint scheme. Everything comes with the game, so there are no additional mods that need to be brought into question.
    Here's an image of the car:

    Once again, this is one of the default skins that was recolored in-game.
     
  10. Gamergull

    Gamergull
    Expand Collapse
    Staff Member

    Joined:
    Jun 3, 2018
    Messages:
    208
    Alright. So, to change the skin or configuration of vehicles, edit the partConfig line, as shown here:

    partconfig-help.jpg

    You may have to look in the game files (located within the steam/steamapps folder) to find the path of the part config you need. To help you out, here are the ones for "tirewall":
    • vehicles/tirewall/arrows_L.pc
    • vehicles/tirewall/arrows_R.pc
    • vehicles/tirewall/etk.pc
    • vehicles/tirewall/gripall.pc
    • vehicles/tirewall/hirochi.pc
    Same goes for the Sunburst, although the part config file should be found in your documents/BeamNG folder. Don't forget to edit the JBeam line in the editor to "sunburst".
     
  11. Dat-Mudkip

    Dat-Mudkip
    Expand Collapse

    Joined:
    Dec 6, 2015
    Messages:
    11
    I keep getting an error message that "partmgmt" is unable to load the file, though it seems to be detecting the existence of said file...


    I did make sure that the custom configuration file is under vehicles/sunburst, and that the name "Modified Rally" is correct...not sure what I'm doing wrong.
    On the bright side, it is loading the bare-boned Sunburst, so at least I'm going the right direction.



    The tire barriers seem to change correctly after I reload the scenario, so why the Sunburst is not able to do the same seems strange.
     
  12. Dat-Mudkip

    Dat-Mudkip
    Expand Collapse

    Joined:
    Dec 6, 2015
    Messages:
    11
    Alright, so it turns out I keep seriously underestimateing the amount of information Beam.NG wants before it will be cooperative.
    Bottom line is that I figured it out and fixed the issue, and now the car is showing up fine.
    To anyone reading this who wants to know how I fixed it, you may find this page useful.
     
  13. Grzybaon

    Grzybaon
    Expand Collapse

    Joined:
    Jan 31, 2019
    Messages:
    2
    Can somebody help me?
    Code:
    "speed":
    {
    "minSpeed":18,
    "maxTimeout":2,
    "wayPointNum":[1],
    "msg":"Don't slow down!",
    "purpose":"fail"
    },

    And after slowing down it counts like there is win not fail.
    I don't know what i made wrong.
     
  14. Nadeox1

    Nadeox1
    Expand Collapse
    BeamNG.Support
    Staff Member

    Joined:
    Aug 5, 2012
    Messages:
    12,687
    Can you post the full .lua?
    (use the CODE tags so it does not loose the formatting please, under the + in the text editor toolbar)

    Also the game logs should say the 'purpose/reason' of wins and fails. What does it say?
     
  15. Grzybaon

    Grzybaon
    Expand Collapse

    Joined:
    Jan 31, 2019
    Messages:
    2
    I fixed problem sorry for wasting your time :)
     
    #235 Grzybaon, Jan 31, 2019
    Last edited: Jan 31, 2019
  16. Shotgun Chuck

    Shotgun Chuck
    Expand Collapse

    Joined:
    Mar 6, 2015
    Messages:
    876
    Some incredibly stupid questions:

    1. How much of this is relevant to creating pure time attacks rather than scenarios? The wiki guide for that seems to skip much of this but leaves you with no way to actually position the objects you need.

    2. I'm going to revive that old (and never-answered) questions about what you do when the map you're working with doesn't have the object you need - mod maps, custom-made objects, etc.
     
  17. Occam's Razer

    Occam's Razer
    Expand Collapse
    Staff Member

    Joined:
    Aug 7, 2013
    Messages:
    848
    Quickraces use similar code, but have a different folder structure. Aside from that, it should be possible to copy the relevant files from an official quickrace and plop it into the map of your choosing, then start the quickrace in-game and adjust the prefab in the editor, same as a scenario.*

    It is possible to retrieve objects from other maps to use in quickraces. You'll have to create a folder for the level (which you'll have to do to create a quickrace anyway), then place the relevant folders and files for the object in question. Usually, this'll be the .dae file, the 1-3 texture files, and a materials.cs file pointing to those textures.**

    *not sure if that answers your question. It's pretty late, so my reading comprehension is shot atm.

    **Many materials.cs files identify official textures via absolute paths, ie "levels/utah/art/shapes/texture.dds" instead of just "texture.dds". If your object is one of the former, you won't need to copy the textures at all.
     
    • Informative Informative x 1
  18. Shotgun Chuck

    Shotgun Chuck
    Expand Collapse

    Joined:
    Mar 6, 2015
    Messages:
    876
    Sounds like it would answer my question, but due to being a complete n00b to anything involving code (and to the fact that it's pretty late here too) I'm not sure what to do with that information this moment. Figure it out some other day I guess.
     
    #238 Shotgun Chuck, Feb 17, 2019
    Last edited: Feb 17, 2019
  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