Import txt

di il
6 risposte

Import txt

Buongiono a tutti e grazie preventivamente per l'aiuto.

vi spiego la mia richiesta:

devo importare un file, che ha estensione .hdv, ma è apribile con notepad ed è strutturato come segue:

// The "reference plane" is equal to the ride height. Note that we have
// added a graphical offset because NASCAR measures the ride heights to the
// frame of the car, but the bodywork hangs about an inch lower (especially
// at the air dam). The graphical offset does not affect the physics in any
// way, just the appearance of how far the vehicle is off the ground. Note
// that the "undertray" points are where the vehicle bottoms out.
//
// Aerodynamic variables:
// Lift is negative downforce
//

[GENERAL]
Rules=0 // what rules to apply to garage setups (0=none, 1=stock car)
GarageDisplayFlags=175 // how settings are displayed in garage (add): 1=rear wing, 2=radiator, 4=more gear info
Mass=565 // all mass except fuel (1130kg car + 80kg driver)
Inertia=(408.92, 613.89, 131.65) // all inertia except fuel
FuelTankPos=(0.0, 0.2625, -1.14) // Location of tank relative to center of rear axle in reference plane
FuelTankMotion=(560.0,0.7) // simple model of fuel movement in tank (spring rate per kg, critical damping ratio)
Notes=" "
Symmetric=1
DamageFile=F4_ITA_Damage.ini
CGHeight=0.25 // height of body mass (excluding fuel) above reference plane
CGRightRange=(0.50, 0.0, 0.0) // fraction of weight on left tires
CGRightSetting=0
CGRearRange=(0.56, 0.001, 39)
CGRearSetting=8


io devo importare ogni singola riga, tranne quelle che inziano con \\, e di ogni riga devo importare solo il nome( es Rules) da mettere in una data cella ( es A1) e il valore dopo l'uguale ( in questo caso 0, da inserie in cella A2 ad esempio) tralasciando la parte di riga che è anticipata da \\

per quanto riguarda le righe dove i valori sono tra parentesi mi piacerebbe ottenere un risultato come sopra, quindi nome nella prima colonna alla riga data ( in caso di inertia, se Rules è 1, inertia sarà 4) e i valori nelle 3 colonne successive (B4, C4, D4)

il file inoltre è diviso in capitoli, titolati da [] come GENERAL in questo caso e alcuni capitoli contengono dati con gli stessi nomi ma valori differenti e non dovrebbero sovrapporsi.

considerate le dimensioni del file e la quantità di valori contenuti ( sono circa 506 righe) volevo sapere se ci fosse un metodo di acqusizione dei valori senza inizializzare 506 variabili come testo e altrettante come numero.

tenendo conto che i file che potrei importare sono diversi, ma tutti contengono le stesse diciture con valori differenti in quanto descrivono delle vetture, diverse tra di loro ma descritte sempre con gli stessi dati.

chiedo scusa ma non sono un fenomeno nella programmazione e una soluzione per importare questo file mi darebbe una grossa mano


grazi ancora per la disponibilità e l'aiuto

6 Risposte

  • Re: Import txt

    Devi costruire un programma ad hoc (un parser) in VBA. Non particolarmente difficile per chi ha esperienza (anche se non si fa in 10 minuti), un po' più complesso per chi non sa molto di codice.
  • Re: Import txt

    Ok quindi non ho scampo, cioè mi devo inzializzare tutte le variabili e leggere il file riga per riga per posizionare i valori dove voglio giusto?
  • Re: Import txt

    Non capisco la questione delle 500 variabili ... con un codice fatto in maniera corretta non servono 500 variabili... e poi è ovvio che dovrai leggere tutto il file riga per riga...
  • Re: Import txt

    Mi sono spiegato male.

    per allocare ogni variabile in una deteminata cella, leggendo il txt riga per riga non devo dichiarare delle delle variabili per ogni valore in modo che possa scriverle nella mia tabella excel?

    se non è così mi puoi fare un esempio su un paio di righe del mio file così che possa capire?

    come dicevo prima non sono un gran programmatore e vorrei capire la complessità della cosa per capire cosa fare
  • Re: Import txt

    Fai tu un esempio di codice che scriveresti per farci e farti capire dove sbagli.
  • Re: Import txt

    Buongiorno a tutti, scusate il ritardo nella risposta ma ho avuto problemi con il login sul forum.

    Oregon ho seguito i tuoi consigli ed effettivamente ho dichiarato molte meno variabili di quello che pensavo.

    ti allego il codice che ho generato e mi piacerebbe avere un opinione da parte tua ma anche di altri, in modo da capire se è migliorabile, velocizzabile, perfezionabile.

    grazie mille
    
    Sub HDV_import()
    
    Dim myFile As String
    Dim Text As String
    Dim Textline As String
    Dim FileNo As Integer
    Dim LineCounter As Integer
    Dim Title As String
    Dim Value_temp As String
    Dim Value As String
    Dim String_Array() As String
    Dim Counter As Variant
    Dim New_Value As String
    
    
    myFile = Application.GetOpenFilename("HDV (*.hdv), *.hdv") ' open dialog box to get the file
    FileNo = FreeFile 'Get the first free file number
    
    If myFile = "" Then 'If file name is blank exit sub
     MsgBox "No File Selected.", vbCritical, "No File"
     Exit Sub
    End If
    
    
    Open myFile For Input As #FileNo 'open selected file
    
    LineCounter = 1 'initialize line counter to 1 to write value in cells
    
    Do Until EOF(FileNo) 'until the end of file
     Line Input #FileNo, Textline 'read all lines
     
     Title = ""
     Value_temp = ""
     Value = ""
     New_Value = ""
      
     If Not Left(Textline, 1) = "" Then  'dont read empty lines
     
      If Not Left(Textline, 1) = vbTab Then 'dont read line beginnning with tab
      
       If Not Left(Textline, 1) = " " Then 'dont read line beginnning with space
        
        If Not Left(Textline, 1) = "/" Then 'dont read line beggining with /
      
         If Left(Textline, 1) = "[" Then 'if line begin with [ just write down in the cell
          Cells(LineCounter, 1) = Textline
          LineCounter = LineCounter + 1
         Else                            'if line begin in other way, split title from values
          Title = Left(Textline, InStr(1, Textline, "=", 1) - 1) ' use = as limiter to get title
          Cells(LineCounter, 1) = Title 'write the title in the first cell at given row
          Value_temp = Trim(Mid(Textline, Len(Title) + 2)) 'create a shorter string starting from character after =
         
          If InStr(1, Value_temp, "/", 1) > 0 Then 'check if in the line there is any comment and delete it
           Value = Left(Value_temp, InStr(1, Value_temp, "/", 1) - 1)
          Else
           Value = Value_temp 'if there isnt any comment copy temporary value in value
          End If
          
          If Left(Value, 1) = "(" Then 'if Value begin with ( split the value inside brakets and allocate them in each cell
           New_Value = Mid(Left(Value, InStr(1, Value, ")", 1) - 1), 2)   'delete () from the string
           String_Array = Split(New_Value, ",") 'split the value using the limter ","
           Counter = UBound(String_Array) 'create a counter to allocate values in cells
            For i = 0 To Counter
            Cells(LineCounter, i + 2) = String_Array(i) 'allocate each value in a different cell
            Next
           LineCounter = LineCounter + 1 'increase linecounter before re-entry the loop
          Else
           Cells(LineCounter, 2) = Value 'write the value in the second cell, at the same row
           LineCounter = LineCounter + 1 'increae linecounter for next line of the txt file
          End If
          
          
         End If
        
        End If
        
       End If
     
      End If
      
     End If
     
     
     
     Loop
     
     MsgBox "File Load Complete"
     
     Close #FileNo
     
     End Sub
    
    qui sotto invece esempio di file con estensione hdv da importare
    [GENERAL]
    Rules=0 // what rules to apply to garage setups (0=none, 1=stock car)
    GarageDisplayFlags=34 // how settings are displayed in garage (add): 1=rear downforce value (vs. angle), 2=radiator (vs. grille tape), 4=more gear info, 8+16=front downforce/wing/splitter/air dam, 32+64=rear downforce/wing/spoiler
    Mass=1250 //If your using a stock car you want to input the curb weight of the vehicle in kilograms (all units are metric).
    Inertia=(2128, 2425, 432) // (Pitch, Yaw, Roll) all inertia except fuel. A car is basically a rectangle. I'm giong to make this simple otherwise it can be overwhelmingly complex of an equation. Road cars on average tend to have their wieght spread fairly evenly throughout the shape of that rectangle. Now here's where we need to know the dimensions of the body of the vehicle to put into this formula: Pitch = (Mass/12)*(Length*Length+Height*Height) In short the formulae is (M/12)*(Y²+Z²) or (M/12)*(L²+H²) Yaw = (M/12)*(Length²+Width²) Roll = (M/12)*(Height²+Width²) Now that is assuming the weight is evenly distributed. Which is the average situation now adays. But we need to also know what materials the car is made of and essentially how much extra reinforcing it has with them. A older car made of steel and iron will have more inertia than a supercar made of carbon fiber for example even if they weigh the same and are the same external size. So for an old tank of a car you can add a percentage (use common sense here) to all the values, and for a car with mainly carbonfiber/aluminum construction you can subtract a percentage (again use common sense in this matter) It is important to note here that the height in real life will have the ground clearance (ride height) in it and in rfactor you want to subtract that amount because the reference plane is the bottom of the chasis, not the ground.

    FuelTankPos=(0.00, 0.10, 0.50) // location of tank relative to center of rear axle in reference plane
    FuelTankMotion=(150.0,0.25) // simple model of fuel movement in tank (spring rate per kg, critical damping ratio)
    Notes=""
    Symmetric=1
    DamageFile=Noisy_RPS13_Damage // .ini file to find physical and graphical damage info
    CGHeight=0.350 // height of body mass (excluding fuel) above reference plane. Again remember the reference plane is the bottom of the chasis so to get the value for this in rfactor you need to find the COG of the real car and then subtract the ride height from that number and make sure your value is in meters. This data is not available for most cars so you will have to find a similar car that it is available for. .32 is very low for a sedan. .4 is very high. For a race car .3 is normal. In real life it is assumed that the COG is typically the same height as the crank shaft but for a car like the s13 this is not true because the motor sits so low in the chasis.
    CGRightRange=(0.500, 0.005, 1) // fraction of weight on left tires
    CGRightSetting=0
    CGRearRange=(0.450, 0.005, 1) // fraction of weight on rear tires. This value means 45% rear 55% front distribution. The number of incriments being 1 means that it is not adjustable in game.
    CGRearSetting=1
    WedgeRange=(0.0, 0.25, 1) // rounds of wedge
    WedgeSetting=0
    WedgePushrod=0.0 // each round of wedge changes rear-left jacking screw by this amount (0.0 to disable, use Rules to allow FR ride height)
    GraphicalOffset=(0.000, 0.0, 0.000) // does not affect physics! This just moves the vehicle body for whatever reasons you may have.
    Undertray00=(0.75, 0.0080, -1.750) //These are the bottom out points of the chasis.
    Undertray01=(-0.75, 0.0080, -1.750)
    Undertray02=(0.40, 0.0080, -2.000)
    Undertray03=(-0.40, 0.0080, -2.000)
    Undertray04=(0.60, -0.0285, -0.800)
    Undertray05=(-0.60, -0.0285, -0.800)
    Undertray06=(0.60, -0.0185, 0.800)
    Undertray07=(-0.60, -0.0185, 0.800)
    Undertray08=(0.25, 0.0185, 2.175)
    Undertray09=(-0.25, 0.0185, 2.175)
    Undertray10=(0.65, 0.0185, 2.000)
    Undertray11=(-0.65, 0.0185, 2.000)
    Undertray12=(0.30, -0.0380, -1.2725)
    Undertray13=(-0.30, -0.0380, -1.2725)
    Undertray14=(0.30, -0.0380, 1.500)
    UndertrayParams=(300000.0,14000.0,2.0) // spring/damper/friction of the above points when in contact with the ground.
    TireBrand=240sx Tire.tbc // must appear before tire compound setting (references *.tbc file)
    FrontTireCompoundSetting=2 // compound index within brand
    RearTireCompoundSetting=2 // compound index within brand
    FuelRange=(1.0, 1.0, 72)
    FuelSetting=44
    NumPitstopsRange=(0, 1, 4)
    NumPitstopsSetting=3
    Pitstop1Range=(1.0, 1.0, 72)
    Pitstop1Setting=59
    Pitstop2Range=(1.0, 1.0, 72)
    Pitstop2Setting=49
    Pitstop3Range=(1.0, 1.0, 72)
    Pitstop3Setting=39
    AIAimSpeedsPerWP=(25.0, 35.0, 45.0, 55.0, 70.0, 90.0, 110.0, 140.0) // speeds at which to look ahead X waypoints (spaced roughly 5 meters apart)
    AICornerReductionBase=70.0 // (pointspeed/this number)= % deceleration we can expect through a point
    AIMinPassesPerTick=3 // minimum passes per tick (can use more accurate spring/damper/torque values, but takes more CPU)
    AIRotationThreshold=0.20 // rotation threshold (rads/sec) to temporarily increment passes per tick
    AIEvenSuspension=0.0 // averages out spring and damper rates to improve stability (0.0 - 1.0)
    AISpringRate=1.0 // spring rate adjustment for AI physics
    AIDamperSlow=0.5 // contribution of average slow damper into simple AI damper
    AIDamperFast=0.5 // contribution of average fast damper into simple AI damper
    AIDownforceZArm=0.150 // hard-coded center-of-pressure offset from vehicle CG
    AIDownforceBias=0.0 // bias between setup and hard-coded value (0.0-1.0)
    AITorqueStab=(1.0, 1.0, 1.0) // torque adjustment to keep AI stable
    AIFuelMult=-1.0 // PLR file override for AI fuel usage - only positive value will override, see PLR for default
    AIPerfUsage=(-1.0, -1.0, -1.0) // PLR file overrides for (brake power usage, brake grip usage, corner grip usage) used by AI to estimate performance - only positive values will override, see PLR for defaults
    AITableParams=(-1.0, -1.0) // PLR file overrides for (max load, min radius) used when computing performance estimate tables - only positive values will override, see PLR for defaults
    FeelerFlags=0 // how collision feelers are generated (add): 1=box influence 2=reduce wall-jumping 4=allow adjustment hack 8=top directions
    FeelerOffset=(0.0, 0.0, 0.0) // offset from cg to use when generating feelers
    FeelersAtCGHeight=0 // whether corner and side feelers are automatically adjusted to CG height
    FeelerFrontLeft=(0.754,0.207,-2.045) //These are collision points
    FeelerFrontRight=(-0.754,0.207,-2.045)
    FeelerRearLeft=(0.791,0.409,2.150)
    FeelerRearRight=(-0.791,0.409,2.150)
    FeelerFront=(0.000,0.253,-2.287)
    FeelerRear=(0.000,0.415,2.253)
    FeelerRight=(-0.843,0.231,0.000)
    FeelerLeft=(0.843,0.231,0.000)
    FeelerTopFrontLeft=(-0.527,1.020,-0.095)
    FeelerTopFrontRight=(0.527,1.020,-0.095)
    FeelerTopRearLeft=(-0.511,1.050,0.831)
    FeelerTopRearRight=(0.511,1.050,0.831)
    FeelerBottom=(0.000,-0.020,0.000)


    [FRONTWING]
    FWRange=(0.0, 0.0, 0) // front wing range, All set to 0 here because this car has no front lip and the bumper shape is neutral of downforce. Drag is accounted for in the body section.
    FWSetting=1 // front wing setting
    FWMaxHeight=(0.20) // maximum height to take account of for downforce
    FWDragParams=(0.000, 0.0000, 0.0000) // base drag and 1st and 2nd order with setting. A value of 0.001 is noticeable here.
    FWLiftParams=(-0.00000, -0.00, 0.00000)// base lift and 1st and 2nd order with setting. If the vehicle has a lip or cannard a negative value is downforce and a negave value of 0.1 is quite noticeable. -.2 is typically too much.
    FWDraftLiftMult=1.25 // Locke: effect of draft on front wing's lift response (larger numbers will tend to decrease downforce when in the draft)
    FWLiftHeight=(0.335) // effect of current height on lift coefficient
    FWLiftSideways=(0.4) // dropoff in downforce with yaw (0.0 = none, 1.0 = max)
    FWLiftPeakYaw=(0.0, 1.0) // Locke: angle of peak, multiplier at peak
    FWLeft=(-0.005, 0.0, 0.0) // aero forces from moving left
    FWRight=(0.005, 0.0, 0.0) // aero forces from moving right
    FWUp=(0.0, -0.02, -0.001) // aero forces from moving up
    FWDown=(0.0, 0.02, 0.001) // aero forces from moving down
    FWAft=(0.0, 0.02, -0.02) // aero forces from moving rearwards
    FWFore=(0.0, 0.0, 0.0) // aero forces from moving forwards (recomputed from settings)
    FWRot=(0.05, 0.025, 0.075) // aero torque from rotating
    FWCenter=(0.00, 0.00, -0.60) // center of front wing forces (offset from center of front axle in ref plane)

    [REARWING]
    RWRange=(0.0, 0.0, 0) // rear wing range. All 0 here because this car has no factory rear wing. These values are taken care of in the upgrades section.
    RWSetting=0 // rear wing setting
    RWDragParams=(0.000, 0.000, 0.00000) // base drag and 1st and 2nd order with setting
    RWLiftParams=(0.000, 0.000, 0.00000)// base lift and 1st and 2nd order with setting was 2050
    RWDraftLiftMult=1.05 // Locke: effect of draft on rear wing's lift response
    RWLiftSideways=(0.25) // dropoff in downforce with yaw (0.0 = none, 1.0 = max)
    RWLiftPeakYaw=(0.0, 1.0) // angle of peak, multiplier at peak
    RWLeft=(-0.005, 0.0, 0.0) // aero forces from moving left
    RWRight=(0.005, 0.0, 0.0) // aero forces from moving right
    RWUp=(0.0, -0.02, -0.001) // aero forces from moving up
    RWDown=(0.0, 0.02, 0.001) // aero forces from moving down
    RWAft=(0.0, 0.02, -0.02) // aero forces from moving rearwards
    RWFore=(0.0, 0.0, 0.0) // aero forces from moving forwards (recomputed from settings)
    RWRot=(0.18, 0.12, 0.12) // aero torque from rotating
    RWCenter=(0.00, 0.70, 1.0) // center of rear wing forces (offset from center of rear axle at ref plane)

    [BODYAERO]
    BodyDragBase=(0.350) // base drag. This is the drag coefficient of the vehicle in stock form. Wing drag gets added to this.
    BodyDragHeightAvg=(0.08) // drag increase with average ride height.
    BodyDragHeightDiff=(0.31) // drag increase with front/rear ride height difference
    BodyMaxHeight=(0.25) // maximum ride height that affects drag/lift
    BodyLeft=(-0.7, 0.1, 0.0) // aero forces from moving left
    BodyRight=(0.7, 0.1, 0.0) // aero forces from moving right
    BodyUp=( 0.0,-1.5, 0.0) // aero forces from moving up
    BodyDown=( 0.0, 1.5, 0.0) // aero forces from moving down
    BodyAft=( 0.0, 0.20, -0.90) // aero forces from moving rearwards
    BodyFore=(0.000,0.072,0.000) // aero forces from moving forwards (lift value important, but drag overwritten)
    BodyRot=(3.0, 2.5, 1.0) // aero torque from rotating. These values should be affected by the lenth and side height and squareness of the vehicle. The values represent torque at 90*, torque at 45* and torque at 0*. A larger number will make the car want to straighten out more the faster you go.
    BodyCenter+=(0.0, 0.3, 0.05) // center of body aero forces (offset from center of rear axle at ref plane)
    RadiatorRange=(100.0, -5.0, 1) // radiator range (front grille tape)
    RadiatorSetting=2 // radiator setting
    RadiatorDrag=(0.0) // effect of radiator setting on drag
    RadiatorLift=(0.0) // effect of radiator setting on lift
    BrakeDuctRange=(0.0, 1.0, 1) // brake duct range
    BrakeDuctSetting=0 // brake duct setting
    BrakeDuctDrag=(0.0) // effect of brake duct setting on drag
    BrakeDuctLift=(0.0)

    [SUSPENSION]
    PhysicalModelFile=Noisy_RPS13.pm
    FixInnerSuspHeight=-1 // instead of moving inner susp height relative with ride height, use this offset (set to -1 for original behavior) -1 is correct as it means that the ride height of the vehicle is the same height as the lowest point in the inner suspension arms.
    ApplySlowToFastDampers=1 // whether to apply slow damper settings to fast damper settings
    AdjustSuspRates=1 // adjust suspension rates due to motion ratio
    AlignWheels=1 // correct for minor graphical offsets
    CenterWheelsOnBodyX=1 // correct for minor unintentional graphical offsets
    FrontWheelTrack=1.465 // For a stock vehicle you will want to input this information. Or if you have track increment upgrades, otherwise this can be left to 0 to allow the track value to assume its graphical location instead of being physically overwritten by these values
    RearWheelTrack=1.46
    LeftWheelBase=2.475
    RightWheelBase=2.475
    SpringBasedAntiSway=0 // 0=diameter-based, 1=spring-based
    AllowNoAntiSway=1 // Whether first setting gets overridden to mean no antisway bar
    FrontAntiSwayBase=0.0 //This is extra anti-sway. Unmeasureable in real life so best to be left to 0.
    FrontAntiSwayRange=(0.025, 0.0, 2) //This is the size of the sway bars, increment and number of increments. Here because allownoantisway=1 the first value is 0 and the second is 0.025.
    FrontAntiSwaySetting=1
    FrontAntiSwayRate=(6.2e10, 4) // (base, power), so rate = base * (diameter in meters ^ power) This is the rate formula for typical stock hollow/tubular steel sway bars. Power is always 4. For solid steel bars base is 1.1e11.
    RearAntiSwayBase=0.0 // extra anti-sway from tube twisting
    RearAntiSwayRange=(0.017, 0.002, 2)
    RearAntiSwaySetting=1
    RearAntiSwayRate=(6.2e10, 4) // (base, power), so rate = base * (diameter in meters ^ power)
    FrontToeInRange=(-0.45, 0.01, 56) //First value is starting degrees, then the degree change per increment, and number of increments.
    FrontToeInSetting=44 //The increment number that is defaulted to in the garage
    RearToeInRange=(-0.20, 0.01, 31)
    RearToeInSetting=21
    LeftCasterRange=(6.5, 0.1, 1) // front-left caster
    LeftCasterSetting=36
    RightCasterRange=(6.5, 0.1, 1) // front-right caster
    RightCasterSetting=36

    [CONTROLS]
    SteeringFFBMult=2.0 // vehicle-specific multiplier by steering force feedback
    SteerLockRange=(37,0,1) // This is the stock steering angle of the outside front tire at full lock.
    SteerLockSetting=0
    RearBrakeRange=(0.400, 0.005, 1) //This means that you have 40% braking power to the rear 60% to the front
    RearBrakeSetting=1
    BrakePressureRange=(1.0, 0.05, 1)
    BrakePressureSetting=1
    HandbrakePressRange=(0.75, 0.05, 1) // handbrake pressure, for a cable pull hand brake this is typically around 85% of the rear braking power. Hydro setups can be up to 150%
    HandbrakePressSetting=1
    Handbrake4WDRelease=0.0
    UpshiftAlgorithm=(0.970,0.0) // fraction of rev limit to auto-upshift, or rpm to shift at (if 0.0, uses rev limit algorithm)
    DownshiftAlgorithm=(0.900,0.830,0.600) // high gear downshift point, low gear downshift point, oval adjustment
    AutoUpshiftGripThresh=0.44 // auto upshift waits until all driven wheels have this much grip (reasonable range: 0.4-0.9)
    AutoDownshiftGripThresh=0.42 // auto downshift waits until all driven wheels have this much grip (reasonable range: 0.4-0.9)
    TractionControlGrip=(0.0, 0.0) // average driven wheel grip multiplied by 1st number, then added to 2nd
    TractionControlLevel=(0.0, 0.0) // TC On/Off only for this car // effect of grip on throttle for low TC and high TC
    ABS4Wheel=0 // 0 = old-style single brake pulse, 1 = more effective 4-wheel ABS
    ABSGrip=(0.00, 0.00) // grip multiplied by 1st number and added to 2nd
    ABSLevel=(0.00, 0.00) // effect of grip on brakes for low ABS and high ABS
    OnboardBrakeBias=0

    [ENGINE]
    Normal=Engines/Engine_KA24DE_Stock.ini // unrestricted engine
    RestrictorPlate=Engines/Engine_KA24DE_Stock.ini // restrictor plate engine
    GeneralTorqueMult=1 //This is an important value in upgrading. Having this value here allows for us to modify it for engine performance upgrading. This multiplies the torque values of the motor all by it's value. Because it operates with the power multiplier this only affects the torque till the point that peak torque is achieved and gradually dicipates
    GeneralPowerMult=1 //This is the horsepower only increase so from the peak torque on is affected by this value.

    [DRIVELINE]
    ClutchInertia=0.0215 //This is the rotational inertia of not only the clutch but the entire driveline from the clutch to the driven wheels.
    ClutchTorque=320.0 //The amount of torque in N-M that the clutch can hold.
    ClutchWear=0.0
    ClutchFriction=0.0 //Assuming you took your Engine data from a WHP torque curve like you should have all friction values in the driveline should be 0. If you used crank torque then you would have to calculate this along with the wheel specific friction values to get a 18% total loss in power for a rear wheel drive vehicle and a 24% loss in a AWD and a 12% loss in a FWD.
    ClutchEngageRate=0.4 // how quickly clutch is engaged with auto-clutch driving aid
    BaulkTorque=300.0 //Honestly not sure what this really means but it's always a tiny bit lower than clutch torque for some reason so i leave it that way.
    AllowManualOverride=1
    SemiAutomatic=0
    UpshiftDelay=0.25
    UpshiftClutchTime=0.0
    UpshiftLiftThrottle=0.0
    DownshiftDelay=0.25
    DownshiftClutchTime=0.15
    DownshiftBlipThrottle=0.65
    WheelDrive=REAR
    GearFile=Noisy_S13_KA_Gears.ini // Must come before final/reverse/gear settings!
    AllowGearingChanges=0 // cannot change stock ratios until one buys a tranny upgrade
    AllowFinalDriveChanges=1 // cannot change stock ratio until one buys a diff upgrade
    FinalDriveSetting=2 // indexed into GearFile list
    ReverseSetting=0
    ForwardGears=5
    Gear1Setting=0
    Gear2Setting=1
    Gear3Setting=2
    Gear4Setting=3
    Gear5Setting=4
    DiffPumpTorque=0.0 // at 100% pump diff setting, the torque redirected per wheelspeed difference in radians/sec (roughly 1.2kph). Only high end diffs like those in indy cars and rally cars have pump diffs.
    DiffPumpRange=(0.00, 0.00, 0) // differential acting on all driven wheels
    DiffPumpSetting=0
    DiffPowerRange=(0.00 ,0.00, 1) // fraction of power-side input torque transferred through diff. 0 is open, 1 is locked.
    DiffPowerSetting=1 // (not implemented for four-wheel drive)
    DiffCoastRange=(0.0, 0.00, 1) // fraction of coast-side input torque transferred through diff. A 1 way will always have this 0, a 1.5 way will have this value half of the power value, a 2 way will be equal to the power value.
    DiffCoastSetting=1 // (not implemented for four-wheel drive)
    DiffPreloadRange=(0.0, 0.0, 1) // preload torque that must be overcome to have wheelspeed difference
    DiffPreloadSetting=1 // (not implemented for four-wheel drive)



    [FRONTLEFT]
    BumpTravel=-0.10 // This is the lowest the car can be to the ground before hitting the bump stop. When the suspension is to the point that the chasis by this wheel is at this value above the ground it will hit the stop.
    ReboundTravel=-0.320 // This is the highest the car can be above the ground before maxxing out the suspension travel and the wheel coming off the ground. Note that the total of bumptravel minus rebound travel should equal the shock travel of the vehicle. The rideheight setting should be somewhere in between the two values otherwise their will be trouble.
    BumpStopSpring=280000.0 // initial spring rate of bumpstop
    BumpStopRisingSpring=1.20e7 // rising spring rate of same (multiplied by deflection squared)
    BumpStopDamper=2000.0 // initial damping rate of bumpstop
    BumpStopRisingDamper=9.00e5 // rising damper rate of same (multiplied by deflection squared)
    BumpStage2=0.025 // speed where damper bump moves from slow to fast These have to do with the shape of the shock dyno curve. This is where the curve bends.
    ReboundStage2=-0.025 // speed where damper rebound moves from slow to fast
    FrictionTorque=0 // Newton-meters of friction between spindle and wheel. Again assuming you made your engine from wheel torque values and not crank values this should be 0.
    SpinInertia=1.650 // inertia in pitch direction including any axle but not brake disc
    CGOffsetX=0.000 // x-offset from graphical center to physical center (NOT IMPLEMENTED)
    PushrodSpindle=(-0.12, 0.00, 0.0)// spring/damper connection to spindle or axle (relative to wheel center). This is very very very very very important. This is the position of the shock on the vehicle in relation to this wheels center. If you cannot measure this on the real car find pictures that show the connection points of the shock (pushrod) to the spindle or suspension arm for this value and the body for the next value. The angle and distance of the relationship between the two sets of values will determine the motion ratio of that spring/shock.
    PushrodBody=(-0.18, 0.46, 0.06) // spring/damper connection to body (relative to wheel center)
    CamberRange=(-0.5, 0.5, 1) //Camber angle. Stock vehicles are not very adjustable.
    CamberSetting=15
    PressureRange=(120.0, 2.0, 131) //Tire preasure in KPA. Default setup should put you in the middle of the range that is correct for the default tires of the vehicle.
    PressureSetting=55
    PackerRange=(0.000, 0.001, 1) //Race cars sometimes use these.
    PackerSetting=1
    SpringMult=1.00 // take into account suspension motion if spring is not attached to spindle (affects physics but not garage display) If spring is attached to the spindle it should be 1.0. To calculate the motion ratio if it is not you need to measure the arm the spring is on and what percentage of distance down the arm the spring is to the spindle. If the spring is 70% of the way from the body connection to the spindle the value here would be 0.7
    SpringRange=(17862.0, 0.0, 1) //The spring rate in N-M of the stock springs.
    SpringSetting=1
    RideHeightRange=(0.180, 0.005, 1) //The factory ride height (height of the inner suspension connections at factory height.
    RideHeightSetting=1
    DamperMult=1.00 // take into account suspension motion if damper is not attached to spindle (affects physics but not garage display). Same thing as with spring but for the shock.
    SlowBumpRange=(5000.0, 0, 1) //These represent a normal shock matched to a 2kg/mm spring from the factory.
    SlowBumpSetting=1
    FastBumpRange=(2000.0, 0, 1)
    FastBumpSetting=1
    SlowReboundRange=(12000.0, 0, 1)
    SlowReboundSetting=1
    FastReboundRange=(3000.0, 0.0, 1)
    FastReboundSetting=1
    BrakeDiscRange=(0.024, 0.000, 0) // disc thickness
    BrakeDiscSetting=0
    BrakePadRange=(0, 1, 5) // pad type (not implemented)
    BrakePadSetting=2
    BrakeDiscInertia=3.0 // inertia per meter of thickness. take into account the actual thickness of the brake rotor. This value should be the inertia of a meter of brake rotor material at the same diameter of the brake rotor.
    BrakeResponseCurve=(-20,20,160,200) //Locke: cold temperature (where brake torque is half optimum), min temp for optimum brake torque, max temp for optimum brake torque, and overheated temperature (where brake torque is half optimum)... These values are given by brake pad manufacturers all the time. These are typical factory replacement pad values.
    BrakeWearRate=1.215e-011 // meters of wear per second at optimum temperature
    BrakeFailure=(1.33e-002,7.20e-004) // average and variation in disc thickness at failure
    BrakeTorque=1682.0 // maximum brake torque at zero wear and optimum temp. This should be set by feel based on the tires used. If the vehicle can lock up a tire but at almost full effort then the same should be true in game assuming the tire is the same as what was used in real life.
    BrakeHeating=0.0003 // heat added linearly with brake torque. consider if you have a single or vented type rotor here.
    BrakeCooling=(0.006,0.0004) // minimum brake cooling rate (static and per unit velocity). Again single or vented matters.
    BrakeDuctCooling=2.000e-004 // brake cooling rate per brake duct setting
    BrakeGlow=(450.0,900.0) //temperature range (in Celsius) that brake glow ramps up
Devi accedere o registrarti per scrivere nel forum
6 risposte