Make a beam trigger slow motion?

Discussion in 'Programming' started by ThreeDTech21, Jun 8, 2016.

  1. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,616
    Is it possible to make a Beam Break trigger slow motion?
     
  2. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    in theory yes, in practise i am not too sure.
     
  3. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,616
    I looked through the bullettime.lua and also the beamstate.lua and I think these are the two files that house what is needed to create a beam break slow motion script. I don't have enough knowledge of LUA to create anything useful. I tried a few things and they flatout didn't work.

    For example have a look at some of the things I tried (of course I have no clue what I'm doing, just shots in the dark)

    In this Picture in the beamstate.lua I have added at line #74 "M.maxBulletTime = 10" I did this because it looks to me like that broken beam code triggers those variables, So I added bullet time to the set of varibles... :p

    edit1.PNG
     
    #3 ThreeDTech21, Jun 8, 2016
    Last edited: Jun 8, 2016
  4. SixSixSevenSeven

    SixSixSevenSeven
    Expand Collapse

    Joined:
    Sep 13, 2013
    Messages:
    6,960
    i'd do it in vehicle lua.
     
  5. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,616
    EDIT: Got it to work!

    I added this line of code

    BeamEngine:setSimulationTimeScale(0.5)

    to the Beamstate.lua in the section "if brokenBeams == 1 then"

    When the wheel beam breaks slow motion is triggered, so this is a start. Now what I have to do is find a way for it to timeout and go back to realtime.
     
    #5 ThreeDTech21, Jun 8, 2016
    Last edited: Jun 8, 2016
  6. Saniamos revived

    Saniamos revived
    Expand Collapse
    BeamNG Team

    Joined:
    May 8, 2015
    Messages:
    14
    From the ge and ui side you should be able to use bullettime.set(val) where val is between 1 and 100 inlcuding the bounds. Everything above and below seems to be mapped on the bound itself.
    bullettime.reset() should go back to realtime if i read the code correctly.

    Oh and also there seems to be bullettime.slowMotion(time, percent) so time would be the time how long the game should be in slowmotion and percent seems to be the same as in bullettime.set
     
    • Like Like x 1
  7. ThreeDTech21

    ThreeDTech21
    Expand Collapse

    Joined:
    Sep 27, 2013
    Messages:
    1,616
    Nice Thanks! With a little work I want to get this to be a cool feature in the game. The next factor I would be looking into is how to get the game to temporarily switch to the camera (car) that is crashing/crashed and in slow motion for about 1.5~2.5 seconds before switching back to the player camera, this would be another cool feature. It will take alot of research but i'm sure its possible.
     
  8. Nadeox1

    Nadeox1
    Expand Collapse
    Spinning Cube
    BeamNG Team

    Joined:
    Aug 5, 2012
    Messages:
    14,683
    By the way, in the next update you will be able to have a closer look at some ingame examples, as the 'Intersection' scenarios will have that along with some other fancy stuff.

     
    • Like Like x 6
  9. Car8john

    Car8john
    Expand Collapse

    Joined:
    May 12, 2016
    Messages:
    6,292
    I feel this has to do with that Utah camera angle.....
     
  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