upgrades and Ai

Discussion in 'Car Modding' started by ling, Feb 28, 2023.

  1. ling

    ling Registered

    Joined:
    Jan 24, 2023
    Messages:
    156
    Likes Received:
    123
    is there any way to make the Ai use different wheels and spoilers ? from the upgrades ini.
    thanks

    Screenshot (181).png Screenshot (182).png Screenshot (183).png
     
  2. Coutie

    Coutie Moderator Staff Member

    Joined:
    Oct 5, 2010
    Messages:
    3,787
    Likes Received:
    2,246
  3. ling

    ling Registered

    Joined:
    Jan 24, 2023
    Messages:
    156
    Likes Received:
    123
    i wonted them to use random wheels and spoilers.
    where can i find information on gen strings ?
    thank you
     
  4. ling

    ling Registered

    Joined:
    Jan 24, 2023
    Messages:
    156
    Likes Received:
    123
    just looked at the dev guide and it says some thing about adding "Genstring= section" to the VEH file do you have a example of this please ? and would this mean i can set the Ai to use different wheel sets and stuff
    thanks
     
    Last edited: Feb 28, 2023
  5. Brutten

    Brutten Registered

    Joined:
    Jun 21, 2017
    Messages:
    363
    Likes Received:
    365
    Example with two wings and two different wheel.

    OBJECTS:
    CRfwing.gmt and FFfwing.gmt
    REDTireLF.gmt and BLUTireLF.gmt


    File VEH 1:
    GenString=CRRED (we will use the first two digits for the wing and the last three for the wheels.)

    File VEH 2:
    GenString=FFBLU

    Files GEN:
    Instance=FWING<UPNUMBER>
    {
    Moveable=True
    MeshFile=<12>fwing.gmt CollTarget=False HATTarget=False ShadowCaster= (...)
    Here you will replace 12 with CR or FF

    Instance=LFTIRE<UPNUMBER>
    {
    Moveable=True
    MeshFile=<345>TireLF.gmt CollTarget=False HATTarget=False ShadowCa (...)
    Here you will replace 345 by RED or BLU


    Random selection is not possible, each vehicle will carry the parts assigned in the VEH file by GENSTRING.
    I hope I have explained myself well.
     
  6. ling

    ling Registered

    Joined:
    Jan 24, 2023
    Messages:
    156
    Likes Received:
    123
    thank you for the reply
    for the rear wing in the gen file i have this

    GEN.file

    <RWINGEXISTS> Instance=RWING<UPNUMBER>
    <RWINGEXISTS> {
    <RWINGEXISTS> Moveable=True
    <RWINGEXISTS> MeshFile=<RWING1> CollTarget=true HATTarget=False LODIn=(0.00) LODOut=(50.0) ShadowReceiver=True
    <RWINGEXISTS> MeshFile=<RWING2> CollTarget=true HATTarget=False LODIn=(50.00) LODOut=(250.0) ShadowReceiver=True
    <RWINGEXISTS> MeshFile=<RWING3> CollTarget=true HATTarget=False LODIn=(250.00) LODOut=(600.0) ShadowReceiver=True
    <RWINGEXISTS> }

    and this is my VEH.file

    DefaultLivery="RX3_73_08.dds"

    HDVehicle=RX3_73.hdv
    Graphics=RX3_73.gen
    Spinner=RX3_73_SPINNER.gen
    Genstring=

    Sounds=RX3_73.sfx
    Cameras=RX3_73_cams.cam
    HeadPhysics=RX3_73_headphysics.ini
    Cockpit=RX3_73_cockpitinfo.ini
    Upgrades=RX3_73_Upgrades.ini
    AIUpgradeClass=RX3


    Number=08
    Team="Mazda RX-3 #08"
    PitGroup="Mazda RX-3"
    Driver="Roger Mandeville"
    Description="08 Roger Mandeville"
    Engine="12A Rotary"
    Manufacturer="Mazda"
    Classes="Mazda RX-3, 80s_jap"

    FullTeamName="Mazda RX-3 1973"

    can you tell me what i need to enter in the "Genstring=" for that Ai car to use the second rear wing
    i can post the 2 files (GEN and VEH) if you need them
    the car all so has about 7 sets of wheels it is a convert from rfactor 1
    gmts for the rewing i have are
    none
    maz_rx3_73_wing_b_loda
    maz_rx3_73_wing_race_loda


    thank you for you help
     
    Last edited: Mar 1, 2023
  7. Brutten

    Brutten Registered

    Joined:
    Jun 21, 2017
    Messages:
    363
    Likes Received:
    365
    In this case forget about GENSTRING.

    <RWING1>, <RWING2>, <RWING3> hacen referencia al archivo UPGRADES.

    You can create an UpgradeClass category for the AI in each VEH file and create the entries in the Upgrades file.

    VEH:
    HDVehicle=KL3C.hdv
    Graphics=KL3C.gen
    Spinner=KL3C_spinner.gen
    GenString=
    Sounds=KL3C_snd.json
    Cameras=KL3C.cam
    HeadPhysics=HeadPhysics_KartL3C.ini
    Cockpit=KL3C_cockpitinfo.ini
    Upgrades=KL3C_upgrades.ini
    AIUpgradeClass=KL3C-ALQUILER
    ExternalDisplays=KL3C_externaldisplays.ini


    UPGRADES:
    UpgradeClass="KL3C-ALQUILER"
    {
    AIList
    {
    Modelo de Kart=0
    }
    }

    UpgradeClass="KL3C-ALQUILER PRO"
    {
    AIList
    {
    Modelo de Kart=1
    }
    }
    UpgradeClass="KL3C-COMPETICION"
    {
    AIList
    {
    Modelo de Kart=2
    }
    }

    (...)

    UpgradeType="Modelo de Kart"
    {
    UpgradeLevel="KL3C-ALQUILER"
    {
    (Whatever you need)
    }
    }
    UpgradeType="Modelo de Kart"
    {
    UpgradeLevel="KL3C-ALQUILER-PRO"
    {
    (Whatever you need)
    }
    }
    UpgradeType="Modelo de Kart"
    {
    UpgradeLevel="KL3C-COMPETICION"
    {
    (Whatever you need)
    }
    }


    I hope I have not made any mistakes.
     
  8. ling

    ling Registered

    Joined:
    Jan 24, 2023
    Messages:
    156
    Likes Received:
    123
    thanks for you help but i can not get it to work
    in my RX3_73_08.VEH file i entered
    HDVehicle=KL3C.hdv
    Graphics=KL3C.gen
    Spinner=KL3C_spinner.gen
    GenString=
    Sounds=KL3C_snd.json
    Cameras=KL3C.cam
    HeadPhysics=HeadPhysics_KartL3C.ini
    Cockpit=KL3C_cockpitinfo.ini
    Upgrades=KL3C_upgrades.ini
    AIUpgradeClass=KL3C-ALQUILER
    ExternalDisplays=KL3C_externaldisplays.ini


    and in the upgrades.ini file i entered
    UpgradeClass="KL3C-ALQUILER"
    {
    RX3_73_08
    {
    Modelo de Kart=0
    }
    }

    UpgradeClass="KL3C-ALQUILER PRO"
    {
    AIList
    {
    Modelo de Kart=1
    }
    }
    UpgradeClass="KL3C-COMPETICION"
    {
    AIList
    {
    Modelo de Kart=2
    }
    }

    (...)

    UpgradeType="Modelo de Kart"
    {
    UpgradeLevel="KL3C-ALQUILER"
    {

    UpgradeLevel="Rear Wing Type I"

    Description="Rear Wing Type I"
    GEN=<RWINGEXISTS>=""
    GEN=<RWING1>=MAZ_RX3_73_WING_B_LODA.gmt
    GEN=<RWING2>=MAZ_RX3_73_WING_B_LODB.gmt
    GEN=<RWING3>=MAZ_RX3_73_WING_B_LODC.gmt
    }
    }
    UpgradeType="Modelo de Kart"
    {
    UpgradeLevel="KL3C-ALQUILER-PRO"
    {
    (Whatever you need)
    }
    }
    UpgradeType="Modelo de Kart"
    {
    UpgradeLevel="KL3C-COMPETICION"
    {
    (Whatever you need)
    }
    }

    what should i enter in
    AIList
    and
    (Whatever you need)

    thanks again
     
  9. ling

    ling Registered

    Joined:
    Jan 24, 2023
    Messages:
    156
    Likes Received:
    123
    had a play around with it and in the end i made a new KL3C_upgrades.ini file and copied all the information from the original upgrades.ini file (RX3_73_Upgrades.ini) i then move the wheel set up to the first choice in the KL3C_upgrades.ini and then added that to the teams RX3_73_08.veh file
    DefaultLivery="RX3_73_08.dds"

    HDVehicle=RX3_73.hdv
    Graphics=RX3_73.gen
    Spinner=RX3_73_SPINNER.gen
    Genstring=

    Sounds=RX3_73.sfx
    Cameras=RX3_73_cams.cam
    HeadPhysics=RX3_73_headphysics.ini
    Cockpit=RX3_73_cockpitinfo.ini
    Upgrades=KL3C_upgrades.ini
    AIUpgradeClass=RX3

    and started the game in dev mode and the Ai used diffrent wheels on the same teams RX3_73_08 car.

    Screenshot (199).png Screenshot (201).png Screenshot (202).png
    works with car spoilers as well


    this is in dev mode
    only seems to work in dev mode edit i repackaged the mod using no compression and it worked in normal mode now
     

    Attached Files:

    Last edited: Mar 2, 2023
    doddynco likes this.
  10. Brutten

    Brutten Registered

    Joined:
    Jun 21, 2017
    Messages:
    363
    Likes Received:
    365
    Have you checked that all vehicles are assigned AIUpgradeClass and that they are written correctly?

    By the way KL3C was an example haha, it's my Kart Las3Caras.
     
  11. ling

    ling Registered

    Joined:
    Jan 24, 2023
    Messages:
    156
    Likes Received:
    123
    i dont know if it is written correctly (i dont really know what i am doing just messing about) but
    i repackaged the mod using no compression and it worked (only tried it on 1 team) but i think it only picks from the first 2 upgrades like if you have 3 rear wings

    UpgradeLevel="No Wing"
    UpgradeLevel="Rear Wing Type I"
    UpgradeLevel="Rear Wing Type II"

    i have only seen the Ai use the first 2 in a race same with wheels and front spoiler at least this is something.
    thanks for your help
     
  12. Brutten

    Brutten Registered

    Joined:
    Jun 21, 2017
    Messages:
    363
    Likes Received:
    365
    Maybe you are not using the correct UpgradeLevel number.
    Let me explain:
    To select the first UpgradeLevel you should use the number 0.
    To select the second UpgradeLevel you should use the number 1
    To select the third UpgradeLevel you should use the number 2
    and so on.
     
    ling likes this.
  13. ling

    ling Registered

    Joined:
    Jan 24, 2023
    Messages:
    156
    Likes Received:
    123
    I do not know were to put that number (like i said this is all new to me) but the way i have done it the Ai do use random upgrades (even if it is only 2 things) but i was thinking if you could get the Ai to randomly chose between a engine with say 10% more power and using 10% more fuel than a standard engine which has normal power and fuel consumption it would make racing against the Ai off line more interesting some cars would be faster but have to pit more and because it was random and you have no control over which car did which every race would be different.
    thanks
     
  14. Brutten

    Brutten Registered

    Joined:
    Jun 21, 2017
    Messages:
    363
    Likes Received:
    365
    The number I indicated is the number to put in the upgrades file in the AIList section.
    This number indicates the forced specifications for an indicated selection for the AI.

    In the example I gave you I marked with colors the sections and the options so that you could understand it better.
    I don't speak English so it is difficult for me to explain better.

    You can't do any of this randomly, you must indicate in each vehicle what you want it to do.
     
  15. ling

    ling Registered

    Joined:
    Jan 24, 2023
    Messages:
    156
    Likes Received:
    123
    your English is better than mine (and i live in England) all i know is with what i have added the Ai now pick the 1st or 2nd item randomly ie one car will have say black wheels and a spoiler and the other will have white wheels and no spoiler if you look at the pic of the number 8 car ( RX3_73_08.VEH) they are both Ai cars and one has black wheels and one has chrome wheels it is the same veh file but the Ai are selecting different wheels randomly to load, same with front spoiler you can see it in one of the pic.
    thanks
     
    Last edited: Mar 2, 2023
  16. Brutten

    Brutten Registered

    Joined:
    Jun 21, 2017
    Messages:
    363
    Likes Received:
    365
    I am glad to see that the translator I use (DeepL) is effective.
     
  17. ling

    ling Registered

    Joined:
    Jan 24, 2023
    Messages:
    156
    Likes Received:
    123
    i think i need to use that.
    and thanks again for your help
     
  18. Brutten

    Brutten Registered

    Joined:
    Jun 21, 2017
    Messages:
    363
    Likes Received:
    365
    Espero que lo consigas.
    I hope you get it.
     

Share This Page