Not signed in (Sign In)

Discussion Tag Cloud


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

    • CommentAuthorMusickid43
    • CommentTimeFeb 22nd 2014 edited
    The Script Generator is intended to create a simple block script for those who do not wish to learn to code.

    Enter each section name and what type they are.
    All blocks must run in order listed.
    All name must NOT contain spaces or other symbols, only numbers and letters.

    FileName is the name of the file where script is saved minus the extension. This Is necessary for the program to find the script when trying to run it.

    There are many different block types that are as follows.

    1. Station - The station DUH! Train enters from the back leaves through the front.
    2. Lift - Lift Hill. Train enters from the back leaves through the front.
    3 and 6. Switch - Can be either merge or fork. Default switch position must be specified.
    4. Switch Brake - Enters from the back, leaves through back. Must come after a switch.
    5. Backwards Brake - Enters from the front, leaves through back, backwards.
    7. Switch Backwards Brake - Enters from front, leaves though front. Must come after a switch.
    Not pictured - Brake - Generic brake. Enters from back leaves through front.
    A trim brake does not need to be listed here as it has no effect on blocks.
    Note that the images do not match.
    When using a Brake that enters backwards, remember to change the brake trigger so it is not at beginning. Otherwise it wont try to stop the train until after it leaves the brake. Since it is backwards, it is similar to saying "End car at end of brake" where there is no brake left to stop it.

    Transports do not need to be specified as they automatically work both ways.
    Transfer table and storage not supported at this time.

    Copy generated script into script file, you can figure out how to do that on your own (it's easy)
    save the file in the park's folder
    Attach script to coaster, should be obvious.
    Change the operation mode to scripted.
    The script is not perfect, but it will help those who don't want to learn how to code, or those wishing to learn.


    A new tab on the generator is for Advanced script generation. This is entirely new code that has even more options and many more possibilities. Each "Block" within the advanced section consists of the block that the train starts at, where it's headed, and any switches in between that need to be set to reach it's destination. This means a train can go through up to 10 (maybe more) different switches before reaching the next block. At the same time a switch can be used by multiple blocks to create complex tracks that should never be available in real life.

    Block Name is the block the train is leaving from
    Block Type is the type of block which can be Station, Brake, Lift, or Storage
    Exit is the direction in which the train will exit when is told to leave
    Next Block is name of the next block that the train will enter into after leaving this one

    For adding what switches to use, type the name into the box next to the "Add Switch" button. The switch then appears in the list above.
    To set what position the switch is in, click on it within the list, and change the number to the right.
    A position of 0 will tell the block to move that switch to the left, 1 to the right, and this can even be set to 2 or higher for transfer tables.
    A -1 will simply say that you don't want that switch to be used and it will be ignored in the code generation.

    More info in a later post as this post is apparently to long to add more here.
    NOTE: when clicking the generate button or saving the file, it will generate either advanced or basic code based on which tab is currently active.

    More Info

    UPDATE 1.0.1
    -Brakes no longer require transports set to launch
    -Complete Stop now works with normal brakes

    UPDATE 1.0.2
    -Complete Stop works with backward brakes
    -Added ability to reorder blocks
    -fixed some bugs

    UPDATE 1.0.3
    -Some switch table support, when used as a reversing section like where normal switches are used.
    -bug fixes

    UPDATE 1.0.4
    -Added ability to save directly to nlvm file
    -Added ability to open saved nlvm (only files created with 1.0.4)

    UPDATE 1.1.0
    -Added Advanced script generation
    • CommentTimeFeb 22nd 2014
    I must say, after having scripted a few reverse coasters for testing in NL2, and going through the thousands of lines of code, this is a magnificent breakthrough in NL2 techniques. This will make scripted coasters accessible to almost anyone in the community and cannot thank you enough for the creation of this generator. I foresee this will be used by many users. Great job and thanks :)
    • CommentTimeFeb 22nd 2014 edited
    That was an AWESOME TOOL!~! I found I can't helping playing this.but there are only two more points can be improved

    One thing I want to know is how to End a script, the tool keeping creating new blocks when name was input into last block
    Another thing is block's order in tool need to be changeable

    For some reason it wont let me generate a script because it thinks I have spaces but there are no spaces what so ever. Do you know what the problem is?

    • CommentAuthorMusickid43
    • CommentTimeFeb 22nd 2014
    The last line is ignored if completely blank. However, there was an error preventing it from ending. I've updated the file, you can download it again and it will work. Reordering blocks will be available in the future.

    This might sound dumb but where do you copy the script to? I've never done anything related to scripting before.

    • CommentTimeFeb 22nd 2014
    create a .txt file by notepad, then copy the script text, rename it into .NLVM
    • CommentAuthorMGrides
    • CommentTimeFeb 22nd 2014
    Thank you. You made my day! I so hoped that someone will do something like THIS. Congratulation! You´ve done it. I also can´t thank you enough for helping out all the non-scripter in the whole community! Thank you very, very much!

    Scripting in NL2 is nothing i wish to continue, but this generator is great! I hope someone will do it for flatrides, too ;) Keep up this awesome work and mind. Thank you for sharing your work!

    Once I do that how do I Open it in NL2?

    • CommentTimeFeb 22nd 2014
    Thank you for making this, I'm going to use this verry much! Now it's much easier for me :) Thanks a lot!
    How do you turn in into a .NLVM just rename the file or what?
    • CommentAuthorRazevil
    • CommentTimeFeb 22nd 2014
    yea take the .txt file you created with your script in it and rename it with .NLVM at the end
    Once you do that how do you find it in the editor?
    • CommentTimeFeb 22nd 2014
    You have to put it in the park directory.
    • CommentAuthorlujach92
    • CommentTimeFeb 22nd 2014 edited
    This tool looks fantastic, especially for someone like me without any experience in scripting, thanks a lot! I hope this tool will be added to the "NL2 Tools" thread to avoid that it gets lost when this thread wents down*.
    *inconspicuous hint towards the mods^^
    This will make it much easier for those who do know how to script as well!
    This will for sure be a huge help! Thanks for this!
    Could someone make step by step instructions on how to use this after the script is generated?
    • CommentAuthorElvenage
    • CommentTimeFeb 23rd 2014 edited
    Does this support dual-stations?

    Also, am I doing something wrong? For the first block, the station, I have the name entered and spelled correctly, and double checked the spelling in the editor, both are named "Station", capital and everything, however, when I run the script for the ride, I get the error where it can't find the block "Station". Literally have no idea what I'm doing wrong lol.
    • CommentAuthorMusickid43
    • CommentTimeFeb 23rd 2014
    Dual stations is not fully supported at this time. The generator assumes a single line continuous circuit with backwards sections available. Just by saying "dual station" that could mean a couple of different things.

    1: Two separate tracks as two complete loops staying separate the entire time as a dueling coaster
    2: Two tracks as a dueling coaster which end on the station opposite that they started
    3: Two stations that merge into one track but split again right before going back into the station
    4: Two stations one one line where the station is one after the other where one is loading and the other is unloading

    2 and 4 will work with the generator as they are still technically one complete circuit as long as the 2 stations have different names.
    1 and 3 will not work with the generator, but actually work without the generator by using NL2s default block mode, no custom scripting needed unless you want to use reverse sections as well.

    For your problem with not finding station, that error appears if there is no block with that name. One problem I've had was where I named the block in NL2, but pressed escape instead of clicking ok, therefore canceling changes accidentally. I'm not sure what would happen if there are multiple blocks with the same name, but should be avoided anyway. My best guess without actually seeing what you did is double check there are no trailing spaces in NL2. It won't find "Station" if it is actually called " Station " with extra spaces. I hope that helps.
    • CommentAuthorElvenage
    • CommentTimeFeb 23rd 2014
    Yes, sorry, I mean #3. I can live without that support for the time being.

    Double checked all my spelling and here's the best info I can offer:

    Ignore the previous errors before the Sim Speed increase. I accidentally had the wrong script in the park directory at first, lol. Swapped it over and produced the same error again.
    • CommentAuthorMusickid43
    • CommentTimeFeb 23rd 2014
    Luckily I've managed to recreate the problem (always a must for debugging). Oddly enough it was fixed when I changed the COASTER NAME to not have spaces. I created a small loop with just a station and a brake and using the generator's script. With a coaster named "Coaster name" it breaks and i get the error you have. But with the name "CoasterName" it works fine. This is new to me as I have not seen this problem before. Looking at your script I see it is called "indoor" which I doubt is the name of the coaster, but try changing the name of the coaster.

    While writing this post I noticed an update to NL2, downloaded that and now I can't reproduce the error. Try updating NL2 and see if that works.
    • CommentAuthorElvenage
    • CommentTimeFeb 23rd 2014
    NL2 is up to date. Checked spelling and spaces in park and ride name(yes, it is called "indoor"). Not a final name, just a placeholder to test out your program.

    Would you like the .nl2pkg to see if you can pinpoint the error?
    • CommentAuthorMusickid43
    • CommentTimeFeb 23rd 2014 edited
    Yes the .nl2pkg would be the most efficient way to test as that's one way to guarantee the error can be reproduced.

    Edit: there were a couple of problems I found with your coaster:
    1: you have 3 brakes (brake1, brake2, brake3) yet the script only references brakes 1 and 2.
    2: The coaster was still set to Closed circuit and was never changed to "Scripted (experimental)" - The main cause of the problem

    other things
    3: The brakes did not have any transport devices on them, so after switching, nothing happened.
    4: there was a 4th brake that is not referenced in the script so it acts like a trim brake
    5: reverse section brakes in my opinion should have the trigger somewhere in the center to make sure the train is completely on the brake before trying to switch.

    I was able to generate a working script by using the following:
    Station Station
    brake1 Brake
    reverse Switch right
    brake2 SwitchBrake
    forward Switch right
    brake3 SwitchBackwardBrake

    I'm not sure how you set up the generator as the script doesn't match the image above. (well you can't have just a single station with nothing else)
    Just remember that every block and every switch needs to be entered so it can actually find the parts when it tries to run the script.
    • CommentAuthorDTrigger05
    • CommentTimeFeb 24th 2014
    Love the work you've done here...but I'm running into a slight error. I believe I've done all the blocking correctly - the coaster runs with no script errors. That said, when it gets to the brake to return to forward motion, the train will stop, switch transfers, and the brakes disengage properly, but the transports on the brake do not engage and the coaster sits. Thoughts?
    • CommentAuthorMusickid43
    • CommentTimeFeb 25th 2014
    Try enabling "Launch" on the brakes, hopefully that works.
    • CommentAuthorDTrigger05
    • CommentTimeFeb 25th 2014
    I do believe that was about the only setting I hadn't tried. Worked like a charm, grazie signore.
    • CommentAuthorMusickid43
    • CommentTimeFeb 25th 2014
    Thanks for pointing that out, I've updated the file so launch is no longer required.
    • CommentAuthorcaptfido87
    • CommentTimeFeb 25th 2014
    Just curious, Does this work only for scripting a coaster or can this be use to make a flat ride move?
    • CommentAuthorTTD03
    • CommentTimeFeb 25th 2014
    Looks to me it is only for a coaster right now, as the set up procedure for generating a script is very strict,
    You have 3 options, Name of block, type of block, and default side for the block (when applicable).
    Theoretically, you could use some generated code to make a flat ride move, but it would require lots of modifying.
    • CommentTimeFeb 25th 2014
    I hope some thing can convert the RCT3 .ovl files into NL2sco……
    • CommentAuthorMusickid43
    • CommentTimeFeb 26th 2014
    Currently there is no plan for adding flat rides to the generator, mainly because I haven't looked into how to script them yet. If I do find a way to generate them effectively then I'll add it, but don't get your hopes up. Although you can expect the coaster script generation to get better as I fix bugs and add features.

    When ever I try to start up a coaster with the generated script this error comes up.

    • CommentAuthorMusickid43
    • CommentTimeFeb 26th 2014
    This happens with an incorrect file name. You named the script Kerchunk but put it in the file MyScrpit.nlvm. Try either Kerchunk in Kerchunk.nlvm or MyScrpit in MyScrpit.nlvm.
    Sincerely... thanks you so much to create this program! Now, I no more stuck with script that auto-delte it self! :D
    Thanks a bunch for this! This came out at the perfect time too. I started getting super frustrated trying to learn the ways of scripting that I've almost given up but now I can use this script generator as a guide. Great work!
    Fixed some bugs, added some stuff. If anybody finds a bug post it here and I will try to fix it.
    Hey Guys,

    Great script it does exactly what I want it to!

    HOWEVER, I'm finding the switch tables dont return to the default position once the train has left the switch brake? This means the next train comes along and cannot proceed into the break to be launched backwards, as the switch table stays in the same place as when the last train left?

    Hope that makes sense.
    • CommentAuthorTTD03
    • CommentTimeMar 5th 2014
    Correct me if I am wrong but I believe you need to set a trigger to make this happen.
    Review the script generated by the generator for more info.
    Or just wait for Musickid43 to respond.
    Thanks TTD03, just looked through the script and cant work out where to place triggers / name them. I'm useless at scripting!
    • CommentTimeMar 5th 2014
    Would you be able to create a script that has a backwards launch on a continuous circuit similar to full throttle with the script generator?
    Posted By: 1bluesheWould you be able to create a script that has a backwards launch on a continuous circuit similar to full throttle with the script generator?

    Yes thats what I've done with it, but returning the switch positions to the default to allow the next train to pass isnt happening at the minute!
    Switch tables are unsupported as of right now. They shouldn't be too hard if you use the generator to make the script by using the switch and brake as the same name as the table, then modify the code where it sets positions. What makes them different from other switches is the normal 2 way switches have a position of 0 for left and 1 for right. Tables use positions 1,2,3, etc but starting with 1. That is where the real change needs to be made to support them, however I have not tested this yet.

    Triggers are not necessary for the generator, in fact they do absolutely nothing other than the normal lock/unlock spinning/swinging. (at least for the generator right now).

    In terms of making something like full throttle with the backwards launch in the middle, not supported. But you can still create a brake with a complete stop of 5 seconds then launch forward, but you don't need the generator for something like that. Again that shouldn't be too hard to modify to get what you want. Use a normal brake, change the script to launch back instead of forward, wait 3 seconds, change to launch forward. Just by looking at what Full throttle is online, I don't even see any switches in it. Am I missing something there?

    There are so many possibilities for what coasters can do, adding all those options in a simple interface is hard to do. Not saying it won't happen, just you can either wait a while or try scripting yourself using the generated script as a starting point and modifying little bits of it.
    ^ Tables also start at position 0 (from the left most position on the table) and increase from there.
    • CommentTimeMar 7th 2014
    I made a small testcoaster like your example above, but the switches don't turn back to their default position when the block is free. How should we be able to let the switches get back?
    Posted By: rcthI made a small testcoaster like your example above, but the switches don't turn back to their default position when the block is free. How should we be able to let the switches get back?

    Exactly my question, would be interesting to find out how ...
    • CommentAuthorMusickid43
    • CommentTimeMar 8th 2014 edited
    If you want help you have to be more specific. Remember these rules: What did you try? What did you get? What did you expect? And when it fails, what did you try to correct it? There are a couple of examples here, so which did you try to build? Did all switches not reset, or only 1? Which switch was it? If you are referring to tables, I remind you that I have not tested them, so simply saying my example doesn't work means nothing as I have not confirmed it is correct. The switches change positions at the code setSwitchDirection(1) with the number being the position to set it to. Change those numbers and see if that works. Maybe it's not that, but referencing the switch itself if it is named wrong. There could be many things wrong with it and I suggest experimenting and try to learn how it works.
    • CommentTimeMar 8th 2014

    I tried this example. I did exactly what you did, but none of the switches return.
    1. Station
    2. Lift
    3. Switch right
    4. SwitchBrake
    5. BackwardsBrake
    6. Switch left
    7. SwitchBackwardsBrake

    Is that what you tried? Again you are not specific enough.
    • CommentTimeMar 8th 2014

    This is all I got.