Not signed in (Sign In)

Discussion Tag Cloud

Categories

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

  1.  
    Is there a tripple launch script? If so, does anyone know where I can find it?
    •  
      CommentAuthorZergei
    • CommentTimeApr 20th 2017
     
    I'm very sure this man ^^ has done this, try to look around for his script :)
  2.  
    It's on steam and called multi launch script ;)
  3.  
    ^thanks
    •  
      CommentAuthorrcth
    • CommentTimeApr 30th 2017
     
    How can you attach an object or something to the player's "view"? For example in the Terror Tracks project, you have the splashscreen showing when you load the park and it keeps in front of the screen, no matter the camera orientation.
    •  
      CommentAuthorYedrimas
    • CommentTimeApr 30th 2017 edited
     
    You can get the current view of the player using sim.getViewMatrix(matrix).
    Then using multLeft (or multRight I can never remember..) you can move the object in front of the view.

    import com.nolimitscoaster.*;
    import nlvm.math3d.*;


    public class frontView extends Script
    {
    private SceneObject so;
    private Matrix4x4f multMat;
    private Matrix4x4f viewMat;


    private float x_val = 0;
    private float y_val = 0;
    private float z_val = -5;

    public bool onInit()
    {
    so = sim.getSceneObjectForEntityId(getParentEntityId());
    if(so == null)
    {
    System.err.println("Not attached to a scene object");
    return false;
    }

    multMat = new Matrix4x4f();
    viewMat = new Matrix4x4f();
    multMat.initTrans(x_val,y_val,z_val);
    return true;
    }

    public void onNextFrame(float f)
    {
    sim.getViewMatrix(viewMat);
    viewMat.multRight(multMat);
    so.setMatrix(viewMat);
    }

    }
    •  
      CommentAuthorrcth
    • CommentTimeMay 1st 2017
     
    Thank you, that works!
    •  
      CommentAuthorrcth
    • CommentTimeMay 25th 2017
     
    I would guess it's not possible, but can we use a good IDE for NL2 scripting? I really love IntelliJ for programming in Java, but I don't think it's possible to access the NL2 SDK. Notepad++ autocomplete is horrible.
    •  
      CommentAuthorjpaufsc
    • CommentTimeMay 25th 2017
     
    ^That would be really cool. I've also grown accustomed to programming Java in IntelliJ as well. If there was a way to import NL2 libraries or something, it would be really easy to write scripts.
    •  
      CommentAuthorrcth
    • CommentTimeMay 26th 2017
     
    I'm working on a script that attaches a object to a train and can be rotated, to create an effect such as the Dinosaur ride in Disney's Animal Kingdom. So far it's going well, but there is one problem I can't figure out what's wrong.

    There are three classes:
    - CarScript is the script attached to the coaster, it creates handlers for each train
    - CarHandler is a script which is associated with one train and its scene object It has a start and stop function (for the beginning and the end of the ride) and a process function which is executed each tick. If the train hits an action trigger, a new action is created
    - CarAction is a specific action to one train. It has a start time, a time duration and the direction as the constructor parameters (and of course a reference back to the handler)

    In the CarAction's process method, the current time is checked. If the time is greater than the end time, the method is cancelled. Otherwise it's going through a switch statement, based on the animation direction. Here's what's wrong: instead of a gradual change each tick (of .1f/-.1f) until the current time has passed the end time, it just suddenly has a rotation of .1f (or -.1f) and does nothing. To make it even more compex: when the animation is done, the object suddenly goes back to 'base' rotation and it's like nothing happened to it.

    CarScript.nlvm: here
    CarHandler.nlvm: here
    CarAction.nlvm: here

    Other things are working fine, so it probably is something in the process method of the CarAction script.

    I hope someone here has an idea. I've tried multiple notations to adjust the scene object's Vector3f rotation, but none seem to work how I hoped it would be.
    • CommentAuthorJetPulse
    • CommentTimeMay 26th 2017 edited
     
    Teach a man to fish...

    Start outputing variables to the console to track them and see what isn't behaving as you want. I haven't looked at the code, but from description it sounds like printing the control variable for the switch statement sounds like a good place to start. If it's switching when not supposed to, print the variables that control the switching process. Keep tracking things back until you find the variable that is the problem and fix the code. Something as easy, for example, as:
    System.out.println("Switch="+SwitchVar+" TimeVar:"+TimeVar);

    Not sure what you're trying to do adjusting the Vector3f. If it's not moving in the directions you want, then yes you should consider that. But if it's not moving when it should or moving when it shouldn't, then that's not the Vector3f, but something else.

    It's good that you possibly got the issue isolated to the CarAction.nlvm script. You might want to print some key variables from the others just to validate (if there's any possibility at all that they're not correct).
    •  
      CommentAuthorrcth
    • CommentTimeMay 26th 2017
     
    I forgot to add that in fact I already did debugging with console logs, quite a lot of them actually.

    In the CarAction class I have console logs commented which show the direction it should move, being LEFT, RIGHT, FRONT and BACK. So far I tested LEFT and RIGHT, because if these work, FRONT and BACK should be easy to do as well. The console was outputting LEFT (or RIGHT) while the process was running (currentTime < endTime). So that was working fine.

    I also did a debug for the Vector3f Z value, because that's the left/right roll in this code. When the LEFT action starts running, the value is -0.1 the entire time. It keeps outputting 0.1 while the LEFT process was running. When the process is finished (currentTime >= endTime), the -0.1 output stops (as it should) and the car is returned to it's base position (which it should not do, so the Vector3f gets resetted somewhere). The same happened while the RIGHT process was running, except the output was -0.1 (as expected).

    So my assumptions:

    - Somewhere at the end of the action (currentTime >= endTime) the Vector3f object gets resetted which undoes the applied rotation of the scene object

    Known bugs:

    - Rotation isn't gradual. Instead of applying (-)0.1f every tick until the end of the action, it is only applied once, regardless of the +=/-=.
    - The rotation gets cancelled when the process is finished.

    I did quite some debugging with other bugs before, but I removed those lines to clean up my code a little. Again, I've done quite some things to try and figure it out, I probably should have noted that in the original post as well.
    •  
      CommentAuthorYedrimas
    • CommentTimeMay 26th 2017 edited
     
    Well, what I can see is there are conflicts inside the scripts.

    First why it's only applied once?


    Process in CarHandler has those lines
    train.getCarMatrix(0, trainMatrix);
    sco.setMatrix(trainMatrix);


    Which means each frame the object gets the matrix of the train, and the matrix contains the position, scale and rotation.

    But if there is an action :

    handler.getSco().getRotation(objectRotation);
    handler.getSco().setRotation(objectRotation.x, objectRotation.y, (objectRotation.z - .1f));


    Which means the model will get a rotation, but next frame it will get back to the rotation of the train before being rotated once more by the code and so on.
    This is why it's only working once, it keeps going between the roation of the train and the custom one.

    Also, this is the reason why it gets reset, right after the currentTime is greater then the endTime, the custom rotation is not applied anymore, leaving the object only with the matrix of the train.


    The core problem is that you're using only one object to handle both rotation and position.
    Try to use different levels in your model, the top one will get the matrix of the train, and the child the custom rotation.
    •  
      CommentAuthorrcth
    • CommentTimeMay 27th 2017 edited
     
    Thank you for your help Yedrimas. I did not know that the setMatrix method also applies the rotation. I made some changes to the code and it it almost working. NL2 somehow doesn't really like multiple init rotations on a matrix, only one at a time. So if I apply matrix.initXRot() it works, but if I also apply initYRot() and initZRot(), nothing happens. I can only use one of the three at the same time. The float values (xRot, yRot, zRot) change just fine, I tested that with debug. NL2 just doesn't apply the rotation as I expected it it would. Changes in code below.

    I'm still kind of new to the Matrix/Vector things in NL2 and they aren't very easy.

    CarHandler.nlvm: here. Especially from line 82.
    CarAction.nlvm: here. Especially from line 40.
    • CommentAuthorMrRC
    • CommentTimeMay 27th 2017
     
    A wild guess :

    Maybe in line 46 and 50 from CarAction false >change it > true ??
    •  
      CommentAuthorrcth
    • CommentTimeMay 27th 2017 edited
     
    No, that's not the problem. The true or false was implemented to reduce the amount of required methods. So instead of IncreaseXRotation() and decreaseXRotation() I just have a changeXRotation() method where true represents an increase and false a decrease. As I've said, all values of the float attributes change fine, it's the initX/Y/ZRot() method that doesn't work when I have multiple of them.
    • CommentAuthorMrRC
    • CommentTimeMay 27th 2017
     
    OK sorry it was just a wild guess, i'm not that good in scripting (just a lil bit)
    •  
      CommentAuthorYedrimas
    • CommentTimeMay 27th 2017 edited
     
    The initX/Y/ZRot() methods will modify the matrix so that it only has rotation attributes. (not quite true, but multiplying will only change the rotation targeted)
    If you want to rotate the matrix of the train, you must multiply it with a rotation matrix (created with initX/Y/ZRot()). You can multiply them using trainMatrix.multRight(roationMatrix) or trainMatrix.multLeft(roationMatrix). Note that left and right can produce different results.

    To debug with matrices, if you need to check the values inside the matrix, you can use Tools.matrixToPitchHeadBankPos(/matrixToPitchHeadBankPosScale depending on your needs), see the documentation for more information.

    You should try to store the current custom angle of your car in a variable that will be applied every frame to the matrix of the train, and when you must turn the car, change this variable.

    Posted By: bestdani
    Right hand and left hand multiplication basically controls if the "translate, then rotate" or the "rotate, then translate" case will be done (the same holds for scaling).

    Original post
    •  
      CommentAuthorrcth
    • CommentTimeMay 27th 2017
     
    Thank you, it works now :)
    •  
      CommentAuthorNemesisRider
    • CommentTimeMay 28th 2017 edited
     
    https://gyazo.com/1fae5eee95f49ee32720c385d62388af

    I'm trying to make this screen I made semi-transparent so that it looks more like a "pepper's ghost" type effect than a screen. How could I change the transparency of the screen, or what else could I do to achieve this effect?
    (At the moment it is glowing in part due to the fact the lighting is const and white)
    •  
      CommentAuthornolimiters
    • CommentTimeMay 28th 2017
     
    Maybe with a spot light?? I have no idea if that could work.
    •  
      CommentAuthorbestdani
    • CommentTimeMay 28th 2017
     
    ^^ When I understand you correctly I think changing the source and destination factor for the blending could be what you are looking for:

    (taken from alpha = 0.5 -> constant transparency everywhere)


    (brighter color -> less transparency)
    •  
      CommentAuthorNemesisRider
    • CommentTimeJun 1st 2017 edited
     
    I have an issue with my onboard audio script where, when I am just using the regular nl2park of the park, the onride audio I'm using works OK but when I create an nl2pkg of the same park it stops working. I assume it's because the audio files aren't being referenced properly but I'm not quite sure.



    Here's my code for referencing the files. Any help would be appreciated :)
    •  
      CommentAuthorYedrimas
    • CommentTimeJun 1st 2017 edited
     
    Did you attach the script in the new park ?
    Does it produce an error / warning / anything ?
    Try to add some debugging lines in the console to see what happens (like a System.out.println("something");)

    EDIT : Not quite sure nolimits can read WAV files you should try converting your files to OGG,
    •  
      CommentAuthorNemesisRider
    • CommentTimeJun 1st 2017 edited
     
    NoLimits 2 can read .wav files - I have got the audio working in the regular .nl2park, but like I said when I package it up it stops working.
    It doesn't produce any errors or warnings when I run the nl2pkg.
    It's the essentially the same park, so I assume it will still be attached. I'll try adding in some debugging lines and seeing how the file structure looks in the extracted package.

    EDIT: I just tried extracting the package and it worked fine again? Is this a glitch in NL2 where it can't access music in an nl2pkg?
    •  
      CommentAuthorbestdani
    • CommentTimeJun 1st 2017
     
    ^ I had no issues with this for now. If it cannot read the file, the script should also throw errors at you in the console (probably null pointer exceptions as well as information that the sound file could not be loaded or if present error handling done manually in the script). The message should give you an idea where NL2 is looking for the file and why it cannot load it.
    • CommentAuthorjongscx
    • CommentTimeJun 2nd 2017
     
    Reading through the Telemetry Server documentation, it says that Error Messages will be sent by the server in case of an error.

    Does that include error messages written by System.Err() ?
    •  
      CommentAuthorbestdani
    • CommentTimeJun 2nd 2017 edited
     
    No, that means telemetry server error messages only, here's an example from my own telemetry test tool:

    sending:
    raw: b'4e00070000000300004c'
    header:
    type request data_size
    7 3 0
    type: get coaster count
    receiving:
    raw: b'4e00020000000300104e6f7420696e20706c6179206d6f64654c'
    header:
    type request data_size
    2 3 16
    type: error
    data:
    text Not in play mode
  4.  
    Posted By: bestdaniHi, did you stepped through thetutorial for custom light shows? Then it should be clear that you missed to create a new section in the config file.


    I found it, Thank you!
    Ps. Do you have multi launch script? I can't download it with Steam.
  5.  
    Posted By: MrRCHi Michael,

    U need multi launch or multi move script ?

    Welke van de 2 zoek je ?


    Hi,
    Ik zoek de multilaunch zoals Tempesto van Bush Gardens of Gold Rush! Maar ik kan het niet downloaden via Steam...

    For the ENG speakers: I'm looking for the multi launch like Tempesto of Bush Gardens but I can't download it by Steam...
    •  
      CommentAuthorNemesisRider
    • CommentTimeJun 6th 2017 edited
     
    A question about keyframing in NL2. Is there any reason why Blender's animations look smoother between keyframesr?


    https://gyazo.com/030505df192adf89169630e4e7947d11

    Blender

    https://gyazo.com/624eb39c57d82952d6d7165e65403105

    NoLimits 2

    You can see that the Blender one is a fair bit smoother. Is there any way to replicate this in NL2? I've been following TheCodeMaster's tutorial on how to export and such.
    •  
      CommentAuthorKingRCT3
    • CommentTimeJun 6th 2017 edited
     
    Have you baked each keyframes? NoLimits doesn't make interpretations whereas Blender does.
  6.  
    ^ Nope, this animation was baked to keyframes.
    • CommentAuthorDelay
    • CommentTimeJun 6th 2017
     
    The entire timeline should be filled with keyframes.
  7.  
    ^ It already is, specifically the yellow ones baking to keyframe makes...
    • CommentAuthorDelay
    • CommentTimeJun 7th 2017
     
    Ok? Then I also don't really know what's going on. Because NL2 simply goes from keyframe to keyframe with no smoothing. Filling the timeline with keyframes should be a workaround.
    • CommentAuthorTOGO Fan
    • CommentTimeJun 8th 2017
     
    Why is this error happening? I have the trains right inside the hidden wireframe cars and the train is the correct style and the coaster is named correctly.

    • CommentAuthorMrRC
    • CommentTimeJun 8th 2017 edited
     
    Do u have the train in a sepp directory or in the directory same as the park?
    U have to place the *.dae / *.3ds file in same directory as the park (not in a sub directory within the park directory)

    I hope u understand.
    • CommentAuthorTOGO Fan
    • CommentTimeJun 8th 2017
     
    The train 3ds and dae files are not in a sepp folder. They are in the directory same as the park.
    • CommentAuthorMrRC
    • CommentTimeJun 8th 2017
     
    Maybe its usefull to change the line in the script where its says : "attach_object.nlvm" to "train ???" so u know wich script is the trouble maker.

    Maybe u can change variable RANGE from 3 to 10.
    •  
      CommentAuthorYedrimas
    • CommentTimeJun 8th 2017
     
    Most of the time, it's because the script targets the frozen coaster which has no train. This is why in my script I never use this method to select a coaster.
    • CommentAuthorTOGO Fan
    • CommentTimeJun 8th 2017
     
    What line should I change the range on?

    import com.nolimitscoaster.*;
    import nlvm.math3d.*;
    public class Cars1 extends Script{

    private static final float xOffset = 0;

    private static final float yOffset = 0;

    private static final float zOffset = 0;

    float xOffset_cam1 = 0.0f;

    float yOffset_cam1 = 1.2f;

    float zOffset_cam1 = 0.0f;

    ExternalRideView pov;
    private static final float range = 3.0f;

    private static final int carToAttach = 0;

    private SceneObject sco;private Train train;

    private Vector3f posOut = new Vector3f(0,0,0);

    private Vector3f pitchHeadBankOut = new Vector3f(0,0,0);

    private Matrix4x4f carMatrix = new Matrix4x4f();


    private static final float warpPointRange = 5.0f;



    public bool onInit(){
    sco = sim.getSceneObjectForEntityId(getParentEntityId());
    if (sco == null){
    System.err.println("attach_object.nlvm: This script must be assigned to a scene object.");
    return false;
    }
    TrackPos trackPos = sim.findNearestCoasterTrack(sco.getTranslation(), range);
    if (trackPos == null){
    System.err.println("attach_object.nlvm: No track found within range of " + range + " meters."); This Line I Should Change?
    return false;
    }
    Coaster coaster = trackPos.getCoaster();
    train = coaster.findNearestTrain(sco.getTranslation(), range);
    if (train == null){System.err.println("attach_object.nlvm: No train 1 found within range of " + range + " meters.");
    return false;
    }

    pov = sim.createExternalRideView();
    pov.setEnterWarpPointEnabled(true);
    pov.setLabel("Luge");
    return true;
    }
    Matrix4x4f matrixCamera = new Matrix4x4f();
    public void onNextFrame(float tick){
    train.getCarMatrix(carToAttach, carMatrix);
    Tools.matrixToPitchHeadBankPos(carMatrix, pitchHeadBankOut, posOut);
    Matrix4x4f matrix = new Matrix4x4f();
    matrix.initTrans(xOffset, yOffset, zOffset);
    carMatrix.multRight(matrix);
    Tools.matrixToPitchHeadBankPos(carMatrix, pitchHeadBankOut, posOut);
    sco.setRotation(pitchHeadBankOut);
    sco.setTranslation(posOut);
    matrixCamera.initTrans(xOffset_cam1, yOffset_cam1, zOffset_cam1);
    carMatrix.multRight(matrixCamera);
    pov.setEnterWarpPoint(posOut,(float)warpPointRange);
    //System.out.println(carMatrix.toString());
    pov.setCameraMatrix(carMatrix);
    }
    }
    •  
      CommentAuthornolimiters
    • CommentTimeJun 8th 2017 edited
     
    I believe this line:
    ExternalRideView pov;
    private static final float range = 3.0f;

    change it to 5.0 for example.
    • CommentAuthorTOGO Fan
    • CommentTimeJun 8th 2017 edited
     
    That still does not work. The error now says no trains found in a range of 5 meters. Can i post the package file here for you to take a look at?

    Here is the package for you to look at.

    Link text
    • CommentAuthorMaverick78
    • CommentTimeJun 11th 2017
     
    Does anybody have the multi launch script like Tempesto of BGWB?
    I can't install it on steam.

    Thank you!
    Michael
  8.  
    Hi, I have a question I want to make an Animated video texture that starts and stops with a trigger. How do I do this??

    Thanks
  9.  
    Hi I am having a little problem with my pushercar script.
    the problem is that whenever I load the park an error comes up saying: Error in File 'Scripts\PusherCar.nlvm' in Line 12: Unknown type: Vector3f

    the script:
    import com.nolimitsframework.*;
    import com.nolimitsframework.objects.*;
    import com.nolimitsframework.spline.*;
    import com.nolimitsframework.block.*;

    public class PusherCar extends FrameworkScript {
    public void init() {
    BlockManager cBlockManager = new BlockManager();

    BlockRegularBrake LaunchBrake = new BlockRegularBrake("LaunchBrake");

    TrackSpline CatchCarSpline = new TrackSpline(new Vector3f(-0.095f, 3.625f, 6.81001f) , 61.19f, true, 0.05f);
    IntaminCableLift CableLift = new IntaminCableLift("CatchCar", CatchCarSpline);
    LaunchBrake.addObject(CableLift);

    cBlockManager.setBlock(new BlockRegularStation("Station"));
    cBlockManager.setBlock(LaunchBrake);
    cBlockManager.setBlock(new BlockRegularBrake("fbr"));
    }
    }


    It is for a vekoma lsm coaster like Xpress platform 13 from walibi holland and I really want to make it look as realistic as possible so the pushercar would be really nice if it worked. I also asks if someone thinks there's a better way to do it with out using no limits framework those tips are always welcome. (I watched this tutorial during the scripting)
    •  
      CommentAuthorYedrimas
    • CommentTime2 days ago
     
    Add that at the top of the script.
    import nlvm.math3d.*;
  10.  
    Posted By: YedrimasAdd that at the top of the script.
    import nlvm.math3d.*;


    Thnx, got rid from that error right now