LUA Scripting in Scenarios

Discuss almost anything about RailWorks.

LUA Scripting in Scenarios

Unread postby RSMattP » Sat Feb 07, 2015 11:57 am

Hi all,

(posting this as me, not as a Dovetail employee - just to be clear, this isn't a Dovetail effort but something i'm doing personaly in my spare time :) )

Just wanted to pop in and let everyone know that i've started a new blog that will be covering various more technical topics about content creation in TS2015 - starting with using LUA scripts in Scenarios to get things like Cinematic Cameras, HTML pop-ups, audio, video, weather and so forth working.

5 articles are up so far and the intention is to add to it every day.

I also did a full segment on my Twitch show on this subject that goes through a lot of it relatively quickly (the blog is taking a much more in depth look at each topic) - but there's plenty in the video to get the grasp of how it all hangs together and what is possible.

The blog is at: http://trainsimlive.blogspot.co.uk

The YouTube recording of the segment is here: https://www.youtube.com/watch?v=1RcO_og8q7M

Lastly, if you want to check in on my Twitch show - Train Sim Live - which usually runs 21:30GMT every weekday night you can find it at : http://twitch.tv/mattpeddlesden - usually it's just running a variety of scenarios and stock but I'm aiming to get tutorials covered too, there are already a number of them (all recordings are stored on YouTube so it's all there if you want to check it out later).

Feedback welcome!

Apologies for the intrusion!

Matt.
RSMattP
 
Posts: 49
Joined: Sun Dec 09, 2012 7:18 pm

Re: LUA Scripting in Scenarios

Unread postby wacampbell » Sat Feb 07, 2015 12:15 pm

No intrusion Matt!

Info from the insiders is gold. I'll be following your posts with great interest - much appreciated!
Wayne Campbell
wacampbell
 
Posts: 509
Joined: Tue Sep 27, 2011 12:45 pm
Location: BC, Canada

Re: LUA Scripting in Scenarios

Unread postby mrennie » Sat Feb 07, 2015 12:45 pm

Very well done Matt!
User avatar
mrennie
 
Posts: 3219
Joined: Wed May 30, 2012 12:22 pm

Re: LUA Scripting in Scenarios

Unread postby BillS » Sat Feb 07, 2015 3:37 pm

As far as I'm concerned, Matt, you certainly are not intruding. I certainly appreciate your efforts. I've been interested in using Lua Scripting and Cinematic Cameras. I have read tutorials, from others, and appreciate their efforts, but hearing another viewpoint never hurt and will help me get "confident" to use these great tools. Thanks!

BillS
BillS
 
Posts: 649
Joined: Wed Jul 17, 2013 1:57 pm
Location: Ontario, OH (summer), Ocala, FL (winter)

Re: LUA Scripting in Scenarios

Unread postby harryadkins » Sat Feb 07, 2015 8:52 pm

Thanks for sharing Matt. I just read through and it's very informative. Hope to try it out soon.

Harry
User avatar
harryadkins
 
Posts: 3091
Joined: Sun Aug 23, 2009 8:01 am
Location: South Carolina, USA

Re: LUA Scripting in Scenarios

Unread postby OldProf » Sat Feb 07, 2015 10:08 pm

Many, many thanks, Matt!
Tom Pallen (Old Prof)

{Win 10 Home 64-bit; Intel Core i7 6700 @ 3.40GHz; 16.0GB Single-Channel @ 1063 MHz (15-15-15-364); 2047MB NVIDIA GeForce GTX 960}
User avatar
OldProf
 
Posts: 2755
Joined: Wed Sep 09, 2009 10:09 am

Re: LUA Scripting in Scenarios

Unread postby BNSFdude » Sun Feb 08, 2015 1:04 am

Wish there was more of you at the towers, Matt. You get it.
Anthony Wood
Audio Engineer - Searchlight Simulations
User avatar
BNSFdude
 
Posts: 2722
Joined: Tue Nov 29, 2011 1:46 am

Re: LUA Scripting in Scenarios

Unread postby RSMattP » Sun Feb 08, 2015 7:03 am

Thanks for the great feedback, much appreciated!

I've just posted article 6 - how to get the player speed and possible uses for that.

Cheers!
Matt.
RSMattP
 
Posts: 49
Joined: Sun Dec 09, 2012 7:18 pm

Re: LUA Scripting in Scenarios

Unread postby GreatNortherner » Sun Feb 08, 2015 7:10 am

Hi Matt,

Thank you so much for sharing this information with the community. This blog will be very helpful for scenario builders, I hope many will make use of the great possibilities that LUA seems to open up in the scenario editor.

Cheers!
Michael
User avatar
GreatNortherner
 
Posts: 1586
Joined: Sun Feb 15, 2009 11:19 am
Location: Czech Republic

Re: LUA Scripting in Scenarios

Unread postby jwtheiv » Sun Feb 08, 2015 8:32 am

More information - especially written clearly and plainly - is always useful for scenario writing. Thanks for the write-up Matt - this looks to be a solid resource.

Josh
My Train Simulator Workshop
Occasional repaints located on RWA
User avatar
jwtheiv
 
Posts: 496
Joined: Mon Jul 23, 2012 10:46 am
Location: Baltimore, MD

Re: LUA Scripting in Scenarios

Unread postby PapaXpress » Sun Feb 08, 2015 1:28 pm

I will be using the _G[] syntax to simplify parts of my LUA for the GP40.

Fewer lines of code == better maintainability. !!*ok*!!

Thanks Matt!
Image
"Just post some random unrelated text. We have members here who can help you with that." ~ Chacal
"When all else fails, read the instructions... if that doesn't work either, try following them." ~ Old Prof
Image
The Grade Crossing - Atlanta North Project - Virtual Rail Creations
User avatar
PapaXpress
 
Posts: 5147
Joined: Sat Oct 23, 2010 10:30 pm
Location: that "other" timezone

Re: LUA Scripting in Scenarios

Unread postby RSMattP » Mon Feb 09, 2015 11:17 am

Just added a new article about getting and setting loco controllers - with a few gameplay examples that combine some of the previous topics as well.

Thanks for all the feedback, very useful!

Mat.
RSMattP
 
Posts: 49
Joined: Sun Dec 09, 2012 7:18 pm

Re: LUA Scripting in Scenarios

Unread postby wacampbell » Mon Feb 09, 2015 11:54 am

That 'Control List' dialog will sure be helpful. I am learning a lot - thanks.
Wayne Campbell
wacampbell
 
Posts: 509
Joined: Tue Sep 27, 2011 12:45 pm
Location: BC, Canada

Re: LUA Scripting in Scenarios

Unread postby RSMattP » Wed Feb 11, 2015 4:49 am

New articles posted:

7 - Interfacing with loco controls
8 - Locking and unlocking the player controls
9 - Ending the scenario early

Coming up:

10 - Weather
11 - Audio
12 - Video
13 - Is the loco at a location

If anyone has any thoughts on other topics to cover then please let me know and i'll see what i can sort out!

Matt.
RSMattP
 
Posts: 49
Joined: Sun Dec 09, 2012 7:18 pm

Re: LUA Scripting in Scenarios

Unread postby Chacal » Wed Feb 11, 2015 12:43 pm

This is just awesome. Next rainy day is all planned.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6462
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests