lua scripting : How to move incab camera?

Discussion about RailWorks scenario creation.

lua scripting : How to move incab camera?

Unread postby shahar » Fri Jan 09, 2015 1:15 pm

I'm creating scenarios and I want to move the InCab camera (like in the first Academy scenarios).
I have some expirience with programming and lua scripting for TS (all of my knowledge is what is in the lua
scripting manual in this site).
After digging inside the code of the Academy scenarios I think the function that moves the camera is "DeferredEvent".
shahar
 

Re: lua scripting : How to move incab camera?

Unread postby RudolfJan » Sun Feb 01, 2015 8:50 am

You should use this:

Code: Select all
SysCall("CameraManager:ActivateCamera","CamCamera",0)

If you replace 0 by another value, e.g. x, the camera will return to the previous cameraview after x seconds.
\
In the next version of the scripting guide you will find more info on the functions used for the DTG tutorials.
Last edited by RudolfJan on Tue Apr 07, 2015 2:49 pm, edited 1 time in total.
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 : How to move incab camera?

Unread postby OldProf » Sun Feb 01, 2015 12:11 pm

Some time ago, Claudio Musa offered a Camera Cab Position utility that allowed cab (and car) camera positioning as well as the ability to add cameras. This had to be done to each engine or passenger car and could be restored (fairly) easily from a save file, but I'm not sure whether those positions could be saved "permanently" as properties of a piece of rolling stock. In any case, his utility might provide some ideas.
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: 2743
Joined: Wed Sep 09, 2009 10:09 am


Return to Scenario Creation

Who is online

Users browsing this forum: No registered users and 1 guest