I'm hoping someone can advise me how to write a snippet of lua script that will force the sim to change to cabview? I want to include that in the relevant sections of the AWS script to throw me into the cabview the moment there is an AWS warning, in the same way that the sim forces cabview when entering a tunnel. I do tend to stray from the driver's seat at the wrong moments!
Many thanks
Scripting camera.
Moderator: Moderators
-
SammytheShunter
- Getting the hang of things now
- Posts: 99
- Joined: Sun Jan 02, 2011 1:47 pm
- DaveDewhurst
- Very Active Forum Member
- Posts: 1994
- Joined: Wed Nov 28, 2007 10:21 am
- Location: Birkenhead
- Contact:
Re: Scripting camera.
Somebody will correct me if I'm wrong but I was under the impression you can only control the camera with the scenario script, ie to make the flybys.
Pretty useless when AWS/DSD wirning can occur at any given time
Dave
Pretty useless when AWS/DSD wirning can occur at any given time
Dave
Re: Scripting camera.
SammytheShunter wrote:I'm hoping someone can advise me how to write a snippet of lua script that will force the sim to change to cabview? I want to include that in the relevant sections of the AWS script to throw me into the cabview the moment there is an AWS warning, in the same way that the sim forces cabview when entering a tunnel. I do tend to stray from the driver's seat at the wrong moments!
Many thanks
Hi,
You can use this SysCall:
Code: Select all
SysCall("CameraManager:ActivateCamera", "CabCamera", 0)Regards,
--
nschichan
nschichan
Re: Scripting camera.
Before the "toy train" interface came, the AWS and other warings are displayed on screen with a yellow backgrounded exclamation mark icon... but that have been removed, now only the toy train interface have something like that...
There is a better workaround for this:
These constants are need to be included at the start of the script
And this call creates a message box.
The number 60 is probably the timeout of the message, but the user can close it earier by clicking on X.
There is a better workaround for this:
These constants are need to be included at the start of the script
Code: Select all
MSG_TOP = 1
MSG_VCENTRE = 2
MSG_BOTTOM = 4
MSG_LEFT = 8
MSG_CENTRE = 16
MSG_RIGHT = 32
MSG_SMALL = 0
MSG_REG = 1
MSG_LRG = 2
Code: Select all
SysCall ( "ScenarioManager:ShowInfoMessageExt", "header text", "message text", 60, MSG_LEFT + MSG_TOP, MSG_SMALL, 0 );- DaveDewhurst
- Very Active Forum Member
- Posts: 1994
- Joined: Wed Nov 28, 2007 10:21 am
- Location: Birkenhead
- Contact:
-
SammytheShunter
- Getting the hang of things now
- Posts: 99
- Joined: Sun Jan 02, 2011 1:47 pm
Re: Scripting camera.
Thank you so much, guys. I've just tried both those syscall statements and both work brilliantly. After a long time hunting for one solution I now have two to choose from.
- Irishrailguy
- Very Active Forum Member
- Posts: 1338
- Joined: Sun Mar 21, 2010 8:58 pm
- Location: Dublin, Ireland
Re: Scripting camera.
This is great! I'll have to use that in my electrostar...
Just out of curiosity, what other system calls are there which work in the engine script? If this particular call is that useful I'd imagine there would be many other useful ones too...
Kev
Just out of curiosity, what other system calls are there which work in the engine script? If this particular call is that useful I'd imagine there would be many other useful ones too...
Kev