Upgrades.ini - values special order

Discussion in 'Car Modding' started by Juergen-BY, Jul 25, 2016.

  1. Juergen-BY

    Juergen-BY Registered

    Joined:
    Jun 16, 2012
    Messages:
    3,089
    Likes Received:
    440
    Hi,
    i`m just working on an upgrade.ini and i`m wondering, if it would be possible, to have a certain value as default?

    Example:
    Code:
    UpgradeType="TestUpgrade"
    {
    UpgradeLevel="Level_1"
    Description and values
    }
    {
    UpgradeLevel="Level_2"
    Description and values
    }
    {
    UpgradeLevel="Level_3"
    Description and values
    }
    {
    UpgradeLevel="Level_4"
    Description and values
    }
    Now i want to have the Upgrade level 3 as default, checked as default when going into the upgrade section. The value for level 3 is the same as it is in the hdv file. And i want to keep the ascending order (1-4). For me its working only, to get the level 3 as default in the upgrades, when i put the level 3 in the first row, like this:

    Code:
    UpgradeType="TestUpgrade"
    {
    UpgradeLevel="Level_3"
    Description and values
    }
    {
    UpgradeLevel="Level_1"
    Description and values
    }
    {
    UpgradeLevel="Level_2"
    Description and values
    }
    {
    UpgradeLevel="Level_4"
    Description and values
    }
    Any ideas?
     
    Last edited by a moderator: Jul 25, 2016
  2. stdave

    stdave Registered

    Joined:
    Dec 4, 2012
    Messages:
    95
    Likes Received:
    63
    Try adding this line

    UpgradeClass="Level_2"

    UpgradeType="TestUpgrade"
    {
    UpgradeLevel="Level_1"
    Description and values
    }
    {
    UpgradeLevel="Level_2"
    Description and values
    }
    {
    UpgradeLevel="Level_3"
    Description and values
    }
     
  3. Juergen-BY

    Juergen-BY Registered

    Joined:
    Jun 16, 2012
    Messages:
    3,089
    Likes Received:
    440
    Hi,
    many thanks for your suggestion, but (sadly) it doesn`t work. Maybe t`s something on my end...i tried these variations so far:

    Please note: Level 3 should be the default.

    Code:
    [B]UpgradeClass="Level_3"[/B]
    UpgradeType="TestUpgrade"
    {
    {
    UpgradeLevel="Level_1"
    Description and values
    }
    {
    UpgradeLevel="Level_2"
    Description and values
    }
    {
    UpgradeLevel="Level_3"
    Description and values
    }
    {
    UpgradeLevel="Level_4"
    Description and values
    }
    }
    Result: Upgrade Type is completly removed

    Code:
    
    UpgradeType="TestUpgrade"
    {
    [B]UpgradeClass="Level_3"[/B]
    {
    UpgradeLevel="Level_1"
    Description and values
    }
    {
    UpgradeLevel="Level_2"
    Description and values
    }
    {
    UpgradeLevel="Level_3"
    Description and values
    }
    {
    UpgradeLevel="Level_4"
    Description and values
    }
    }

    Result: First upgrade level (Level_1) is removed, level 2 is checked as default

    //Edit: forgot to post one version:

    Code:
    
    UpgradeType="TestUpgrade"
    [B]UpgradeClass="Level_3"[/B]
    {
    {
    UpgradeLevel="Level_1"
    Description and values
    }
    {
    UpgradeLevel="Level_2"
    Description and values
    }
    {
    UpgradeLevel="Level_3"
    Description and values
    }
    {
    UpgradeLevel="Level_4"
    Description and values
    }
    }
    Result: First upgrade level (Level_1) is removed, level 2 is checked as default
     
    Last edited by a moderator: Jul 25, 2016
  4. stdave

    stdave Registered

    Joined:
    Dec 4, 2012
    Messages:
    95
    Likes Received:
    63
    Its a long time since I did anything like this but try this.

    UpgradeType="TestUpgrade"
    {
    UpgradeClass="Level_2"
    {
    UpgradeLevel="Level_1"
    Description and values
    }
    {
    UpgradeLevel="Level_2"
    Description and values
    }
    {
    UpgradeLevel="Level_3"
    Description and values
    }
    }
     
  5. Juergen-BY

    Juergen-BY Registered

    Joined:
    Jun 16, 2012
    Messages:
    3,089
    Likes Received:
    440
    I allready tried this... please see my second approach above...
     
  6. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,782
    Likes Received:
    2,243
    Are you against making level three the first one? I think that's the only way to do it, unless you force it with trackconfig.ini, but then it's forced on, and you probably don't want that.
     
  7. Juergen-BY

    Juergen-BY Registered

    Joined:
    Jun 16, 2012
    Messages:
    3,089
    Likes Received:
    440
    It was just about "looking better"...at least, i must do it this way.
     
  8. Liquid4653

    Liquid4653 Registered

    Joined:
    Sep 30, 2013
    Messages:
    202
    Likes Received:
    46
    I think your issue is likely to be syntax, and its very important to get the squiggly brackets correct as well.

    here is ffb in the group c cars as an example, re-make your code using the below as structure, and you should be fine.

    I would also recommend that you post your code directly and complete, and not use abbreviations or descriptions in the code, it makes giving you direct assistance much easier.

    The way the upgrades work, the very first setting in the ini is the default, so if you have a scale of 1 to 10 and want 6 as default, put this first - you can see this in the code below and remember that it will use default value in hdv file. The Incremental=0 was necessary to leave all options open and selectable all the time, before adding that I noticed similar issue to you.

    This should be enough to get you on the way but if its still not clear, post your complete code and between all of us I'm sure it can be sorted out. Good Luck.

    UpgradeType="FFB Strength"
    {
    Incremental=0

    UpgradeLevel="FFB level 5 (Default)"
    {
    Description="FFB level 5 (Default)"
    }
    UpgradeLevel="FFB level 0 (Lightest)"
    {
    Description="FFB level 0 (Lightest)"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=38
    }
    UpgradeLevel="FFB level 1"
    {
    Description="FFB level 1"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=36
    }
    UpgradeLevel="FFB level 2"
    {
    Description="FFB level 2"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=34
    }
    UpgradeLevel="FFB level 3"
    {
    Description="FFB level 3"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=32
    }
    UpgradeLevel="FFB level 4"
    {
    Description="FFB level 4"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=30
    }
    UpgradeLevel="FFB level 5"
    {
    Description="FFB level 5"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=27.5
    }
    UpgradeLevel="FFB level 6"
    {
    Description="FFB level 6"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=25
    }
    UpgradeLevel="FFB level 7"
    {
    Description="FFB level 7"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=23
    }
    UpgradeLevel="FFB level 8"
    {
    Description="FFB level 8"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=21
    }
    UpgradeLevel="FFB level 9"
    {
    Description="FFB level 9"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=19
    }
    UpgradeLevel="FFB level 10 (Heaviest)"
    {
    Description="FFB level 10 (Heaviest)"
    HDV=[CONTROLS]
    HDV=NominalMaxSteeringTorque=17
    }
     
  9. Juergen-BY

    Juergen-BY Registered

    Joined:
    Jun 16, 2012
    Messages:
    3,089
    Likes Received:
    440
    Everything in my code is fine, probably you don`t got my point. I know, how it`s working, i was just looking for a more smart solution:

    Thanks anyway :)
     
    Last edited by a moderator: Jul 28, 2016
  10. Carr

    Carr Registered

    Joined:
    Mar 23, 2013
    Messages:
    116
    Likes Received:
    134
    The easiest way to do it would be to just add a duplicate upgrade for "level 3" and call it "Default" and put it up the top. That way you do keep the upgrades in the order you want and still keep "level 3" as the default.

    Also a silly question, but are you leaving in the ]b[ and ]/b[? That would cause it to not work. I doubt you are but just making sure. :)
     
    Last edited: Mar 6, 2018
  11. Juergen-BY

    Juergen-BY Registered

    Joined:
    Jun 16, 2012
    Messages:
    3,089
    Likes Received:
    440
    Hehehe...nah, it was just to point it out in the posting, but thanks for the head up anyway ;-)
     
  12. Bernd

    Bernd Registered

    Joined:
    Jul 9, 2013
    Messages:
    1,509
    Likes Received:
    755
    As Coutie has said already
    Without forcing it with ini files, the first option of an upgrade is always the one that is taken as default.

    But to be honest, i don't understand the problem.
    If you have the default value in the hdv file, you can call the first option level1 and don't add a value to it.
    So the hdv value is taken as default setting.
     

Share This Page