LUA Scripting in Scenarios

Discuss almost anything about RailWorks.

Re: LUA Scripting in Scenarios

Unread postby ozinoz » Wed Feb 11, 2015 10:01 pm

Now that Matt has finally tempted us with the keys to the cookie jar, I couldn't wait for the next rainy day, but chose the next 100F day instead :) I have tried a sample scenerio just to test out the cinematic camera but I am having trouble in getting the frame transitions to work. No matter what time I enter in the frame windows, it always reverts to 0.00 therefore there is no transition between positions. !*hp*!

I must have watched the video a dozen times and I can see nothing different between what Matt was doing and what I have tried. Anybody else experimented with the camera and did you have any trouble?

I am glad we are finally getting somewhere with the guts of TS, which surely means the new superseeded version is just round the corner. *!sad!*

(I am excited (doesn't take much) about weather and destination triggers too) !!*ok*!!

!*cheers*!
ozinoz
 
Posts: 1626
Joined: Fri Feb 20, 2009 1:59 am
Location: Antipodes

Re: LUA Scripting in Scenarios

Unread postby RSMattP » Thu Feb 12, 2015 6:57 am

Can you take a screenshot of what each frame looks like in the fly-out in the top right?

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

Re: LUA Scripting in Scenarios

Unread postby mrennie » Thu Feb 12, 2015 3:50 pm

ozinoz wrote:I must have watched the video a dozen times and I can see nothing different between what Matt was doing and what I have tried. Anybody else experimented with the camera and did you have any trouble?


I used the cinematic camera to do a video of the FEF-3, some time ago, and it worked fine. I had the camera flying around all over the engine - it's much easier than trying to move the '8' camera smoothly with the mouse :D
User avatar
mrennie
 
Posts: 3219
Joined: Wed May 30, 2012 12:22 pm

Re: LUA Scripting in Scenarios

Unread postby ozinoz » Fri Feb 13, 2015 6:49 pm

!*hp*! For some strange reason, I now have 10 secs each in the first 3 control frames of my camera intro, which I was battling with without success before I made my post. I have tried for more than an hour this morning to add times to the next 3 frames without any success. I am sure it is something simple, but it beats me....
screen 1
cam screen1.jpg

Screen 2 now shows a 10 sec transition (which is the generic number I was experimenting with
cam screen2.jpg

the basis of the cinematic intro was a general walk through by the driver from the yard masters office and up into the cab of the loco where it would switch to the cab cam - a simple practical test of the basics from Matt's tutorial (or so I thought...)
Screen 3
cam screen3.jpg


The whole premiss may not work satisfactorily, but it was something I thought worth trying

**!!bow!!**

!*cheers*!
You do not have the required permissions to view the files attached to this post.
ozinoz
 
Posts: 1626
Joined: Fri Feb 20, 2009 1:59 am
Location: Antipodes

Re: LUA Scripting in Scenarios

Unread postby RSMattP » Sat Feb 14, 2015 1:55 pm

One thing worth noting is that when you enter a time, you must make sure you press ENTER after it - don't just click away or something else. Press enter, that will ensure it gets saved.

The time on a frame is the amount of time it will take to get from this frame to the next one, so if frame 1 (the first frame) says 00:10 then it will take 10 seconds to go from frame 1 to frame 2.

The final entry timing is for how long to hover on the final placement until the camera sequence is completed.

If all else fails - package it up and drop it over to me and I will take a look for you - I can't see anything immediately wrong with the screenshots but it might be more clear if I can have a look right at it.

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

Re: LUA Scripting in Scenarios

Unread postby RSMattP » Sun Feb 15, 2015 12:13 pm

Blog Article #10 - Dynamic Weather - now online, that was huge, longest blog post so far but it's great fun to play with!

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

Re: LUA Scripting in Scenarios

Unread postby RSMattP » Sat Feb 21, 2015 4:52 pm

Part 12 is now up, talking about how to get videos playing as part of your scenarios - some really exciting possibilities here!

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

Re: LUA Scripting in Scenarios

Unread postby ozinoz » Tue May 12, 2015 9:52 pm

Thanks Matt for the latest update, even if I am a couple of weeks behind the times. :D

I really want to start using some of this, particularly the camera... I am a sucker for a nice external shot *!lol!*

*!!thnx!!* for the effort in bringing this to us...

!*cheers*!
ozinoz
 
Posts: 1626
Joined: Fri Feb 20, 2009 1:59 am
Location: Antipodes

Re: LUA Scripting in Scenarios

Unread postby ShadowSteel18 » Mon Oct 05, 2015 8:02 pm

Quick question: How hard is scripting a scenarios?
User avatar
ShadowSteel18
 
Posts: 43
Joined: Sun Oct 04, 2015 4:10 pm
Location: Pacific, Missouri

Re: LUA Scripting in Scenarios

Unread postby ozinoz » Thu Oct 08, 2015 4:37 pm

Hi and welcome...
There are several good video tutorials on how to create a simple scenerio. Start simple and move up to some of the more technical stuff as covered here in Matt's thread as you get more experience. There are also some good "hard copy" tutorials if you prefer to read.

In answer, really as easy or as difficult as you choose to make it. Simple scenerio, easy; more complex with more elements obviously a bit harder. Hardest part for me is the testing to make sure the timings are ok, you can end up running the scenerio lots of times till you get what you want...

!*cheers*!
ozinoz
 
Posts: 1626
Joined: Fri Feb 20, 2009 1:59 am
Location: Antipodes

Re: LUA Scripting in Scenarios

Unread postby RudolfJan » Mon Nov 02, 2015 2:55 pm

ShadowSteel18 wrote:Quick question: How hard is scripting a scenarios?

Depends on what you want. You need a basic understanding on programming in general and in LUA specifically. For me the major problem is recovering from stupid mistakes. I am working on a tool to make it easier, but that will still need a lot of time. In between, you may want to read my Scenario Authors Guide Part III, which explains almost everything I know about scenario scripting. You can download it from RWA or from my Google Drive:

https://drive.google.com/open?id=0B5xmS3GoYKV1UjBJeHhIOFlOSzQ
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 ...
RudolfJan
 
Posts: 134
Joined: Sun Jun 28, 2009 1:36 pm
Location: Netherlands

Re: LUA Scripting in Scenarios

Unread postby jalsina » Mon Nov 02, 2015 3:00 pm

Rudolf,
That part III includes all the previous release?
Intel i7-7900K (3.60 GHz) - ASUS Prime Z390A - 32 GB DDR4 RAM 2400 MHz
GPU EVGA GTX-1060 OC 6GB at 1920x1080, 144 Hz - Monitor ASUS VG-248QE
System Windows 11 Pro in WD SSD 500 GB. Games in Inland 1Tb M.2 NVMe PCIe
User avatar
jalsina
 
Posts: 2010
Joined: Sun Jul 05, 2015 8:32 pm

Re: LUA Scripting in Scenarios

Unread postby RudolfJan » Fri Nov 20, 2015 2:02 pm

jalsina wrote:Rudolf,
That part III includes all the previous release?

Yes, but improved of course. I decided to rename it and include it in a series of manuals. A lot more interesting things will happen, so keep watching ...
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 ...
RudolfJan
 
Posts: 134
Joined: Sun Jun 28, 2009 1:36 pm
Location: Netherlands

Re: LUA Scripting in Scenarios

Unread postby jalsina » Fri Nov 20, 2015 5:27 pm

Thanks. Great job you are doing. !!*ok*!!
Intel i7-7900K (3.60 GHz) - ASUS Prime Z390A - 32 GB DDR4 RAM 2400 MHz
GPU EVGA GTX-1060 OC 6GB at 1920x1080, 144 Hz - Monitor ASUS VG-248QE
System Windows 11 Pro in WD SSD 500 GB. Games in Inland 1Tb M.2 NVMe PCIe
User avatar
jalsina
 
Posts: 2010
Joined: Sun Jul 05, 2015 8:32 pm

Previous

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests