Board index Roller Coaster Games NoLimits Coaster 2 NoLimits Coaster 2 Scripting Pause a running simulation

Pause a running simulation

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

Post April 11th, 2018, 12:44 pm

Posts: 2
Points on hand: 319.00 Points
Hi all,

I'm new to the forums but I've already seen that there's a lot of knowledge about scripting in NoLimits 2. I hope someone can help me with a script I'm working on.

Does anyone know a way to pause a running simulation through a script? Say I would like to pause the simulation after a simulation time of 5 seconds and when I press P to unpause, the simulation continues.

I tried some random codes such as "sim.pause();", "sim.Pause_ON;" etc., but was not able to find a working code to pause the simulation...

Could someone please help?

Regards,

Frank

Post April 25th, 2018, 12:32 pm
herman116 User avatar
Premium Member
Premium Member

Posts: 636
Points on hand: 7,471.00 Points
Location: The Netherlands
Hey Frank,

I can't find a function like that in the scripting API. Could you maybe tell why you wan't the simulation to pause after 5 seconds? Maybe I could help with finding another solution to your problem.

Post April 29th, 2018, 1:49 pm

Posts: 2
Points on hand: 319.00 Points
Hi Herman,

Thanks for the reply :)

I would like to copy some output data from the NoLimits window to Excel. As the window in NoLimits can only contain a limited amount of characters, I'm looking for a way to pause the simulation automatically after a set amount of time or simulated frames.

I haven't found a way to write data to a ".txt" file or something similar, that would be even more convenient...

Do you know any work around for this?

Thanks :)

Post April 30th, 2018, 12:05 pm
herman116 User avatar
Premium Member
Premium Member

Posts: 636
Points on hand: 7,471.00 Points
Location: The Netherlands
Too bad it's not possible to write data out of no limits by script. This is probably done so that a coaster can't have a script which writes a computer virus to anyone who's playing the coaster.

As far as I can see there are three options that you could try:

Option 1: Try to skip some of the data. For example instead of printing the data every frame, print it only once every ten frames. This way you'll have more time before the NoLimits window runs out of characters.

Option 2: Create a huge array of strings. Write the data of every frame into a new string from the array. Create some code so that when you press the action button in nolimits it will print the first 100 strings. Now you can copy these into excel and press the action button another time to get the next 100 strings. etc...

I don't know if there's a limit for the amount of strings though...

Option 3: The telemetry server can pause and unpause the game. I haven't really used the telemetry sever myself but it looks like you could create a program in a language you like and communicate with the telemetry server.

For example after a quick google search I've found that you could use a dot net language (C#, VisualBasic, VisualC++) link. But I'm sure that this will also be doable in other languages.

With your own program you could easily create a button that will sent a unpause message to the game and sent a pause message 5 seconds later.

I think this option might be the best but it's also probably the most difficult one if you're not that good in other programming languages!

Post May 2nd, 2018, 5:58 am

Posts: 1
Points on hand: 66.00 Points
Thanks a lot for the reply!

Skipping some data is probablt the easiest solution and is great when testing a coaster without losing too much accuracy.

Option 2 sounds interesting, I will try that out :D

I think option 3 is the best also. I havent heard of telemetry before. I will try that, if I can get it to work, it would be the most user friendly.

I'll let you know when I manage to write a working code.

Thanks again!


Return to NoLimits Coaster 2 Scripting