Not signed in (Sign In)

Discussion Tag Cloud

Categories

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

  1.  
    OK you might have to explain this to me like im five, if its even possible...

    On the infamous Scourge, there is a scripted storage shutter that opens when you move the transfer track, is it possible to have a sound play when the transfer track is moving???

    Basically i want to have an alarm sound that plays when it is in motion.
    •  
      CommentAuthorrcth
    • CommentTimeJul 9th 2016
     
    Like this, but than a sound instead of a moving shutter?
  2.  
    yes, exactly like that
    •  
      CommentAuthorrcth
    • CommentTimeJul 9th 2016
     
    Well, you need to be prepared to create a custom block script if you want to do that.

    What to do: Define the switch and with the .getSwitchDirection() function, you'll know where the switch is (or -1 for moving). The big shutter in that video is down when the transfer track is at position 0, but every other position (including -1), it's open. And instead of the shutter, you can just use code for a sound.
    •  
      CommentAuthorTijjer
    • CommentTimeJul 10th 2016
     
    Two questions about scripting. One is what tutorials are recommended for learning scripting and two is it possible to create a script in which you add a trigger and say in the sim when car 1 goes over it the script will get info on its speed, location, etc and dump the forces into the message box?
    • CommentAuthoriHack97
    • CommentTimeJul 10th 2016
     
    is it possible to use other buttons instead of button that are written in the field summary to trigger a script ?
    •  
      CommentAuthorrcth
    • CommentTimeJul 10th 2016
     
    ^^ I would recommend learning Java first, as the NL2 scripting engine is based on that. I don't think you can get forces out of scripts, but speed is possible.
  3.  
    Ok another question, i currently have the sound of the b&m station sensors (the clicking sound) set up to play as a train comes into the station, problem is the sound radius is very small, its loud in the center of the station but quiet at either end of the station, ive messed around with the setGain value but it dosent seem to change no matter what value i put on it (have tried 1 - 1000 lol) is there something im missing?
    •  
      CommentAuthorrcth
    • CommentTimeJul 11th 2016
     
    I don't believe you missed anything. It has to due with the 'sound' value in one's NoLimits settings. That's my problem with onboard audio at the moment: increasing the sound setting also increases the sound of trains running the track.
    • CommentAuthorMrRC
    • CommentTimeJul 11th 2016 edited
     
    If u have an audio program , like for example Moviemaker, u can increase the level of sound , save it and overwrite the old version of your soundtrack and u good to go.
    Don't forget to convert it to *.ogg.
  4.  
    yeah its not the volume that's the problem but rather the radius of the sound itself
    •  
      CommentAuthorbaadrix
    • CommentTimeJul 11th 2016
     
    I'm no scripting expert, but using this line always works for me:

    sound.setDistanceParameters(10.0f, 15.0f);
    The first value is the radius in which you can hear the sound, the second value is how fast it gets quieter outside the radius. Maybe it's worth a shot.
    •  
      CommentAuthorelement 115
    • CommentTimeJul 11th 2016 edited
     
    hmmm thats strange, my script dosent have that.

    Sound

    import com.nolimitscoaster.*;

    public class sound extends Script {
    private static final String sCoastername = "WaveRunner";
    Coaster cMyCoaster;

    public bool onInit() {
    cMyCoaster = sim.getCoaster(sCoastername);
    TrackTrigger tTrainLeaveStationTrigger = cMyCoaster.getTrackTrigger("Click01");

    if(tTrainLeaveStationTrigger == null) {
    System.err.println("Trigger not found");
    return false;
    }

    TrackTriggerListener tTriggerListener = new soundTrigger();
    tTrainLeaveStationTrigger.addTrackTriggerListener(tTriggerListener);

    return true;
    }
    }



    Sound Trigger

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

    public class soundTrigger extends Script implements TrackTriggerListener {
    private static final String sSoundFile = "Station Click.ogg";
    StaticSound sSound;

    public soundTrigger() {
    sSound = StaticSound.loadFromFile(sSoundFile, 0);
    if(sSound == null) {
    System.err.println("Sound file not found");
    return;
    }
    sSound.setEnvironmentMode(StaticSound.E_ENVMODE_LOCAL);
    sSound.setPosition(new Vector3f(-10.49f, 14.64f, -12.0f));
    sSound.setGain(1.0f);
    }

    public void onTrainEntering(TrackTrigger trigger, Train train) {
    sSound.play();
    }

    public void onTrainLeaving(TrackTrigger trigger, Train train) {
    }
    }
    •  
      CommentAuthorbaadrix
    • CommentTimeJul 11th 2016 edited
     
    Try to add that line before the setGain method and play around with those values. You probably want to have a high roll-off factor since the clicking shouldn't be heard outside your station I guess.
    • CommentAuthorMrRC
    • CommentTimeJul 11th 2016
     
    Is it possible to make a mirror , so the object does reflect what comes along , u know what i mean.
  5.  
    ^^ Thanks! that fixed it.
    •  
      CommentAuthorbestdani
    • CommentTimeJul 11th 2016 edited
     
    ^^ Yes you can fake reflections to some extent. That is not related to scripting but anyway: You can take a cube map screenshot with the professional version and insert this custom cube map inside the faked reflection tab of the NL2 Mat Editor.

    (And in some special situations you could even fake a mirror by mirroring the 3d object / coaster and putting a semi transparent wall also with some special material effects between the original and the mirrored version).
  6.  
    Im trying to do premier rides style launch, how would I go about doing this?
    I also have no background knowledge of ride scripting but I know a lot about python

    https://gyazo.com/b6a2779c5d1c541115540c0d29a77c56

    I also need to bypass the breaks in the station so it wont slow the train down every time it enters the station but only at the end of the ride
    • CommentAuthorMrRC
    • CommentTimeJul 16th 2016
     
    @DiamondBayonet.

    U can set the brakes in the station to multi pass instead of single pass.
    I hope that will do the trick.
    •  
      CommentAuthorbestdani
    • CommentTimeJul 16th 2016
     
    ^^ I made a multi launch script for such purposes (steam workshop link), you can study the script to see how I did this. There might be quicker approaches for a specific coaster script but I tried to make a general purpose script.

    I think NLVM scripts in general and especially my rather short multi launch script should be understandable with some python knowledge (I've also added comments) despite the quite different syntax.
  7.  
    So far it launches goes backwards then when it goes back to the launch section it Halts in the station and my passes are on 80
    • CommentAuthorloloke
    • CommentTimeJul 17th 2016
     
    hello i am building a swingship and got verry far but now i want a camera at the ship
    and i found the script for simplerideview but i cant get it working to sit in the ship it only go to the axe of the ship
    can someone help me with this ?
    with kind regart loloke
    • CommentAuthorMrRC
    • CommentTimeJul 17th 2016
     
    @ DiamondBayonet

    Maybe this TheCodeMaster tut will help u : https://www.youtube.com/watch?v=saFlh3HBLq4
  8.  
    That was really helpful! Thank you!
    • CommentAuthorDelay
    • CommentTimeJul 17th 2016
     
    Is it possible to script a ride panel that updates in real time?
    • CommentAuthorMrRC
    • CommentTimeJul 17th 2016
     
    @ DiamondBayonet

    Good luck with your project.
  9.  
    It isnt much its a halfloop into a flat section and back into a half loop but the concept is cool
    •  
      CommentAuthorVinyworld283
    • CommentTimeJul 18th 2016 edited
     
    Hi! I am making a Intamin accelerator coaster and need also for that a hydraulic launch to make it look realistic. now I've came over this thread: http://forum.nolimits-exchange.com/comments.php?DiscussionID=3479&page=1 but it didn't help me a lot, so can please anyone help with what to do. Also for this do I have to make a seperate model for the catch car and a seperate model for the launch track from the catch car or can I simply just make one model for the whole launch?

    (Please try to explain it easy cuz I started yesterday with learning how to script and english is also my second language so sorry for any annoying mistakes )
    •  
      CommentAuthorVinyworld283
    • CommentTimeJul 18th 2016 edited
     

    Update:



    I found a tutorial from geforcefan his channel and followed it (https://www.youtube.com/watch?v=PuoE9miF2vU) Now I've got the problem that every time I load the park an error tells me that there is something wrong only I don't understand what


    This is the error shown in the console: Error in File 'Scripts\CatchCar.nlvm': An abstract method from a base class or interface is not implemented: public abstract void com.nolimitsframework.FrameworkScript.init()



    This is the script



    import com.nolimitsframework.*;
    import com.nolimitsframework.block.*;
    import com.nolimitsframework.spline.*;
    import com.nolimitsframework.objects.*;

    import nlvm.math3d.*;

    public class CatchCar extends FrameworkScript {
    public void Init() {
    BlockManager cBlockManager = new BlockManager();

    BlockRegularStation Station = new BlockRegularStation("Station");
    TrackSpline CatchCarSpline = new TrackSpline(new Vector3f(10.0f, 1.0f, 10.0f), 200.0f, true, 0.1f);

    IntaminCableLift CableLift = new IntaminCableLift("CatchCar, CC_", CatchCarSpline);
    Station.attachObject(CableLift);

    cBlockManager.setBlock(Station);
    cBlockManager.setBlock(new BlockRegularBrake("Launch1"));
    cBlockManager.setBlock(new BlockRegularBrake("Brake2"));
    cBlockManager.setBlock(new BlockRegularBrake("Brake3"));
    }
    }
    •  
      CommentAuthorbestdani
    • CommentTimeJul 18th 2016 edited
     
    ^ You have to replace the capital 'I' that is marked below with the lower case one:

    public class CatchCar extends FrameworkScript {
    public void Init() { //correct is: public void init() {
    BlockManager cBlockManager = new BlockManager();

    BlockRegularStation Station = new BlockRegularStation("Station");
    TrackSpline CatchCarSpline = new TrackSpline(new Vector3f(10.0f, 1.0f, 10.0f), 200.0f, true, 0.1f);

    IntaminCableLift CableLift = new IntaminCableLift("CatchCar, CC_", CatchCarSpline);
    Station.attachObject(CableLift);

    cBlockManager.setBlock(Station);
    cBlockManager.setBlock(new BlockRegularBrake("Launch1"));
    cBlockManager.setBlock(new BlockRegularBrake("Brake2"));
    cBlockManager.setBlock(new BlockRegularBrake("Brake3"));
    }
    }
    •  
      CommentAuthorVinyworld283
    • CommentTimeJul 18th 2016 edited
     
    Ty! I've done that, and yes the previous error wont come anymore but I now have another error:
    For that error look to my previous post ;-)
    •  
      CommentAuthorbestdani
    • CommentTimeJul 18th 2016
     
    ^ You've posted the same error twice.
  10.  
    owh oops, well it's late for me xD
    • CommentAuthorDelay
    • CommentTimeJul 18th 2016 edited
     
    To me, it is nonsense. This is incredibly encrypted for me. Explanation please?
    •  
      CommentAuthorbestdani
    • CommentTimeJul 19th 2016 edited
     
    What do you expect one explains to you?
    That the scripting engine searches for a method in the script that is called "init" because it is required for a reason which explanation would go beyond this small "trolling back" answer but which it can't find probably because there's a method "Init" present but no method "init" and that it's most likely the case that the capital "i" is just a typo?
    • CommentAuthorDelay
    • CommentTimeJul 19th 2016
     
    ^ Well, "trolling back" is not really it, trolling (in today's internet standards) would be meaner.

    But I meant "What the script is supposed to do in-game (the result of it)"
  11.  
    The script has 2 sections, the upper section is for the hydraulic launch and the lower section is there because the mode of the coaster is on scripted so I have to define all the blocks from the coaster
    • CommentAuthorMrRC
    • CommentTimeJul 21st 2016
     
    Is there a possible way to script , glow in the dark with changing color with trigger ?

    I use NL2MAT to have the "glow in the dark"effect, but only color = White

    Kind regards,
    MrRC (Netherlands)
    •  
      CommentAuthorbestdani
    • CommentTimeJul 21st 2016 edited
     
    Yes you can use the four entity registers (Entity0, ..., Entity3) in the programmable shader instead of the color register to set the glow color. These entity colors can also be changed by a script using the setEntityColor(int slot, nlvm.math3d.Vector4f color) method of the SceneObject or SceneObjectElement class.
    • CommentAuthorMrRC
    • CommentTimeJul 21st 2016
     
    Where can i find an tutorial about your method of changing color ?
    Or can u explain me more about it ?
    •  
      CommentAuthorbestdani
    • CommentTimeJul 21st 2016 edited
     
    Maybe you want to use our (3creativeD's) Effect set. It uses exactly the features I talked about. Integrating own object into the set is rather easy. You can study the LED Par object which is the most basic one and transfer the settings it to your own object. Note that adding a light source is optional, so it also works with anything that uses a entity color in the material, you can even use it to do other things with the changed entity color that has nothing to do with glowing at night at all. We thought about adding a advanced usage tutorial that explains these things in more detail but there's currently too less interest shown to justify the time that would be required for this.
    • CommentAuthorMrRC
    • CommentTimeJul 21st 2016 edited
     
    @ Bestdani.

    Thank u and others for your time, i tried something but it didn't work.
    I'm waiting for the Tutorial before i use to much time.

    Update : I got it working, that was so easy to do. Even it got it attached to the train.

    Very simple use of triggers. The length of the train keeps the LED PAR burning.

    https://www.youtube.com/watch?v=WafGYJr5gEU
    •  
      CommentAuthorRickPlays
    • CommentTimeJul 24th 2016
     
    Hey guys,

    I have made a custom Car for my new watercoaster.

    This coaster includes a vertical elevator (Thanks to Yedrimas. See his topic to Elevator in NoLimits 2 (No Suspended Swinging Coaster)).

    My problem is now that the CCCreator do not work for me because the custom Car will be released from the wireframe car in the elevator.

    Has someone a skript or something else to make a onboard Cam for the custom coaster Car?

    Thanks!
    • CommentAuthorMrRC
    • CommentTimeJul 25th 2016 edited
     
    @ Bestdani,

    EDIT : FOUND IT,
    U can place a 2nd trigger with same name and extended with "off" , then the lightsource will stay on untill train hit 2nd trigger.


    The chosen color of the light source stops after the length of the train has passed the trigger.

    Is it possible to program a kind of timer to keep the light source activated for a longer periode of time ?
    Or use another kind of command in the place where u put the color and trigger ?
    •  
      CommentAuthorbestdani
    • CommentTimeJul 25th 2016 edited
     
    Well it is possible for sure but as you said not without touching the script's program code to implement that special purpose. But isn't it possible in your case to achieve the same by just moving the off trigger farther away?
    (I would prefer to have these questions in the thread of the effect set so that other's who are interested in the same things also find and maybe read them).
    • CommentAuthorMrRC
    • CommentTimeJul 25th 2016
     
    @ Bestdani,

    Sorry i will place the question in the Effect Set thread, for future use for others
    •  
      CommentAuthorRickPlays
    • CommentTimeJul 26th 2016
     
    Can nobody help me? :/
    •  
      CommentAuthorbestdani
    • CommentTimeJul 26th 2016
     
    The very basics of adding custom cameras was discussed few pages ago already (and the discussion that followed about matrices maybe also helps to improve it), I'm very sure the chance to get some help would be much higher if you tried to add that already.
    •  
      CommentAuthorRickPlays
    • CommentTimeJul 26th 2016
     
    Oh sorry. I should read the thread before I ask a question :/
    But I have one thing that I couldn't found: How can I edit the position of the Camera?
    •  
      CommentAuthorbestdani
    • CommentTimeJul 26th 2016 edited
     
    That's what I was referring to as I said the discussion about using matrices that followed. In this post exactly what you're asking now is explained.

    But here's another approach:
    I usually prefer to add dummy scene object elements to my models and for example name it "camera", to use this replace SceneObject with SceneObjectElement in the example script and use sco = sim.getSceneObjectForEntityId(getParentEntityId()).getElementForName("camera"); you can also add sco.setVisible(false); after that line to hide it. Also replace sco.getMatrix() with sco.getAbsoluteMatrix().

    (and you can optionally replace sco by elm for example to stick to meaningful names).