Fix Upgrades/Models overlapping first model in Showroom(Spinner)

Discussion in 'Car Modding' started by svictor, Jan 22, 2020.

  1. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    255
    Likes Received:
    1,644
    This issue/bug has been mentioned a few times before, there are some insightful discussions, but solution wasn't clearly pieced together.
    Two important discussions that mentioned a core reason behind the issue, which is naming:
    Very Annoying problem with Spinner and Upgrades
    Annoying upgrade problem
    After a long time of searching and testing, I finally come to some working solutions.

    The issue(or bug):
    1. If a car has multiple upgrades of a single part, let's say "Front Bumper", and you go into showroom to select one of the "Front Bumper" upgrades that isn't the first one on the list, you will see this "Front Bumper" is overlapping with the first one/3D model, same applies to all the other upgrades that ain't the first one.
    2. This overlap issue only happens in Showroom(Spinner), everything works fine on track.

    Reason/Cause:
    1. Some weird naming is forced on upgrades, if you choose the wrong naming format, your upgrades will overlap each other, but this is not the only cause.
    2. The <something> substitute must be a complete substitute of a file name, otherwise your upgrades will also overlap each other.

    Solution:
    1. All the <something> substitute MUST contain/start with the same name from that "Instance" in SPINNER.gen.
    Example:
    if instance named "Instance=FBUMPER", then "FBUMPER" will be the prefix that you have to use for every substitute, such as <FBUMPER01>, <FBUMPER_BIG>, <FBUMPERCOOL>.
    What won't work: anything doesn't start with "FBUMPER", such as <01FBUMPER>, <FRONTBUMPER01> etc.

    2. Next, you need to fully substitute a file name in SPINNER.gen.
    Example:
    In SPINNER.gen wrote: MeshFile=<FBUMPER01> CollTarget......
    Then in UPGRADES.ini wrote: GEN=<FBUMPER01>=CAR_FBUMPER_LODA.gmt
    What won't work: a common practice is partially substitute a file name, which will cause ovelapping in Showroom, such as "MeshFile=CAR_FBUMPER_<FBUMPER01>.gmt".

    3. Now if you really want to partially substitute a file name (which makes life a lot easier for main .gen file), you can just replace the partial one with full substitution in SPINNER.gen, then add a corresponding entry in UPGRADES.ini as showroom workaround.
    Example:
    in main .gen
    Instance=FBUMPER
    {
    Moveable=True
    <MAX> MeshFile=CAR_FBUMPER_LOD<FBUMPER_TYPE>.gmt
    <HIGH> MeshFile=CAR_FBUMPER_LOD<FBUMPER_TYPE>.gmt
    <MED> MeshFile=CAR_FBUMPER_LOD<FBUMPER_TYPE>.gmt
    }

    in SPINNER.gen
    Instance=FBUMPER<UPNUMBER>
    {
    Moveable=True
    MeshFile=<FBUMPER01>
    }

    in UPGRADES.ini
    UpgradeType="Front Bumper"
    {
    Instance="FBUMPER"
    UpgradeLevel="Type A"
    {
    GEN=<FBUMPER01>=CAR_FBUMPER_LODA.gmt // showroom workaround
    GEN=<FBUMPER_TYPE>=A // for main gen
    }
    UpgradeLevel="Type B"
    {
    GEN=<FBUMPER01>=CAR_FBUMPER_LODB.gmt // showroom workaround
    GEN=<FBUMPER_TYPE>=B // for main gen
    }
    }

    ------------------------------------------------------
    There is also another workaround: just hide the model in first upgrade level, so nothing can be overlapped, but not really useful.

    Last, there is still some very rare case where the above solution wouldn't work (I have only encountered one so far). If DEV saw this, please take a look at this whole spinner issue. If there is anything missing or wrong, please help and comment, thanks.
     
    zxd1997, Mauro and McFlex like this.
  2. Bernd

    Bernd Registered

    Joined:
    Jul 9, 2013
    Messages:
    1,509
    Likes Received:
    746
    Some more things to care for:
    In the SPINNER.gen:
    - all instances that have upgrades, have to be tagged with <UPNUMBER>.
    Example: Instance=whatever<UPNUMBER>
    - before the first upgrade is used, there must be the entry <STARTUPGRADES>, that should get an own line.
    And behind of the last upgrade, you can use the tag <STOPUPGRADES>

    One important thing in the upgrades.ini is, that you don't use the same Instance= entries for different upgrades.
    Example:
    You want to have upgrades for the rims and for the brakediscs.
    These parts are together in the "main" gen files 4 XXTIRE instances.
    So you normally would have to use the entries
    Instance=LFTIRE
    Instance=RFTIRE
    Instance=LRTIRE
    Instance=RRTIRE
    for both of the upgrade types in the upgrades.ini.
    But that can cause conflicts with the selection.

    The Instance=... entries in the upgrades.ini, that are also important for the naming of the upgrade placeholders, have to match the instances= entries in the spinner gen only!
    It don't matters in which instance the upgrades appear in the main gen file.

    So for the example above, where you want to use upgrades for rims and brakediscs, just create new instances in the spinner gen.
    For the rims, for example:
    Instance=LFRIM
    Instance=RFRIM
    Instance=LRRIM
    Instance=RRRIM
    Placeholders are <LFRIM...>, <RFRIM...>.....
    and for the brakediscs, for example:
    Instance=LFBDISC
    Instance=RFBDISC
    Instance=LRBDISC
    Instance=RRBDISC
    Placeholders are <LFBDISC...>, <RFBDISC...>.....
    In this way, you can avoid any conflicts.

    A good example of "how to not set it up properly", ist he camaro GT3 2012, where you don't see the rims changing in the spinner, when you switch between model 2012 and 2013. :)
     
    svictor likes this.
  3. DelayedMeteor43

    DelayedMeteor43 Registered

    Joined:
    Aug 6, 2019
    Messages:
    11
    Likes Received:
    0
    I want the body of my car to change depending on the type of race track, just graphically speaking though. I have the models converted I just need to know how to implement them into the .gen, spinner.gen, and upgrades.ini so you can graphically see the changes?
     
  4. Coutie

    Coutie Moderator

    Joined:
    Oct 5, 2010
    Messages:
    2,680
    Likes Received:
    1,355
    Look at the skip barber in the devmode folder, you'll want the TrackConfigBase file to force the upgrades on certain tracks.
     
  5. svictor

    svictor Registered

    Joined:
    Jan 20, 2019
    Messages:
    255
    Likes Received:
    1,644
    Just discovered one more thing relate to HDV upgrades:

    HDV file must contain at least one empty line after the last line entry (usually is BrakeGlow), otherwise any HDV upgrades selected in showroom won't work. Also this empty line is needed for rF2 Online-Tools' flex chassis generator to generate correct HDV, otherwise the last entry will get deleted.
     
    Gilles Benoit and Mauro like this.

Share This Page