P42 Alerter Shutdown fix

Discussion of rolling-stock creation & re-painting.

P42 Alerter Shutdown fix

Unread postby hefy_jefy » Sat Apr 06, 2013 11:07 pm

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
hefy_jefy
 
Posts: 44
Joined: Fri Nov 25, 2011 1:52 pm
Location: California Central Coast

Re: P42 Alerter Shutdown fix

Unread postby Bananarama » Sun Apr 07, 2013 2:17 am

Have you checked you in-game settings for "Brake on over-speed"?
Cheers!
Marc - 3DTrains

Image
User avatar
Bananarama
 
Posts: 2749
Joined: Sat Feb 14, 2009 1:17 am
Location: Another Planet

Re: P42 Alerter Shutdown fix

Unread postby hefy_jefy » Sun Apr 07, 2013 12:15 pm

Good idea, but no its not that, Brake on Overspeed is OFF and the problem only affects the P42 - others are OK
Geoff
hefy_jefy
 
Posts: 44
Joined: Fri Nov 25, 2011 1:52 pm
Location: California Central Coast

Re: P42 Alerter Shutdown fix

Unread postby Chacal » Sun Apr 07, 2013 1:34 pm

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
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6611
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: P42 Alerter Shutdown fix

Unread postby UPSD70ACe » Tue Apr 23, 2013 12:15 pm

Did anyone get the problem fixed I was hoping someone here would?
UPSD70ACe
 
Posts: 842
Joined: Sun Dec 12, 2010 12:57 pm

Re: P42 Alerter Shutdown fix

Unread postby thebigroyboyski » Wed Apr 24, 2013 2:46 pm

If you go on G-Trax website there is a fix.
Frontrunner in the file library now!
User avatar
thebigroyboyski
 
Posts: 579
Joined: Mon Jan 09, 2012 5:19 pm
Location: Ayrshire, Scotland

Re: P42 Alerter Shutdown fix

Unread postby UPSD70ACe » Wed Apr 24, 2013 3:12 pm

What is it under I cannot find the fix?
UPSD70ACe
 
Posts: 842
Joined: Sun Dec 12, 2010 12:57 pm

Re: P42 Alerter Shutdown fix

Unread postby thebigroyboyski » Wed Apr 24, 2013 7:26 pm

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.
Frontrunner in the file library now!
User avatar
thebigroyboyski
 
Posts: 579
Joined: Mon Jan 09, 2012 5:19 pm
Location: Ayrshire, Scotland

Re: P42 Alerter Shutdown fix

Unread postby 5292nate » Thu May 16, 2013 10:39 am

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!
"The trouble with a one track mind is it's narrow gauge and lack of switching controls." - Buzz Baxter
User avatar
5292nate
 
Posts: 1622
Joined: Sat Nov 10, 2012 12:14 pm
Location: Upstate New York

Re: P42 Alerter Shutdown fix

Unread postby UPSD70ACe » Mon Jan 13, 2014 6:20 pm

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.
UPSD70ACe
 
Posts: 842
Joined: Sun Dec 12, 2010 12:57 pm

Re: P42 Alerter Shutdown fix

Unread postby Chacal » Tue Jan 14, 2014 12:57 am

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)
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6611
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: P42 Alerter Shutdown fix

Unread postby UPSD70ACe » Fri Jan 24, 2014 6:13 pm

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
UPSD70ACe
 
Posts: 842
Joined: Sun Dec 12, 2010 12:57 pm

Re: P42 Alerter Shutdown fix

Unread postby BNSFdude » Fri Jan 24, 2014 6:48 pm

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*!!
Anthony Wood
Audio Engineer - Searchlight Simulations
User avatar
BNSFdude
 
Posts: 2721
Joined: Tue Nov 29, 2011 1:46 am

Re: P42 Alerter Shutdown fix

Unread postby Chacal » Sat Jan 25, 2014 12:17 am

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.
Over the hill and gathering speed
Chacal
Site Admin
 
Posts: 6611
Joined: Tue Jul 05, 2011 1:11 pm
Location: Quebec, Canada

Re: P42 Alerter Shutdown fix

Unread postby PapaXpress » Sat Jan 25, 2014 12:48 am

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.
Image
"Just post some random unrelated text. We have members here who can help you with that." ~ Chacal
"When all else fails, read the instructions... if that doesn't work either, try following them." ~ Old Prof
Image
The Grade Crossing - Atlanta North Project - Virtual Rail Creations
User avatar
PapaXpress
 
Posts: 5147
Joined: Sat Oct 23, 2010 10:30 pm
Location: that "other" timezone


Return to Rolling-Stock Design

Who is online

Users browsing this forum: No registered users and 1 guest