Solved Beacon Light on Miramar

Discussion in 'Mod Support' started by Youngtimer, Oct 15, 2016.

Tags:
  1. Youngtimer

    Youngtimer
    Expand Collapse

    Joined:
    Jun 15, 2016
    Messages:
    1,208
    I was trying to put Sunburst's blue beacon on Miramar. I edited jbeam, and the beacon don't sits very well. Where is the problem?

    Here is the file:
     

    Attached Files:

    #1 Youngtimer, Oct 15, 2016
    Last edited: Oct 15, 2016
  2. CreasingCurve

    CreasingCurve
    Expand Collapse

    Joined:
    Jan 19, 2016
    Messages:
    940
    What you have to do is open both the miramar body and the beacon in the beam editor that come with the game in the utils folder. Click on the beacon jbeam then go to beams, click add single then add about 4 beams from the beacon to the roof of the miramar. After you have done this there will be around 4 lines if code at the top of the jbeam. Simple move them to somewhere that you see other code like the one you are currently moving and put it with the similiar stuff. Lastly make sure that you identify the beams you add by saying something like //mybeams.
    Fairly simple explanation and may be a bit rambly but you should understand what to do.
    --- Post updated ---
    It may also be that because the miramar roof slopes down a bit at the front that you will need to raise the beacon slightly above the roof so it stays there when add it to the car.
     
    • Like Like x 1
  3. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
  4. Youngtimer

    Youngtimer
    Expand Collapse

    Joined:
    Jun 15, 2016
    Messages:
    1,208
    I tried this, but somewhere I messed up and Miramar won't load. Can someone please help me and find a mistake?
    Here is the edited file:
     

    Attached Files:

    #4 Youngtimer, Oct 22, 2016
    Last edited: Oct 22, 2016
  5. torsion

    torsion
    Expand Collapse

    Joined:
    May 31, 2015
    Messages:
    1,600
    It's not easy to read, but take a look at your console after trying to load the Miramar. (Press ~ on your keyboard.) Pay attention to the line which says "JSON decoding error: lua/common/json.lua:89: Invalid Dictionary due to: 'nil' at line 107. Last line was:{"mybeams"}". I've highlighted the key part, but go ahead and try it for yourself so that you can see what I'm talking about in-game. That should help you pin down which area of your JBEAM is causing the problem.

    Now let's take a look at your jbeam and see.. it looks like you tried to declare a breakgroup but did not use the proper syntax. I don't think you'd even want to create a breakgroup here, I'd just put a comment instead. JBEAM supports C-style comments, so CreasingCurve's suggestion of //mybeams is a perfectly good one. This label is literally just there for humans, the game doesn't care whether you have a comment there or not.

    Adding a bunch of beams in the NodeBEAM editor isn't going to solve your main problem - the thing needs to move upwards. I think that both you and @CreasingCurve should have taken a look at the beam structure before jumping to such conclusions. (after all, the screenshot clearly showed the beacon light stuck at the top of the cab... something was holding it in place...) CTRL+B will turn on beam visualization in-game.

    I've taken a closer look at everything and my previous suggestion of using nodeOffset may not work. Three things need to move upwards:
    1. the flexbodies (manually editing the JBEAM file is the best way to do this)
    2. the nodes (NodeBEAM Editor is the easiest way to move these)
    3. the props (uh-oh)
    We can easily move the nodes and mostly-easily move the flexbodies, but moving props gets a little tricky depending on how that particular prop was setup. There's a system for pre-placed meshes and a system where the mesh's location must be setup in the prop declaration. In this case we are going to move the reference nodes for the prop and everything will be fine. In fact, nodeOffset might do everything you need. In that case you'd add an "adapter" part to the miramar_mod slot - that part would add a slot for the beacon light but it would include nodeOffset.

    If you wanted to do this the other way we'll go back to those 3 things:
    1. You'll need to add "pos" to the flexbody:
      Code:
      ["sunburst_beaconlight_blue", ["beaconlight"]],
      becomes
      Code:
      ["sunburst_beaconlight_blue", ["beaconlight"],[],{"pos":{"x":0.0, "y":0.0, "z":0.0}}],
      
      After that you can increase the "z" value until the flexbody moves into position. The unit is meters, so be gentle.
    2. After positioning the flexbody accurately you'll know how far the nodes need to move. Highlight them all in the NodeBEAM Editor and use the move command to move them the same distance. If you keep multiple things open at once be certain to "reload" the jbeam in the editor after fixing the flexbody or you could lose your external changes.
    3. In this case we don't have to worry about the props at all... they are tied to those nodes we moved in #1 so they'll move into place automatically when the those nodes are properly positioned!
    Now you've got to contend with the next problem... making the beacon light spin is tied to a vehicle lua script which you'll need to copy over as well. :)


    --- Post updated ---
    Also you MUST rename this part... it can't be the same as any existing parts in game.

    This is not good:
    Code:
    "sunburst_beaconlight_blue": {
    This is good:
    Code:
    "duster02_miramar_beaconlight_blue": {
     
    • Like Like x 1
  6. Youngtimer

    Youngtimer
    Expand Collapse

    Joined:
    Jun 15, 2016
    Messages:
    1,208
    Thank you very much! Your help really worthed.
     

    Attached Files:

    • screenshot_00007.png
    #6 Youngtimer, Oct 27, 2016
    Last edited: Oct 27, 2016
    • 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