Board index Roller Coaster Games NoLimits Coaster 2 NoLimits Coaster 2 Scripting Hard truths about scripting

Hard truths about scripting

Post your Nolimits 2 scripts here! Also any discussion regarding scription for NoLimits Coaster 2 should be placed in this forum

Post January 24th, 2014, 2:46 pm

Posts: 151
Points on hand: 374.00 Points
Location: Virginia, USA
I've been playing around with the scripting trying to get a simple script working for a coaster I'm building, and I'm going to have to crush a few peoples dreams of custom coasters.

Scripting is not for everybody. This is not a simple script setup that can be learned in a few minutes from watching a couple of YouTube videos. It is more in line with object-oriented programming found in C++ or Java.

The fact is, if you don't have a programming background, most of you will not be able to script even the simplest of tasks without a cubic buttload of help and time from someone that knows how to program. Couple that with the fact that the API is not set up for flexibility and each script needs to be tailored to the coaster it is for. Even modifying existing scripts will require a fair amount of knowledge and work.

Simple tasks that don't change the way a coaster works (like the script that attaches objects to trains posted in another thread) can be reused, and can be run in Circuit/Shuttle mode. Coaster affecting actions that require access to the sections, and blocks, require the coaster to be in Scripted mode, and there is no Automatic Block Mode when in Scripted.

What that means to you as a user. Automatic Block Mode (ABM) is the way most of us use NL2. Take this example: In ABM train pulls into a block brake, and if there is a train in the next block it stops, and when the block clears the train moves on automatically. In Scripted Mode, you have to write the script yourself. You have to check the block to see if it is clear. If it isn't you have to turn the brakes on to stop the train, keep polling to see when block is clear, when clear you have to release the brakes, and turn the transport on to move the track. It's like Full Manual Mode but instead of pushing lighted buttons, you have to write a line of code for everything. And you have to do this for the entire coaster. You are handed a coaster and trains, and you do everything else like determine when it's time to send the train out of the station, release/set brakes, switch transfers, set transport direction, turn on/off transports, etc... Everything it takes to get coasters around the track is up to you.

All I need to do in my script is automatically trigger a transfer table twice. Once to move the train to a different track, and once to move the transfer track back into place for the next train. So far I'm at 514 lines of code( probably 100 of that is comments and not actual code) just to get the train to leave the station, go about 100 yards down track to the first block brake and stop. That's one train and the transfer table still hasn't moved in script. I haven't written any code to make it safe to handle multiple trains, yet. I'm guessing another 600-1000 lines of code to make it work properly. So 1000-1500 lines of code to have a coaster that uses a transfer table automatically. I could cut that down a bit if I didn't care about making it handle problems properly, making it safe, or allowing people to run it in Manual mode, but it would be still be several hundred lines at a minimum.

I will admit I don't know everything about it, and I've been wrong a lot lately, but I don't think I missed the solution to this. Some of the functions required can only be used in Scripted Mode, and that mode does nothing for you as far as I can see.

If you are dead set on scripting yourself, go learn to program a language like C++ and Java, then come back and try.
Last edited by BoboMunkee on January 24th, 2014, 2:48 pm, edited 1 time in total.

Post January 24th, 2014, 3:32 pm

Posts: 2113
Points on hand: 2,704.00 Points
Im familiar with java and i would like to use scripting but the words are all cut off in the api..

Post January 24th, 2014, 3:41 pm

Posts: 6184
Points on hand: 483.00 Points
Bank: 19,590.00 Points
You can script and animate my 3ds Habilouis Flower Ferris wheel when you finish the 3ds model?

Post January 24th, 2014, 4:20 pm

Posts: 151
Points on hand: 374.00 Points
Location: Virginia, USA
Originally posted by Kyle Sloane

Im familiar with java and i would like to use scripting but the words are all cut off in the api..


They are just HTML files in your install folder (something like C:\Program Files\NoLimits 2\help\api\index.html) You can read them in a browser.

Post January 24th, 2014, 4:22 pm

Posts: 2113
Points on hand: 2,704.00 Points

Post January 24th, 2014, 5:27 pm

Posts: 41
Points on hand: 1,169.00 Points
I only know SQF Script which is used in the games from Bohemia Interactive for making mods and mission files and I think may be similar to LUA, I don't even know where to start with NL2, over time I will try with NL2 but knowing how slow on the uptake I can be, NL3 might be out before I finally crack it

Post January 24th, 2014, 6:12 pm

Posts: 151
Points on hand: 374.00 Points
Location: Virginia, USA
Originally posted by Postal

I only know SQF Script which is used in the games from Bohemia Interactive for making mods and mission files and I think may be similar to LUA, I don't even know where to start with NL2, over time I will try with NL2 but knowing how slow on the uptake I can be, NL3 might be out before I finally crack it


If you have used that a bit, the basics are in place for you. NL2 scripting will have you doing the same type of things. The complexity in dealing with the differing objects in NL2 like trains, sections, etc.. is where you may have trouble.

I plan on clearly documenting my scripts and clearly labeling which of my coasters use custom scripts so if somebody wants to see them they are easily findable and the code is easily readable.

Post January 24th, 2014, 10:12 pm
Mikey User avatar
Site Admin
Site Admin

Posts: 1598
Points on hand: 6,049.50 Points
Location: Houston, Texas

It would seem that coding operations in NL2 require more lines of code then a real ride might have.
Image

Post March 23rd, 2014, 3:26 am

Posts: 516
Points on hand: 1,676.00 Points
Location: Vancouver, WA
Well damn, I guess I'm stuck with the default scripts. I know some basic XHTML and that's about it. It is a great feature. I think some of these AAA video game developers need to look at how to transition game 1 to game 2. NL2 is night and day to NL1.
Do Not Look At My Hard Hat Threads I Am Not Advertising My Rides In My Posts' So Please Don't Look At My (insert Coaster name here) It's Not In The Hard Hat Area

Post November 10th, 2015, 7:29 pm

Posts: 6184
Points on hand: 483.00 Points
Bank: 19,590.00 Points
Speaking of scripting,

NL2 really needs more than 2 scripted Ferris wheels and about a dozen very high detail scripted flat rides that are available for anyone to use. I have made far more support made ferris wheels than people have scripted or animated since NL2 released.

ferris wheel.jpg


I think Themepark Studio has way way more fan made flat rides so far. That game is suppose to have a very easy to use system for making animated rides. Not scripting. I believe the need for scripting to animate objects is SEVERELY limiting the amount of people who can make animated flat rides. I know that the keyframe animation thing is new but has anyone even used it yet and released a object or a flat ride that they have animated? If you could only convert a support and free node made object into a file that blender could use, or that could be scripted to animate, than people might could make more flat rides easier. There has really got to be a easier and more user friendly way to make flat rides.

Post November 10th, 2015, 7:42 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7307
Points on hand: 738.00 Points
Bank: 111,265.11 Points
holy bump.
cool5, while I agree with you, at this point, nothing will change. This is how the game handles stuff and in order to maintain the integrity and overall stabilization of the game, no way will this change. The scripting engine is just a way to get features you want early, it doesn't mean it has to be quick and easy, just a way until the dev's do it themselves.

Post November 10th, 2015, 7:59 pm

Posts: 6184
Points on hand: 483.00 Points
Bank: 19,590.00 Points
Can there be a alternate much easier way to make flat ride and animate them like in themepark studio? I think the keyframe animation is trying to fulfill that.

Post November 10th, 2015, 8:44 pm
Metazoanhaddock User avatar
Moderator
Moderator

Posts: 1758
Points on hand: 3,307.00 Points
Bank: 52,337.00 Points
Location: Seattle, Washington
nope
Head Moderator
Director, Structural Engineer - PEAK Amusements
Site Contest Judge (Supporting)
Chatroom Admin

Post November 12th, 2015, 11:54 am
herman116 User avatar
Premium Member
Premium Member

Posts: 636
Points on hand: 7,471.00 Points
Location: The Netherlands
I actually like the scripting part of NL2. I think it's kind of like how it's more difficult to build a coaster in NoLimits than it is to build a coaster in Rollercoaster Tycoon. But with NoLimits your coaster will be better (if you're good at it).

It's not easy to script things in NoLimits but if you can script things you'll be able to do much more than you could do with Themepark Studio.

Post November 12th, 2015, 12:03 pm

Posts: 2035
Points on hand: 15,383.90 Points
Location: The Consortium
cool5 wrote:
I think the keyframe animation is trying to fulfill that.

You'd still need scripting if you want to actually enter the flat ride.

Post November 12th, 2015, 12:06 pm

Posts: 6184
Points on hand: 483.00 Points
Bank: 19,590.00 Points
I have not seem any flat rides made with the keyframe animation yet that I know of.

Post November 12th, 2015, 2:15 pm
TTD03 User avatar
True Addicts
True Addicts

Posts: 7307
Points on hand: 738.00 Points
Bank: 111,265.11 Points
cool5 wrote:
Can there be a alternate much easier way to make flat ride and animate them like in themepark studio? I think the keyframe animation is trying to fulfill that.

No, the way NL2 is designed, whether or like it or not, this is the way it is. The reason NL is such high quality, is because of the complexity. If you had a flat ride creator like in theme park studio, you will get themepark studio quality rides in NL. Is that what you want? I sure don't.

Post November 12th, 2015, 2:22 pm

Posts: 6184
Points on hand: 483.00 Points
Bank: 19,590.00 Points
I just want a themepark studio way or something similar to make NL2 quality rides. You would have the option of choosing the regular scripting and keyframe animation way or this much easier way. Both would still make NL2 quality rides.


Return to NoLimits Coaster 2 Scripting

 


  • Related topics
    Replies
    Views
    Last post