Kuju F7 Ammeter animation no longer working.

Post your problems and installation issues here!

Re: Kuju F7 Ammeter animation no longer working.

Postby Kali » Sat Jul 07, 2012 12:30 pm

They all have CabAmmeter controls, that needs a couple of lines of script to transfer the value to the cab control. I suspect the warbonnet one is missing an "Active" control, which was the archaic way of working out if the engine is driven; these days there's a specific call for that.

If you use this as the basic contents of F7A_Simulation.lua ( the simulation script ) then it might all start working:
Code: Select all
function Setup ()
end
function Initialise()
end

function Update (frame)
   if Call("*:GetIsEngineWithKey") == 1 then
      Amps = math.abs ( Call( "*:GetControlValue", "Ammeter", 0 ) )
      Call( "*:SetControlValue", "CabAmmeter", 0, Amps )
   end
end
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Kuju F7 Ammeter animation no longer working.

Postby Samwolf » Sat Jul 07, 2012 2:15 pm

Thanks Kali. Tried your code but it didn't fix the default f7 Ammeter. I looked at the "working" bin file and the "non-working" bin file and my old eyes can't see any difference other than the ID number.

Working ammeter bin file:
<cControlContainerBlueprint-cControlValue d:id="76019896">
<ControlName d:type="cDeltaString">Ammeter</ControlName>
<DefaultValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DefaultValue>
<MinimumValue d:type="sFloat32" d:alt_encoding="00000000007087C0" d:precision="string">-750.0000</MinimumValue>
<MaximumValue d:type="sFloat32" d:alt_encoding="0000000000709740" d:precision="string">1500.0000</MaximumValue>
<BriefDescription d:type="cDeltaString"></BriefDescription>
<DetailedDescription d:type="cDeltaString"></DetailedDescription>
<ApplyToConsist d:type="cDeltaString">eFalse</ApplyToConsist>
<InterfaceElements/>
</cControlContainerBlueprint-cControlValue>
<cControlContainerBlueprint-cControlValue d:id="76011704">
<ControlName d:type="cDeltaString">CabAmmeter</ControlName>
<DefaultValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DefaultValue>
<MinimumValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</MinimumValue>
<MaximumValue d:type="sFloat32" d:alt_encoding="0000000000709740" d:precision="string">1500.0000</MaximumValue>
<BriefDescription d:type="cDeltaString">Ammeter</BriefDescription>
<DetailedDescription d:type="cDeltaString">Ammeter </DetailedDescription>
<ApplyToConsist d:type="cDeltaString">eFalse</ApplyToConsist>
<InterfaceElements>
<cControlContainerBlueprint-cInteriorLever d:id="76014008">
<ElementName d:type="cDeltaString">AmmeterNeedle</ElementName>
<DifficultyType d:type="cDeltaString">StopGo</DifficultyType>
<PickTransformName d:type="cDeltaString"></PickTransformName>
<MovementType d:type="cDeltaString">MoveLeftRight</MovementType>
<AnalogInputSensitivity d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</AnalogInputSensitivity>
<DigitalInputSensitivity d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DigitalInputSensitivity>
<AnimationName d:type="cDeltaString">Kuju\RailSimulatorUS\RailVehicles\Diesel\F7\Default\Cabview\amperes</AnimationName>
</cControlContainerBlueprint-cInteriorLever>
</InterfaceElements>
</cControlContainerBlueprint-cControlValue>

Non-Working ammeter bin file:

<cControlContainerBlueprint-cControlValue d:id="75837096">
<ControlName d:type="cDeltaString">Ammeter</ControlName>
<DefaultValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DefaultValue>
<MinimumValue d:type="sFloat32" d:alt_encoding="00000000007087C0" d:precision="string">-750.0000</MinimumValue>
<MaximumValue d:type="sFloat32" d:alt_encoding="0000000000709740" d:precision="string">1500.0000</MaximumValue>
<BriefDescription d:type="cDeltaString"></BriefDescription>
<DetailedDescription d:type="cDeltaString"></DetailedDescription>
<ApplyToConsist d:type="cDeltaString">eFalse</ApplyToConsist>
<InterfaceElements/>
</cControlContainerBlueprint-cControlValue>
<cControlContainerBlueprint-cControlValue d:id="75828904">
<ControlName d:type="cDeltaString">CabAmmeter</ControlName>
<DefaultValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DefaultValue>
<MinimumValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</MinimumValue>
<MaximumValue d:type="sFloat32" d:alt_encoding="0000000000709740" d:precision="string">1500.0000</MaximumValue>
<BriefDescription d:type="cDeltaString">Ammeter</BriefDescription>
<DetailedDescription d:type="cDeltaString">Ammeter </DetailedDescription>
<ApplyToConsist d:type="cDeltaString">eFalse</ApplyToConsist>
<InterfaceElements>
<cControlContainerBlueprint-cInteriorLever d:id="75831208">
<ElementName d:type="cDeltaString">AmmeterNeedle</ElementName>
<DifficultyType d:type="cDeltaString">StopGo</DifficultyType>
<PickTransformName d:type="cDeltaString"></PickTransformName>
<MovementType d:type="cDeltaString">MoveLeftRight</MovementType>
<AnalogInputSensitivity d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</AnalogInputSensitivity>
<DigitalInputSensitivity d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DigitalInputSensitivity>
<AnimationName d:type="cDeltaString">Kuju\RailSimulatorUS\RailVehicles\Diesel\F7\Default\Cabview\amperes</AnimationName>
</cControlContainerBlueprint-cInteriorLever>
</InterfaceElements>
</cControlContainerBlueprint-cControlValue>

This one has me baffled.
If God had intended for man to fly, He wouldn't have given us the railroads.
User avatar
Samwolf
 
Posts: 762
Joined: Mon Aug 30, 2010 6:57 pm
Location: South Carolina, CSA

Re: Kuju F7 Ammeter animation no longer working.

Postby Machinist » Sat Jul 07, 2012 2:30 pm

Samwolf wrote:I just put all my F7's on the test track and drove each one. The ammeter works on all of them except UPRR, SPRR, DRGW and the War Bonnet in the Kuju/F7/ATSF folder. Very strange. I'm looking now into whether I installed a mod to the default F7 folder, I'll let you know what I find.

OK !!*ok*!! . looking foward your research....

Jus to let it clear, only the Warbonet is in the \ATSF folder; UPRR, UPRR with lights, SPRR and DRGW are in the \Default folder.

The default RSC installation has only three .lua's (in the subfolders \DRGW, \SPRR and \UPRR; the \ATSF folder has no .lua). With Explorer open \Kuju folder and then search for *.lua, if you have more then those 3 .lua's or one of them are different of the others, that's may be your problem. And also you can search for F7_EngineScript.lua in the whole \railworks folder, may be happen the game is loading a .lua with same name (even from other provider than Kuju) and making unusable those of \Kuju folder.

Doc.
Who doesn't have dog, hunts with cat.
User avatar
Machinist
 
Posts: 1105
Joined: Fri Apr 02, 2010 1:02 am
Location: São Paulo, Brazil

Re: Kuju F7 Ammeter animation no longer working.

Postby Kali » Sat Jul 07, 2012 3:46 pm

Other than the ids, those are exactly the same, so there has to be something elsewhere. Check the MaxForce setting, all that does for player trains is calibrate the ammeter.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Kuju F7 Ammeter animation no longer working.

Postby arizonachris » Sat Jul 07, 2012 4:39 pm

I don't drive in cab, so I use the F5 HUD, and it always reads the amps. I wonder if there is some connection with that reading, and the in cab ammeter that is supposed to be reading? Some script is not calling another script somewhere. I'll let y'all figure it out as I enjoy the ride flying around the loco. !*salute*! I use Don's script to hear the AWS, if there is one.
Ryzen 7 2700K, Asus Prime X570P, 32Gb DDR4, 2x 1Tb M.2 SSD's, RTX2060 6Gb, Occulus Rift
Win 10 Pro 64bit, keyboard/ mouse/ wheel/ pedals/ baseball bat
Security Coordinator on the Battleship Iowa
User avatar
arizonachris
 
Posts: 3955
Joined: Sun Mar 21, 2010 10:36 am
Location: Southern California

Re: Kuju F7 Ammeter animation no longer working.

Postby Samwolf » Sat Jul 07, 2012 7:31 pm

arizonachris wrote:I don't drive in cab, so I use the F5 HUD, and it always reads the amps. I wonder if there is some connection with that reading, and the in cab ammeter that is supposed to be reading? Some script is not calling another script somewhere. I'll let y'all figure it out as I enjoy the ride flying around the loco. !*salute*! I use Don's script to hear the AWS, if there is one.



The advantage to riding out of cab. !*cheers*! I spend about 90% of the time in cab so this one is bugging me.

I sort of tracked the problem down to the enginescript.lua file I'm using. The really strange part is that the F7A_UPRR_with_lights.bin works but the UPRR.bin doesn't work. They use the same enginescript.lua so this one is driving me batty. I see some differences between the 2 bin files but I'm not sure which difference is causing one not to work. I'm no where near knowing how lua or xml code work, I know just enough to get myself in trouble.
If God had intended for man to fly, He wouldn't have given us the railroads.
User avatar
Samwolf
 
Posts: 762
Joined: Mon Aug 30, 2010 6:57 pm
Location: South Carolina, CSA

Re: Kuju F7 Ammeter animation no longer working.

Postby Samwolf » Sun Jul 08, 2012 7:38 am

Found what was causing the problem with the ammeter animation and my script.

The UPRR with lights that worked has this code for the ammeter:

<cControlContainerBlueprint-cControlValue d:id="40557304">
<ControlName d:type="cDeltaString">Ammeter</ControlName>
<DefaultValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DefaultValue>
<MinimumValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</MinimumValue>
<MaximumValue d:type="sFloat32" d:alt_encoding="0000000000709740" d:precision="string">1500.0000</MaximumValue>
<BriefDescription d:type="cDeltaString">Ammeter</BriefDescription>
<DetailedDescription d:type="cDeltaString">Ammeter </DetailedDescription>
<ApplyToConsist d:type="cDeltaString">eFalse</ApplyToConsist>
<InterfaceElements>
<cControlContainerBlueprint-cInteriorLever d:id="40557944">
<ElementName d:type="cDeltaString">AmmeterNeedle</ElementName>
<DifficultyType d:type="cDeltaString">StopGo</DifficultyType>
<PickTransformName d:type="cDeltaString"></PickTransformName>
<MovementType d:type="cDeltaString">MoveLeftRight</MovementType>
<AnalogInputSensitivity d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</AnalogInputSensitivity>
<DigitalInputSensitivity d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DigitalInputSensitivity>
<AnimationName d:type="cDeltaString">Kuju\RailSimulatorUS\RailVehicles\Diesel\F7\Default\Cabview\amperes</AnimationName>
</cControlContainerBlueprint-cInteriorLever>
</InterfaceElements>
</cControlContainerBlueprint-cControlValue>

The UPRR and other engines that didn't work had this code for the ammeter:

<cControlContainerBlueprint-cControlValue d:id="75837096">
<ControlName d:type="cDeltaString">Ammeter</ControlName>
<DefaultValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DefaultValue>
<MinimumValue d:type="sFloat32" d:alt_encoding="00000000007087C0" d:precision="string">-750.0000</MinimumValue>
<MaximumValue d:type="sFloat32" d:alt_encoding="0000000000709740" d:precision="string">1500.0000</MaximumValue>
<BriefDescription d:type="cDeltaString"></BriefDescription>
<DetailedDescription d:type="cDeltaString"></DetailedDescription>
<ApplyToConsist d:type="cDeltaString">eFalse</ApplyToConsist>
<InterfaceElements/>
</cControlContainerBlueprint-cControlValue>
<cControlContainerBlueprint-cControlValue d:id="75828904">
<ControlName d:type="cDeltaString">CabAmmeter</ControlName>
<DefaultValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DefaultValue>
<MinimumValue d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</MinimumValue>
<MaximumValue d:type="sFloat32" d:alt_encoding="0000000000709740" d:precision="string">1500.0000</MaximumValue>
<BriefDescription d:type="cDeltaString">Ammeter</BriefDescription>
<DetailedDescription d:type="cDeltaString">Ammeter </DetailedDescription>
<ApplyToConsist d:type="cDeltaString">eFalse</ApplyToConsist>
<InterfaceElements>
<cControlContainerBlueprint-cInteriorLever d:id="75831208">
<ElementName d:type="cDeltaString">AmmeterNeedle</ElementName>
<DifficultyType d:type="cDeltaString">StopGo</DifficultyType>
<PickTransformName d:type="cDeltaString"></PickTransformName>
<MovementType d:type="cDeltaString">MoveLeftRight</MovementType>
<AnalogInputSensitivity d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</AnalogInputSensitivity>
<DigitalInputSensitivity d:type="sFloat32" d:alt_encoding="0000000000000000" d:precision="string">0.0000</DigitalInputSensitivity>
<AnimationName d:type="cDeltaString">Kuju\RailSimulatorUS\RailVehicles\Diesel\F7\Default\Cabview\amperes</AnimationName>
</cControlContainerBlueprint-cInteriorLever>
</InterfaceElements>
</cControlContainerBlueprint-cControlValue>

I don't know why there is a difference, but my enginescript.lua didn't like the "CabAmmeter" entry.

Thanks for all the tips and hints in helping me track this one down.
If God had intended for man to fly, He wouldn't have given us the railroads.
User avatar
Samwolf
 
Posts: 762
Joined: Mon Aug 30, 2010 6:57 pm
Location: South Carolina, CSA

Re: Kuju F7 Ammeter animation no longer working.

Postby Machinist » Sun Jul 08, 2012 10:04 am

Nice one !!*ok*!! I feel a great pleasure when I overcome a new challenge or get to fix something that is wrong. !*brav*!
Who doesn't have dog, hunts with cat.
User avatar
Machinist
 
Posts: 1105
Joined: Fri Apr 02, 2010 1:02 am
Location: São Paulo, Brazil

Re: Kuju F7 Ammeter animation no longer working.

Postby Samwolf » Sun Jul 08, 2012 10:20 am

Machinist wrote:Nice one !!*ok*!! I feel a great pleasure when I overcome a new challenge or get to fix something that is wrong. !*brav*!


Yep! It makes the headache from all the head banging **!!bang!!** you do while working it out go away. *!!wink!!*
If God had intended for man to fly, He wouldn't have given us the railroads.
User avatar
Samwolf
 
Posts: 762
Joined: Mon Aug 30, 2010 6:57 pm
Location: South Carolina, CSA

Re: Kuju F7 Ammeter animation no longer working.

Postby Kali » Sun Jul 08, 2012 10:21 am

Well done then :) does your ammeter show dynamic braking effort?

Now fix RW's apparent inability to divide...
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Kuju F7 Ammeter animation no longer working.

Postby Samwolf » Sun Jul 08, 2012 11:10 am

Kali wrote:Well done then :) does your ammeter show dynamic braking effort?

Now fix RW's apparent inability to divide...


I don't think so. AFAIK, there's no negative numbers on the ammeter.
If God had intended for man to fly, He wouldn't have given us the railroads.
User avatar
Samwolf
 
Posts: 762
Joined: Mon Aug 30, 2010 6:57 pm
Location: South Carolina, CSA

Re: Kuju F7 Ammeter animation no longer working.

Postby Kali » Sun Jul 08, 2012 11:37 am

That's what the default script does - converts the signed ammeter reading to an absolute value, so it works the same with dynamics.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Kuju F7 Ammeter animation no longer working.

Postby Samwolf » Sun Jul 08, 2012 1:32 pm

Kali wrote:That's what the default script does - converts the signed ammeter reading to an absolute value, so it works the same with dynamics.


Thanks, I'm assuming that the " if Call("*:GetIsEngineWithKey") == 1 then" line replaces the old
"if ( Call( "GetIsPlayer" ) == 1 ) then

if ( Call( "*:GetControlValue", "Active", 0 ) == 1 ) then" lines of code that told whether you had a player controlled engine?
If God had intended for man to fly, He wouldn't have given us the railroads.
User avatar
Samwolf
 
Posts: 762
Joined: Mon Aug 30, 2010 6:57 pm
Location: South Carolina, CSA

Re: Kuju F7 Ammeter animation no longer working.

Postby Kali » Sun Jul 08, 2012 6:08 pm

Samwolf wrote:Thanks, I'm assuming that the " if Call("*:GetIsEngineWithKey") == 1 then" line replaces the old
"if ( Call( "GetIsPlayer" ) == 1 ) then

if ( Call( "*:GetControlValue", "Active", 0 ) == 1 ) then" lines of code that told whether you had a player controlled engine?


Mine was a replacement sim script - it's a complete replacement for the default.

Using the Active control was an old hack from before the GetIsEngineWithKey call; you set it in the sim script because the sim script only ran on player engines. These days the sim script runs on everything anyway ( or at least everything in your train ), I think, so it's useless.

GetIsEngineWithKey : 1 if the player is driving the engine
GetIsPlayer: 1 if the player is driving the consist, not necessarily that particular engine.
Kali
 
Posts: 1600
Joined: Mon Mar 14, 2011 1:00 am
Location: England-by-Sea

Re: Kuju F7 Ammeter animation no longer working.

Postby Machinist » Sun Jul 08, 2012 8:45 pm

*!!thnx!!* Kali, very intersting indeed. *!!wink!!*
Who doesn't have dog, hunts with cat.
User avatar
Machinist
 
Posts: 1105
Joined: Fri Apr 02, 2010 1:02 am
Location: São Paulo, Brazil

PreviousNext

Return to Problems and Peculiarities

Who is online

Users browsing this forum: No registered users and 0 guests

cron