Not signed in (Sign In)

Discussion Tag Cloud

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorFüchschen
    • CommentTimeMar 6th 2016
     
    ^
    I think we should continue this via wisper because its really getting offtopic.
    •  
      CommentAuthorRCF
    • CommentTimeMar 6th 2016
     
    I want a sound effect to play as the train is leaving the station. Are there any good scripts for this?
    •  
      CommentAuthorbestdani
    • CommentTimeMar 7th 2016 edited
     
    AFAIK there is one in the Audio Demo Park also the default "track trigger test" object uses triggered static sounds. If you're looking for an triggered onboard sound you can find several scripts in this thread.
  1.  
    Downloaded TheCodeMaster's Dynamic Coaster Sounds addon, and got this error

    "Warning in File 'Models\roar_B&M\roar.nlvm' in Line 2: Imported package not used: nlvm.math3d
    ...0 error(s), 1 warning(s)"
    "Exception: IllegalArgumentException
    at public static native com.nolimitscoaster.StaticSound com.nolimitscoaster.StaticSound.loadFromFile(nlvm.lang.String,int)
    at public bool roar.onInit()
    at public final void com.nolimitscoaster.Script.run()
    StaticSound.loadFromFile: invalid flags parameter"

    How to fix?
    •  
      CommentAuthorbestdani
    • CommentTimeMar 8th 2016 edited
     
    Replace the second parameter of every StaticSound.loadFromFile(String path, int flags) method with 0.

    Should look like this in the code:

    //THIS IS WRONG
    arbitraryName = StaticSound.loadFromFile("arbitarySoundName.wav", StaticSound.E_ENVMODE_GLOBAL);

    //REPLACE BY THIS UNLESS YOU KNOW WHAT YOU DO
    arbitraryName = StaticSound.loadFromFile("arbitarySoundName.wav", 0);


    And maybe remove import nlvm.math3d.*; somewhere at the beginning to get rid of the warning.
  2.  
    Awesome, Thanks! That worked.

    Next issue I found is that the sound doesn't really fade with distance. (It could be quite a distance away and you can hear it like you were next to it.)
    •  
      CommentAuthorbestdani
    • CommentTimeMar 8th 2016
     
    Look if you can find a method setDistanceParameters if it's already present it has two parameters the first controls a reference distance and the second how fast it gets silent after the reference distance. It should look like this:

    //5.0f is the reference distance, 1.0f how fast it gets silent
    arbitraryName.setDistanceParameters(5.0f, 1.0f);


    If it's not already present:

    arbitraryName = StaticSound.loadFromFile("arbitarySoundName.wav", 0);
    //add it here like this:
    arbitraryName.setDistanceParameters(5.0f, 1.0f);


    You can find more details about this method in the manual (Scripting API -> Class Overview -> com.nolimitscoaster.StaticSound -> setDistanceParameters).
    Play with the parameters (save the script after each change) until it fits your requirements.
  3.  
    Hi everybody, does anyone have a script to start with track trigger an animation made with blender ? thanks
    •  
      CommentAuthorbestdani
    • CommentTimeMar 9th 2016 edited
     
    ^ Yes.
  4.  
    Thanks Best Dani
    •  
      CommentAuthoriSatnav
    • CommentTimeMar 9th 2016 edited
     
    On the request of COASTERGUY246, I made a Zierer Star Shape. He is happy with it being static. I am not.
    I tried to do it with keyframe animation but I can't get it working with anything more than 1 object moving. Anyone who can script it, preferably with physics on the arms, please get in touch so I can send you the model. Thanks!

    EDIT: Forgot to add images... GG me...

    https://gyazo.com/fab8edf9ad1d76663907910a64028dca https://gyazo.com/866f03002647904d80331e63e8aa696b
    •  
      CommentAuthorFüchschen
    • CommentTimeMar 9th 2016
     
    ^
    Is there in blender something like: "link objects together", "IK-Spline", ...
    In 3ds max its called "select and link". This creates a bound between 2 elements without welding them together. They just move relative to each other and i guess thats what you want, or am i wrong?

    But im not sure if blender has something like this...

    Maybe search for: Blender link elements together.

    It should work like this:
    (imagine the lights are the seats of your flatride)
    •  
      CommentAuthoriSatnav
    • CommentTimeMar 9th 2016
     
    ^I believe that parenting is what you are talking about. I can move the "child" of the parent without moving the parent but moving the parent will move the child, if that makes sense. That, I think, is what is messing up the keyframe animations, hence why I am asking for someone to script animation and physics for me.
    • CommentAuthorBigbad
    • CommentTimeMar 9th 2016
     
    Is there a way to write a script to have the NL2 recording software stop on its own? I'm thinking something like turn it on and go to work, and then when the train passes a point or enters a zone (final brake run, which I can name), the recording stops. I'm okay with having the program run while I'm out.

    Recording in complex environments takes a long time, but I don't want to have the recording go all day.
    •  
      CommentAuthorFüchschen
    • CommentTimeMar 9th 2016
     
    ^^
    even doing a reversed parenting wont work there?
    (1. shoulderbares, 2. seat, 3. arm rotor, ...)

    ... blender is strange ... :/

    --------------------

    ^
    Maybe you can remote control it with the telemetrie-server and a java programm.
    But then you need to hardcode the time-stamp, when a train reaches the part of track you want to record, because the server can only send information to the client, i think...
    •  
      CommentAuthorbestdani
    • CommentTimeMar 9th 2016 edited
     
    ^ Using information from the telemetry server (if this works during recording) could be an approach, but ...
    ^^ it's not possible using NL2 scripting.

    @iSatnav: Actually parenting and keyframe animations work pretty good, can you describe in more detail what does not work? But I could maybe create a script for it the next week, this would allow custom automatic programs and also manual control.
    (^ you can also use object constraints or rigging to achieve "bindings" of objects in blender, parenting is the most obvious method).
    •  
      CommentAuthorFüchschen
    • CommentTimeMar 10th 2016
     
    ^
    There is no button registered to the "O" key in NLVM...
    And unless the value of the button stays the same, even when you swap the key in the setup, its not working with NL2 script.

    But if it does work, then great.
    When i have some time, i'll also try it. More keys that can be used, might be very interesting.

    Right now, im using the "C" key to open a park map, but i really want to use the "M" key (like in most RPG, too)

    ---------

    And you dont need to explain blender to me ;D
    Im using 3ds max and im happy with it.
    •  
      CommentAuthorbestdani
    • CommentTimeMar 10th 2016
     
    ^^ it's not possible using NL2 scripting.
    •  
      CommentAuthorFüchschen
    • CommentTimeMar 10th 2016
     
    ^
    i also realised it by now.
    hadn't a coffee at this time.
    • CommentAuthortiniet94
    • CommentTimeMar 11th 2016
     
    So i have finally managed to get Station Audio and the Dispatch Audio to work, however what i haven't yet come across is a way to have them work together. Does anybody have or know how i can go about the Station Audio fade out when the dispatch begins and then fade back in when the dispatch audio finishes? It sounds too much when they are both playing together!
    •  
      CommentAuthorFüchschen
    • CommentTimeMar 18th 2016
     
    Shadercore Script:

    Is it possible to use JPG (black & white) for a alpha mask?
    I tried this:

    Result.rgb = Tex0;
    Result.a = Tex1;

    but i guess, i'll need a PNG with alpha channel for that to make it work.
    So do i somehow need to convert the value of the white color to the strength of the alpha channel?
    • CommentAuthorole
    • CommentTimeMar 18th 2016
     
    ^ Yes it is possible. Use swizzling to redirect the correct channel. In your code the alpha channel of Tex1 is assigned to Result.a which is not what you want.

    Correct code:


    Result.rgb = Tex0
    Result.a = Tex1.r;


    This works when the red channel of Tex1 contains your information for the alpha mask. It works when the jpg is gray or black and white.
    •  
      CommentAuthorFüchschen
    • CommentTimeMar 18th 2016
     
    ^
    Thank you.
    3Ds Max is a bit unstable when i use PNGs. Now i can use JPG instead.



    A bit fine-tuning and it is perfect (the black color comes from multiple sprites on top of each other, i guess. But when the exhaust gas is animated, it should look good... hopefully :D)

    ---------------

    Another 2 questions:

    1> How far is the rendering range of Background SCOs (Enviroment) in meter? (i know, the range is at least 3-4 times as long)
    2> Is it possible to script Background SCOs the same way as normal scos (with a script attached to the enviroment)?

    I need to create an artificial enviroment, because i need to control the sun elevation via script.
    And as far as i know, this not possible with the real enviroment.
    • CommentAuthorole
    • CommentTimeMar 18th 2016
     
    1>: Max range radius from center of the park should be around 12km. Background is circular and not rectangular, that is why I expressed the range as a radius. 2>: It should work.
    •  
      CommentAuthorFüchschen
    • CommentTimeMar 18th 2016 edited
     
    ^
    I was hoping, that the range was circular.
    Thats perfect for what im trying to do.


    But i cant find a good way, to access the bgObject via script:

    The Background Object is the red one, that is submerged into the ground.

    I somehow need to give that object a name, otherwise im not sure, how to change the position.


    //Script attached to the enviroment
    public bool onInit(){
    sco = NoLimits.getSimulator().getSceneObjectForEntityId(getParentEntityId());
    System.out.println("BgObject: "+sco); //returns null -> (maybe because its in the "background?!")
    return true;
    }



    EDIT:

    Got it!


    public static SceneObject sco;
    public static bool loop = true;

    public bool onInit(){
    int i = 0;
    while(loop){
    i++;
    if(NoLimits.getSimulator().getSceneObjectForEntityId(i)!=null && NoLimits.getSimulator().getSceneObjectForEntityId(i).getElementForName("Sphere001")!= null){
    sco = NoLimits.getSimulator().getSceneObjectForEntityId(i);
    break;
    }
    }


    Looks ugly, but at least it works.
    Is there a better way, to get the background objects?
    • CommentAuthorole
    • CommentTimeMar 18th 2016
     
    ^ Have you tried attaching the script to the background object?
    •  
      CommentAuthorFüchschen
    • CommentTimeMar 18th 2016 edited
     
    ^
    For that i need to somehow "Reload" the sco, but i can't select background objects.
    A restart of NL2 also did't work.

    I'll try a complete shutdown. Maybe something was still running in the background.

    --
    Ok now its working.

    Do i understand it correct, that the only way to update the background objects, is to restart NL2?
    I could first create a normal sco and reload it until everything works as expected and then use it as bg object.

    The people in my steam-list already complained about that constant "[...] is playing Nolimits 2" popup every 10 secounds :D
  5.  
    Can somebody explain what the new 'Private Virtual Machine' option means? Like explain it like I'm a kid haha.


    I've noticed that a lot of the scripts I'm running in Terra already have it pre-selected (such as all the ambient music), and I'm wondering if there's a benefit to it.
    • CommentAuthorole
    • CommentTimeMar 20th 2016 edited
     
    The old behaviour is when the Private Virtual Machine option is enabled. That is why all your scripts have it enabled, because you created those scripts before the option was introduced. The new option is to have shared virtual machines, which will be used when the Private VM option is disabled. This is the new default. Let me explain what the difference between both ways is. When you only have one script and one scene object instance, there is no difference between both options. There is a difference when you have multiple scenery objects or multiple scripts. Shared virtual machines means that each instance will run in the same virtual machine after each other. Since they run in the same virtual machine they all have access to their global variables so they can communicate with each other. But they cannot run in parallel. Also there will be faster loading times, because there are less virtual machines that need to be created. In contrast private virtual machines (old behaviour) have the advantage that each instance is completely sealed from other instances, each script instance runs in its own VM. There is no way multiple instances can communicate with each other, also they will most likely run faster because each virtual machine can run concurrently on multi core CPUs, there is no need to serialize the execution of each script instance.

    As a general advice: When loading time is an issue (e.g. you have a scripted scenery object with lots of instances, like a park lamp, then disable Private VMs). If you need your scripts to communicate with each other using global variables, you must disable Private VMs as well. In other cases, enabling Private VM is most likely the better choice.

    Private VMs:
    Pro: Faster execution times on multi core CPUs
    Con: Slower loading times, especially when lots of instances of the same script are used

    Shared VMs:
    Pro: Shared global variables, faster loading times
    Con: Slower execution times on multi core CPUs
  6.  
    Is there a script out there that could do a backwards launch like Full Throttle?
    •  
      CommentAuthorOlmisery
    • CommentTimeMar 22nd 2016 edited
     
    •  
      CommentAuthorSedjuuurd
    • CommentTimeMar 28th 2016
     
    so uhm i need help with multiple audio scripts.

    1. a scripted ogg or mp3 file that plays when coaster runs accros a trigger. just playing once nothing more nothing less.

    2. a constant looping ogg or mp3 file which plays from a 3D model.

    now both need to be heared at a certain distance. and not trough the whole park. so if possible give it a distance at which it fades out. is that possible?
    please let me know i need it so much!
  7.  
    Would it be possible to use the light that shows the NL2 logo on a surface to have it play a video clip?
    •  
      CommentAuthorZergei
    • CommentTimeApr 6th 2016
     
    ^ I'd like to know that too, I got some projections I want on an indoor flat ride
    • CommentAuthorcam135
    • CommentTimeApr 8th 2016
     
    Is there a script for attaching objects to a train. I'm trying to attach a lantern I modeled to the front of the mine train. Any help would be greatly appreciated.
    • CommentAuthorWomp83
    • CommentTimeApr 9th 2016
     
    ^ I've just posted it in the NoLimits 2 Resources thread. :)
    • CommentAuthorcam135
    • CommentTimeApr 10th 2016
     
    ^your awesome!!! Thanks so much!!
    • CommentAuthortobihelix
    • CommentTimeApr 14th 2016
     
    Is This Possible to Script?

    https://www.youtube.com/watch?v=AiBmPoHCyoQ
    • CommentAuthorBlaseRhine
    • CommentTimeApr 14th 2016
     
    ^ Yes it is possible to script. I have done it before, however it isn't easy and you need custom trains as well to make it work.
  8.  
    Does anyone know of an already existing script to turn lights on or off when a trigger is hit?
    • CommentAuthorTheBeatles
    • CommentTimeApr 27th 2016
     
    ^No, but I know of four that aren't already existing.
  9.  
    Nvm, I think I know what to do
    •  
      CommentAuthorbestdani
    • CommentTimeApr 29th 2016
     
    Yes, in my triggered lights set (TriggeredSwitch)
  10.  
    Would anyone be interested in constructing a multi-move script for Tonatiuh, so that it can have 2 unloading and 2 loading stations? If I'm honest, I think I'll settle for a vertical lift as well, despite an elevator being my initial plan, so that isn't a worry :)
  11.  
    Is there someone that can make a script so I can add music to an object?
    • CommentAuthorMrRC
    • CommentTimeMay 1st 2016
     
    The standard door script has an audio funtion, u can use that for your purpose.
    •  
      CommentAuthorSedjuuurd
    • CommentTimeMay 1st 2016
     
    can someone please help me. for the love of god.

    im clueless on what the problem is and why its happening.

    i took the standart attach object script and tried to apply my newly modelled wheels to my coaster.

    but this happend:

    in editor: https://gyazo.com/4d6b41252d7c856f6a81b7cd0a88db3c

    in simulator: https://gyazo.com/9098bc7112a69bfa787cdf06448d165c

    after a very long search i found the wheels

    they were under the ground at the back of my 2nd station

    https://gyazo.com/f0aec091d61a59566590147e5f4876a9

    can someone help me fix this?

    i hate to say it but im gettin so frustrated that i cant even think straight right now...

    please help as fast as possible
    • CommentAuthorMrRC
    • CommentTimeMay 3rd 2016
     
    No help needed, problem is fixed.
    •  
      CommentAuthorFüchschen
    • CommentTimeMay 9th 2016 edited
     
    just a quick question about the telemetrie-server:

    If i use the "gettelemetrie" command, the X,Y,Z coords are always {0,0,0}
    Is this because it only works inside a rollercoaster, or is there some other problems?

    Everything else works perfectly. I had a nice idea for a combination with the fileimport and telemetrie-server, that i would like to test.


    EDIT:
    Ok it only works in Rollercoasters. Hopefully i find a way around it to make it work with the "view-matrix".
    • CommentAuthorCoastercam
    • CommentTimeMay 14th 2016
     
    Hello everyone, I am creating a roller coaster in No Limits 2 and I am trying to make it technically realistic.

    One thing I need to do is, when the emergency stop button is pressed on the control panel or even using F8 lights and an audio file need to be played.

    I'm not sure whether this is possible or not but if it is not then could someone notify me?

    Thanks!