Page 1 of 1
Found some new scripting commands for developers...
Posted: Tue Jun 23, 2015 11:52 pm
by chrisell
So I was poking around today and I found these undocumented calls in the latest game code :
GetWiperValue
SetWiperValue
GetControlTargetValue
SetControlTargetValue
GetControlMaximum
GetControlMinimum
I presume these are called using the standard set/get functions. For example:
Code: Select all
Call( "*:GetControlTargetValue", "Regulator", 0 )
GetWiperValue and SetWiperValue seem pretty obvious - you can force the wipers to any point in their animation using those. GetControlMaximum and GetControl Minimum report back the max and min values from the blueprint.
GetControlTargetValue and SetControlTargetValue are curious - I've not figured these out yet. For example Call( "*:GetControlTargetValue", "Regulator", 0 ) always returns 0 for the cab you're in and -1 for any other cab in the train.
If anyone else wants to poke around and add comments to this thread, I'm sure we'd all be interested to learn something new.
Re: Found some new scripting commands for developers...
Posted: Wed Jun 24, 2015 8:05 am
by DaveDewhurst
All but the "Target" functions are listed and explained in the Dev Doc recently released.
Dave
Re: Found some new scripting commands for developers...
Posted: Wed Jun 24, 2015 9:36 am
by trainsmit
DaveDewhurst wrote:All but the "Target" functions are listed and explained in the Dev Doc recently released.
Dave
Where?
Re: Found some new scripting commands for developers...
Posted: Wed Jun 24, 2015 10:32 am
by DaveDewhurst
trainsmit wrote:DaveDewhurst wrote:All but the "Target" functions are listed and explained in the Dev Doc recently released.
Dave
Where?
SteamApps\common\Railworks\dev\Docs\HOWTOUSE_TSEngineScripts.pdf
appeared at v50.5a
Dave
Re: Found some new scripting commands for developers...
Posted: Wed Jun 24, 2015 11:45 am
by tnleeuw01
I believe the ControlTarget functions started to appear in build 51.2 as part of what is needed for better support for external controllers? Perhaps the threads for releases 51.2 and 51.6 offer any extra information on these, or the threads on the raildriver / TS helper apps (from CobraOne & Havner) ?
What happens if you call SetControlTargetValue for the regulator for instance -- does that move the regulator to said target value?
--Tim
Re: Found some new scripting commands for developers...
Posted: Wed Jun 24, 2015 1:07 pm
by chrisell
tnleeuw01 wrote:I believe the ControlTarget functions started to appear in build 51.2 as part of what is needed for better support for external controllers? Perhaps the threads for releases 51.2 and 51.6 offer any extra information on these, or the threads on the raildriver / TS helper apps (from CobraOne & Havner) ?
What happens if you call SetControlTargetValue for the regulator for instance -- does that move the regulator to said target value?
--Tim
No - I tried that thinking exactly the same thought, but it doesn't seem to do anything (of course, without documentation, it's 100% plausible I'm not using it right)
Re: Found some new scripting commands for developers...
Posted: Wed Jun 24, 2015 1:07 pm
by chrisell
DaveDewhurst wrote:All but the "Target" functions are listed and explained in the Dev Doc recently released.
Dave
I must have spaced that - I looked through there and didn't see any of them.
Re: Found some new scripting commands for developers...
Posted: Thu Jun 25, 2015 9:41 am
by MaikG
The SetTargetValue seems not to work on most control values. It is more for changes that TS is doing over time (lerp, slerp or something like it) for some values like the Startup control. With the direct target call you will set these controls to a value without going over time, but on my tests it wasn't working at all.
With the wiper ones you can control the raindrop stuff from script without binding it to a animation id. But there is no need for it to use because it works fine with animation even when you move them by a control manually.