Page 1 of 4

RSC Class 91 DSD

Posted: Mon Sep 21, 2015 4:32 pm
by 31160
Hello all im writing a scenario using a 91, is there a way to isolate the DSD as there is in the 90 or have you got to press Q all the time

If it makes a difference you are driving the 91 blunt end first using helicopter 1 coupled to a buffer fitted HST PC

Re: RSC Class 91 DSD

Posted: Mon Sep 21, 2015 5:05 pm
by Mr395008
Sadly you have to press Q every minute, this was supposed to be fixed by DTG in an update which they confirmed to me over a year ago however we've yet to see the update....
I've given up on bug fixes from them.

Re: RSC Class 91 DSD

Posted: Mon Sep 21, 2015 5:28 pm
by 31160
Ok thanks for that, its a pity but there you go :D

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 8:16 am
by gptech
Mr395008 wrote:this was supposed to be fixed by DTG in an update which they confirmed to me
Did they confirm they actually had a fix to implement, or confirm that they'd pass your observation on to the development team for them to investigate, and if a solution was found it would then be rolled out as a patch?

I'm sure that in another thread about this it was pointed out that prototypically it can't be disabled, so do we (as a group of simulator fans) want realism or gameplay?

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 8:26 am
by AndyUK
gptech wrote:
Mr395008 wrote:this was supposed to be fixed by DTG in an update which they confirmed to me
.... I'm sure that in another thread about this it was pointed out that prototypically it can't be disabled, so do we (as a group of simulator fans) want realism or gameplay?
There's no reason why both can't be catered for. In other traction, including some by DTG, the vigilance can be isolated whether or not it's prototypical. If you want to play 'real' don't isolate it, if you don't want the bother of responding to it then isolate it. Quite simple really!

Andy L

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 8:37 am
by gptech
I agree Andy, personally I'd want to turn it off as I do spend a lot of time driving from the helicopter view to admire the scenery, but we can't make any judgement based on a single claim that a fix had been promised.


I take it that nobody's had a look at:

Code: Select all

						<cControlContainerBlueprint-cControlValue d:id="21517">
							<ControlName d:type="cDeltaString">DSD</ControlName>
							<DefaultValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</DefaultValue>
							<MinimumValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0</MinimumValue>
							<MaximumValue d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</MaximumValue>
							<BriefDescription d:type="cDeltaString">Driver Vigilance</BriefDescription>
							<DetailedDescription d:type="cDeltaString">Driver Vigilance</DetailedDescription>
							<ApplyToConsist d:type="cDeltaString">eFalse</ApplyToConsist>
							<HUDControlID d:type="sUInt32">0</HUDControlID>
							<InterfaceElements>
								<cControlContainerBlueprint-cInteriorPushButton d:id="21527">
									<ElementName d:type="cDeltaString">Untitled</ElementName>
									<DifficultyType d:type="cDeltaString">StopGo</DifficultyType>
									<PickTransformName d:type="cDeltaString">dsd</PickTransformName>
									<MovementType d:type="cDeltaString">MoveLeftRight</MovementType>
									<AnalogInputSensitivity d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</AnalogInputSensitivity>
									<DigitalInputSensitivity d:type="sFloat32" d:alt_encoding="000000000000F03F" d:precision="string">1</DigitalInputSensitivity>
									<AnimationName d:type="cDeltaString"></AnimationName>
									<OutputInterface d:type="cDeltaString">eCab</OutputInterface>
									<AutoRelease d:type="cDeltaString">eTrue</AutoRelease>
								</cControlContainerBlueprint-cInteriorPushButton>
							</InterfaceElements>
						</cControlContainerBlueprint-cControlValue>
and tried editing he default/minimum/maximum values to see if it's as simple as that.

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 8:52 am
by gptech
To answer my own question:
editing that section of the .bin only turns the notification off.

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 9:32 am
by 749006
I've not tried it but a chap on Railworks America got rid of the Alerter on the P42 Genesis by increasing the Timing Period to about 3 hours.
Could something similar be done on the Class 91?

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 9:44 am
by AndyUK
Good idea but the delay seems to be defined in the script for the loco which in the case of the P42, or one version of it at least, is still in .lua format and therefore user editable. The Class 91 script is in a compiled format (.out) and therefore can't be modified by us mere mortals.

Andy L

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 10:15 am
by gptech
But..... it can/in theory could be, called for from another script which itself disables/changes the default behaviour. Now...does anybody know/have half an idea what the script could be?

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 11:07 am
by 31160
My main problem with it is as the scenario is driving blunt end first you cant sit in the cab and cancel as it goes off because theres no. Cab so to speak you just gotta press Q a lot lol

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 11:21 am
by gptech
31160 wrote:because theres no. Cab so to speak you just gotta press Q a lot lol
Press the "Alternate view" button on the HUD twice (little down pointing arrow, top row, far right) or the left/right arrow key on your keyboard twice to firstly switch to the other seat in the cab, and the second press moves you to the other cab. (page 8 of the manual)

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 1:35 pm
by Springer6
gptech wrote:But..... it can/in theory could be, called for from another script which itself disables/changes the default behaviour. Now...does anybody know/have half an idea what the script could be?

I'm afraid that I would be of no use whatsoever with this, but it would be great if a solution could be found.

I've more or less stopped using the 91 as , like many, I prefer helicopter view and pessing Q a lot becomes tedious.

The real solution would be for DTG to incorporate the Ctrl+C, Ctrl+F to disable alerts found in many other locos. Easy for them, I imagine, if they could be bothered !

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 1:45 pm
by ChrisBarnes
gptech wrote:But..... it can/in theory could be, called for from another script which itself disables/changes the default behaviour. Now...does anybody know/have half an idea what the script could be?
Without doing indepth research into the blueprints of the 91, I think it would perhaps be easier to just discard the original script and start again (assuming some willing volunteer is proficient enough at fairly straightforward lua scripting). The reason I think that it's still probably easier to fix by writing a new script, because you won't be able to intercept the point where the scripted timer affects the emergency brake control. :)

A suggested snippet of script:

Code: Select all

--proposed class 91 replacement script
function Initialise ()
	DEBUG = false;
	Call("BeginUpdate");
end

function Update (time)

	if Call("GetIsEngineWithKey") == 1 then --do stuff for the player loco only
		DSDControlCentre (time);
	else --do everything else including the headlight effects, if necessary (if the headlight flare child objects are correctly named, the core will set them correctly anyway)

	end

end

do
local DSDTimer = 0;
local DSDDepressed = true;
local TIMER_THRESHOLD = 60;
local lastControlState = {};
for i = 1, 5 do
	lastControlState[i] = 0;
end

local function ControlStateMonitor ()

	local powerController = GetControl("Regulator");
	local masterSwitch = GetControl("Reverser");
	local trainBrake = GetControl("TrainBrakeControl");
	local horn = math.max(GetControl("Horn"), GetControl("Bell"));
	local awsReset = GetControl("AWSReset");
	
	if powerController ~= lastControlState[1] then
		lastControlState[1] = powerController;
		return true;
	elseif masterSwitch ~= lastControlState[2] then
		lastControlState[2] = masterSwitch;
		return true;
	elseif trainBrake ~= lastControlState[3] then
		lastControlState[3] = trainBrake;
		return true;
	elseif horn ~= lastControlState[4] then
		lastControlState[4] = horn;
		return true;
	elseif awsReset ~= lastControlState[5] then
		lastControlState[5] = awsReset;
		return true;
	else
		return false;
	end

end

function DSD (time)

	local dsdReset = GetControl("DSDReset"); --I don't know what the actual control name is, unfortunately, so might need to change "DSDReset". GetControl will prevent a nil value being drawn up and used further on
	
	if dsdReset > 0.5 and DSDDepressed then
		DSDDepressed = false;
	elseif dsdReset < 0.5 then
		DSDDepressed = true;
	end
	
	if not DSDDepressed or ControlStateMonitor() then --has the pedal been pressed recently or any of the 5 main controls moved?
		DSDTimer = 0;
		local emergencyBrake = GetControl("EmergencyBrakeControl");
		if emergencyBrake ~= 0 then
			Call("SetControlValue", "EmergencyBrakeControl", 0, 0);
		end
	else
		DSDTimer = DSDTimer + time;
		if DSDTimer > TIMER_THRESHOLD then
			local emergencyBrake = GetControl("EmergencyBrakeControl");
			if emergencyBrake ~= 1 then
				Call("SetControlValue", "EmergencyBrakeControl", 0, 1);
			end
		end
	end


end

local DSDOn = false;
function DSDControlCentre (time)

	local DSDSwitch = GetControl("DSDOnOff") --there might be an existing switch control on the 91/DVT, but if not, one will need to be added to the engine blueprint and to the input mapper
	
	if DSDSwitch == 0 and not DSDOn then --assume 0 is the default position 
		DSD(time);
		SysCall("ScenarioManager:ShowAlertMessageExt", "DTG Intercity 225", "DSD enabled, press Shift + Numpad Enter to disable", 5, 0);
		DSDOn = true;
	elseif DSDSwitch == 1 and DSDOn then
		SysCall("ScenarioManager:ShowAlertMessageExt", "DTG Intercity 225", "DSD disabled, press Shift + Numpad Enter to enable", 5, 0);
		DSDOn = false;
	end
	
end
end

function GetControl(controlName)

	local control = Call("GetControlValue", controlName, 0);

	if control ~= nil then
		return control;
	else
		return 0;
		if DEBUG then
			Print("Control, "..controlName..", was not found.");
		end
	end

end

Now, if someone would like to interject and add some cruise control code...? :D

Kind regards,
Chris

Re: RSC Class 91 DSD

Posted: Tue Sep 22, 2015 3:14 pm
by 749006
I though t I would register with DTG Support and ask the question about the DSD Vigilance.

However the Stupid Captcha system won't let me thru. :x

Peter