How to get vehicles to load with a specific set of upgrades?

Discussion in 'Car Modding' started by Brent, Feb 7, 2021.

  1. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    236
    Likes Received:
    111
    Is it possible to combine the Genstring in the veh file and still have vehicle upgrades selectable in the showroom?

    I understand getting a vehicle to load with a certain make and options using Genstrings. I have a mod that also uses vehicle upgrades, like custom interior options, custom wheels, custom tires, custom dash etc.

    I want a carset of vehicles to load with a certain set of upgrades. Some with a certain set of wheels, some with a specific tire brand etc. However, I want the upgrades to still be selectable in the showroom. How do I do that? It seems the Genstring method requires the veh file to be changed and the entire mod repacked and doesn't allow for user selected upgrades from the showroom.

    As of now the only workaround I've figure out is to setup separate upgrades.ini files with the upgrades I want the highest in the order and reference it in the veh file. It gets me the desired result when AI load and when I select the car from the vehicle list however this IMO creates a bunch of unnecessary files.

    What is AIUpgradeClass? There is very little about this from what I've researched. Is that what I'm missing? Can I use this to get the desired result I'm looking for? And how to I set that up?
     
  2. FlashQld

    FlashQld Registered

    Joined:
    Feb 21, 2012
    Messages:
    221
    Likes Received:
    214
    If I understand your question this can be done through the genstring process in the vehicle file and the gen file. We've employed similar methods in our mods. For example 1 model of car may have a different steering wheel or motec to another of the same model. However the user can upgrade or change a part from the designated standard. We use the upgrades.ini file to select tyres for different tracks automatically and also manually if desired. It is a fairly lengthy process.
    In your gen file you will need a line that says <STARTUPGRADES> and one near the end that says <STOPUPGRADES>
    So in your gen files you may have a part called FORD_MOTEC_STYLE<2>.gmt so you would have a few parts named FORD_MOTEC_STYLE1.gmt FORD_MOTEC_STYLE2.gmt FORD_MOTEC_STYLE3.gmt



    In your VEH file you would have Genstring=7214 for example, so your motec is a style<2> part so it pertains to the second digit in the genstring and in this case will use style2. The first digit where I have written 7, if there is no gmt's in your gen file with style<1> then that first digit will get ignored. If you do have a style<1> part then in this case its the one called style7. Hope I'm making sense.

    So that above is how you make different teams have different options.

    So then you have the upgrades, we don't use AIUpgradeclass but it can be used to add say maybe a spoiler to each car in a race, either by choice or automatically. This is shown well in the Hammer in rF1.

    The way you did it with multiple ini files is how I had done it previously but as you say has a lot of files which can be done the way above.

    By using trackconfig file we have the cars use certain tyre options at certain tracks as per real life. We can modify fuel tank sizes and most bits per track with this method as well.

    Both rF1 and rF2 are the same in this regard.
     
  3. Brent

    Brent Registered

    Joined:
    Nov 5, 2015
    Messages:
    236
    Likes Received:
    111
    Ok, this is great. Thanks for the response @FlashQld ! I understand how gen strings and even the trackconfig file trackbaseconfig.ini work. Issue for me was understanding what the result is when gen strings and upgrades are combined. Does one override the other loading the vehicle into a session and if so what do you use to control it? What was making this confusing to me is whenever I've dealt with vehicle upgrades without a gen string, by default the vehicle always loads with the very first upgrade listed for that upgrade from the upgrade.ini I could never ever seem to control that, other than changing the order of which upgrade is listed first. Hence the multiple upgrades.ini's.

    I've never had a full understanding of the start and start/stop upgrades lines in the gen file because everyone sets that differently. I've seen gen files with startupgrades as the very first line and stopupgrades as the very last and everywhere in-between. And perhaps it doesn't matter much as long as your upgrade instances are between them. It sounds like when using gen strings this is even more important.

    So using a gen string we can get the base vehicle (upgrade) configuration that we want the vehicle to load with and also by default as an AI. Then as long as the upgrade instances are between the start/stop upgrades lines they will be a selectable option in the showroom for the user if they choose to change the configuration. For example, if I load a vehicle with the gen string with say the 2nd motec style upgrade, when I load the vehicle in the showroom that 2nd option will be checked by default in the upgrades list and load that way into a session but the user can still change it if they choose.

    I have enough confidence now to continue going forward with adapting mod(s) with a gen string. I have a couple on/off type upgrades like side mirror instance on or off. I've seen modders use empty gmts to represent the off, not sure if that is valid. When I set the upgrade up with a certain string (can't remember off my head) I find don't need the empty gmt. I assume now perhaps if the off option is 2 and there is no 2 gmt associated, it'll be ignored and not cause a missing meshfile error?

    I'll give it a shot and post any findings I come across here.
     
    Last edited: Feb 19, 2021
  4. FlashQld

    FlashQld Registered

    Joined:
    Feb 21, 2012
    Messages:
    221
    Likes Received:
    214
    Our FVR V8 mods utilise these concepts so if you need further assistance I can explain through them.
     
  5. Juergen-BY

    Juergen-BY Registered

    Joined:
    Jun 16, 2012
    Messages:
    3,089
    Likes Received:
    440
    Sorry @Brent for hitchhike your thread, but i have a similar problem. I want to have the following carpart upgrade:
    1. it should be selectable from the tuning menu (default should be off)
    2. when the part is selected (OFF) it should be hidden in the showroom, when selected ON it should be shown in the showroom
    3. when the player select that part, all AI`s should use that part too
    4. when the player dont have that part selected as OFF, AI`s should not use that part
    Would this somehow possible?

    From the gen file:
    Code:
    <STARTUPGRADES>
    Instance=COCKPIT<Upnumber>
    {
    Moveable=True
    <POSLEDEXIST> MeshFile=bmw320gto_posled.gmt CollTarget=False HATTarget=False LODIn=(0) LODOut=(2) ShadowCaster=(True, Solid) ShadowReceiver=True
    }
     
    <POSLEDEXIST> Instance=Plights_Glow<Upnumber>
    {
    Moveable=True
    MeshFile=bmw320gto_posled.gmt CollTarget=False HATTarget=False LODIn=(0) LODOut=(300) ShadowCaster=False ShadowReceiver=False
    }
    <STOPUPGRADES>
    From the spinner.gen:
    Code:
    <STARTUPGRADES>
    Instance=Plights_Glow<Upnumber>
    {
    Moveable=True
    <POSLEDEXIST> MeshFile=bmw320gto_posled.gmt CollTarget=False HATTarget=False LODIn=(0) LODOut=(300) ShadowCaster=False ShadowReceiver=False
    }
    <STOPUPGRADES>
    From the upgrade.ini:

    Code:
    UpgradeType="POS-LED"
    {
      Incremental=1
      Instance=COCKPIT
      Instance=Plights_Glow
      UpgradeLevel="No PLIGHTS"
      {
        GEN=<POSLEDEXIST>="//"
        Description="No POSLED"
      }
      UpgradeLevel="PLIGHTS"
      {
        GEN=<POSLEDEXIST>=" "
        Description="POSLED"
      }
    With that setting i have the POSLED as default off, can switch it ON for the player car, but not for the AI`s. When i change the order (upgrade.ini) to ON as first setting, all AI`s have the POSLED ON and i can switch off the POSLED for the player car but not for the AI`s and its shown further as ON in the showroom.
     
  6. redapg

    redapg Registered

    Joined:
    Jan 16, 2012
    Messages:
    3,958
    Likes Received:
    2,808
    @Juergen-BY At least it was possible in the Past, by using the "fixed Upgrades" Functionality.
    But it isn't working since a longer While anymore.
    But to be honest, i didn't try it out since a longer While too.
    Maybe you try it out?
    A short Tutorial about how to do it, can be downloaded at the Bottom of my online Tools Site.
     
    lagg and Juergen-BY like this.
  7. Juergen-BY

    Juergen-BY Registered

    Joined:
    Jun 16, 2012
    Messages:
    3,089
    Likes Received:
    440
    Thanks for the headup, but yes, its allways broken.
     

Share This Page