Page 1 of 1

P42 Alerter Shutdown fix

Unread postPosted: Sat Apr 06, 2013 11:07 pm
by hefy_jefy
I know the default setup for the G-Trax Genesis P42 is probably accurate but its a pain when you are trying to create a long scenario (California Zephyr over Donner) - I figured out how to prevent the automatic shutdown by tweaking the P42DC_EngineScript.lua file:

-- Constants
AL_VISUAL_TIME_DELAY = 90.0
AL_AUDIBLE_TIME_DELAY = 12.0
AL_SHUTDOWN_TIME_DELAY = 12.0
AL_FLASH_INTERVAL_SECS = 0.5
AL_MIN_ALERT_SPEED = 120.0 (default is 20mph, its never gonna reach 120mph so it never shuts down!)

But this doesn't solve what I believe is a related problem, whenever you try and save and resume the loco shuts down and it takes 2 min to get going again, anybody have any clues how to workaround this?
This is the original P42 release for TS2012 (I think).
Geoff

Re: P42 Alerter Shutdown fix

Unread postPosted: Sun Apr 07, 2013 2:17 am
by Bananarama
Have you checked you in-game settings for "Brake on over-speed"?

Re: P42 Alerter Shutdown fix

Unread postPosted: Sun Apr 07, 2013 12:15 pm
by hefy_jefy
Good idea, but no its not that, Brake on Overspeed is OFF and the problem only affects the P42 - others are OK
Geoff

Re: P42 Alerter Shutdown fix

Unread postPosted: Sun Apr 07, 2013 1:34 pm
by Chacal
This behavior is caused by variables not initialized properly.
You are loading a game with some variables and control values having values from the saved game, while some others have been reset.
Here I guess you need to reset the alerter when you start the game again.

I can't test this right now, but I would add ALresetAlerter(1) inside the initialise () function, like this:

Code: Select all
function Initialise ()

   -- Activate particle emitters
   Call( "DieselExhaust:SetEmitterActive", 1 );
   gSmokeColourR, gSmokeColourG, gSmokeColourB = Call( "DieselExhaust:GetEmitterColour" )

  Call( "CabLight_R:Activate", 0 )
  Call( "CabLight_L:Activate", 0 )
  Call( "CabLight_M:Activate", 0 )
  Call( "TaskLight_R:Activate", 0 )
  Call( "TaskLight_L:Activate", 0 )
  Call( "DitchLight_R:Activate", 0 )
  Call( "DitchLight_L:Activate", 0 )
 
  -- Set Road Number in Cab
  SetCabRoadNumber()

  -- Reset the alerter  ****** Add this part
  ALresetAlerter(1)

   Call ( "*:BeginUpdate" )
   
end --Initialise function

Re: P42 Alerter Shutdown fix

Unread postPosted: Tue Apr 23, 2013 12:15 pm
by UPSD70ACe
Did anyone get the problem fixed I was hoping someone here would?

Re: P42 Alerter Shutdown fix

Unread postPosted: Wed Apr 24, 2013 2:46 pm
by thebigroyboyski
If you go on G-Trax website there is a fix.

Re: P42 Alerter Shutdown fix

Unread postPosted: Wed Apr 24, 2013 3:12 pm
by UPSD70ACe
What is it under I cannot find the fix?

Re: P42 Alerter Shutdown fix

Unread postPosted: Wed Apr 24, 2013 7:26 pm
by thebigroyboyski
UPSD70ACe wrote:What is it under I cannot find the fix?


I just looked there and they seem to of removed all trace of the p42 and the fix.
If you look through the engines bin file and find the alerter section. Edit the part that is the actuation time.

Re: P42 Alerter Shutdown fix

Unread postPosted: Thu May 16, 2013 10:39 am
by 5292nate
Chacal. Did it work? Does RSC intend to release an updated model? Several indications were made about an updated model coming with Marias Pass. We all know, that never happened. *!sad!* It would be super awesome if they also made a P32AC-DM!

Re: P42 Alerter Shutdown fix

Unread postPosted: Mon Jan 13, 2014 6:20 pm
by UPSD70ACe
I am still having trouble with the P42 again.Stops in emergency have to wait for train to start.Moving is there any way to fix it hope you can help?Note this is freeroam scenarios I am using.

Re: P42 Alerter Shutdown fix

Unread postPosted: Tue Jan 14, 2014 12:57 am
by Chacal
I have a fix published by Robbit, basically he disables the alerter with this new value in the lua script:
AL_VISUAL_TIME_DELAY = 9000.0

As for the alerter going off after a reload, try my suggestion above about ALresetAlerter(1)

Re: P42 Alerter Shutdown fix

Unread postPosted: Fri Jan 24, 2014 6:13 pm
by UPSD70ACe
I DID IT I DID IT YAAAAAAAAAA,I solved the problem guy's I had went into the Engine Script an had deleted the text below,That stops the train from going into emergency.So now I can resume a scenario without the P42 shutting down.I would back yup your P42 Engine Script.

-- Emergency Engine Shutdown
if name == "EngineStop" then
Call( "*:SetControlValue", "Startup", 0, -1 )
Call( "*:SetControlValue", "EmergencyBrake", 0, 1 )
Call( "*:SetControlValue", "ThrottleAndBrake", 0, 0.5 )
end

Re: P42 Alerter Shutdown fix

Unread postPosted: Fri Jan 24, 2014 6:48 pm
by BNSFdude
UPSD70ACe wrote:I DID IT I DID IT YAAAAAAAAAA,I solved the problem guy's I had went into the Engine Script an had deleted the text below,That stops the train from going into emergency.So now I can resume a scenario without the P42 shutting down.I would back yup your P42 Engine Script.

-- Emergency Engine Shutdown
if name == "EngineStop" then
Call( "*:SetControlValue", "Startup", 0, -1 )
Call( "*:SetControlValue", "EmergencyBrake", 0, 1 )
Call( "*:SetControlValue", "ThrottleAndBrake", 0, 0.5 )
end

Or you could pay attention like an engineer should. !**duh*!!

Re: P42 Alerter Shutdown fix

Unread postPosted: Sat Jan 25, 2014 12:17 am
by Chacal
Wow UPSD70ACe, I'm amazed.
You're getting good!

This fix completely disables the emergency brake, not only on startup but also when it should be applied.
But if I understand correctly, you don't use it anyways, so that's a good fix for you.
!!*ok*!!

BNSFdude wrote:Or you could pay attention like an engineer should. !**duh*!!


No the problem is that if you reload a saved scenario, the P42 will apply the emergency brakes right at the start.
Reproducible bug.

Re: P42 Alerter Shutdown fix

Unread postPosted: Sat Jan 25, 2014 12:48 am
by PapaXpress
Try this instead... sorry I did not get a chance to test it.

Code: Select all
-- Emergency Engine Shutdown
  if name == "EngineStop" then
    if (value == 1) then
      Call( "*:SetControlValue", "Startup", 0, -1 )
      Call( "*:SetControlValue", "EmergencyBrake", 0, 1 )
      Call( "*:SetControlValue", "ThrottleAndBrake", 0, 0.5 )
    end
  end


The reason you are seeing the original problem is because when any engine is loaded up the OnControlValueChange gets called. I generally avoid putting extra code in this function and just trap the values from the control with a global variable to use it later in the Update function. It adds a bit of overhead with all the extra globals but it works out better when you do all the heavy logic in the Update function.