LUA script tutorial

General discussion about Train Simulator, your thoughts, questions, news and views!

Moderator: Moderators

Locked
JackRyan
Been on the forums for a while
Posts: 176
Joined: Tue Mar 19, 2013 2:22 pm

LUA script tutorial

Post by JackRyan »

Hi,

Reading from earlier post in engine driver (the RSC's blog), it seems that now each user can use LUA to make advanced scenarios, but I haven't been able to find a single tutorial on that.
Could someone explain to me how to use this tool? I'm mostly interested in changing weather (example: a scenario starts with foggy weather, after a while starts a light rain, and after another while there is a thunderstorm)

Thanks for the help
DavidVI
Well Established Forum Member
Posts: 897
Joined: Fri Oct 29, 2010 10:30 pm

Re: LUA script tutorial

Post by DavidVI »

I wanted documentation on this also.. but alas..

Why launch a new version with these new features without actually any documentation on how to use them?!
User avatar
AndiS
Very Active Forum Member
Posts: 6207
Joined: Fri Sep 23, 2005 4:43 pm
Location: Jester's cell in ivory tower
Contact:

Re: LUA script tutorial

Post by AndiS »

I think you can do that already without any scripting using the weather pattern blueprint.

See http://www.railsimdownloads.com/wiki/ti ... Blueprints for defining them and http://www.railsimdownloads.com/wiki/ti ... Properties for using them in a scenario.
JackRyan
Been on the forums for a while
Posts: 176
Joined: Tue Mar 19, 2013 2:22 pm

Re: LUA script tutorial

Post by JackRyan »

AndiS wrote:I think you can do that already without any scripting using the weather pattern blueprint.

See http://www.railsimdownloads.com/wiki/ti ... Blueprints for defining them and http://www.railsimdownloads.com/wiki/ti ... Properties for using them in a scenario.
Thanks, but that is useful only for static weather. I need a guide on how to program dynamic weather (something like in sherman hill)
User avatar
malatzoc
Getting the hang of things now
Posts: 76
Joined: Tue Oct 01, 2013 11:42 am

Re: LUA script tutorial

Post by malatzoc »

Search for lua files in scenario folders (sherman hill route surely have some scripted scenarios), those lua files are not compiled so you can read the calls from it. There is a lua call to invoke weather blueprints, also to show messages, and move camera, etc. These capabilities were exist since TS2013.
RudolfJan
Well Established Forum Member
Posts: 523
Joined: Thu Oct 18, 2007 6:40 pm

Re: LUA script tutorial

Post by RudolfJan »

I'm working on a LUA tutorial for scenario's, but it's still a lot of work to test all things I found. I will publish later. Sned me your mauiladdress in a PM if you want a preview or want to help me with testing.
Rudolf

http://www.hollandhiking.nl/trainsimulator
Here you will find the latest version of the Senario Authors Guide, TSW starters Guide, LuaCreator and TSWTools and more ...
Locked

Return to “[TS] General Discussion”