Log in to reply
 

How to fix tuning parts and lights not working on addons or making your own car packs



  • Here's a radical thought... what would happen if you created a carcols.ymt file along with a matching carvariations.ymt file, that removed every modkit from the vanilla vehicles and only left them with the 0_default_modkit entry? Actually, you could create an empty carcols file couldn't you and then just modify the carvariations file?

    And if you create those files, and created an addon pack to hold them, where would it need to go in the load order to be most effective? Or would you move common.rpf into the mods folder and put it in there... or update.rpf perhaps?

    I mean, my feeling now is that you either go into this with both feet, or you don't go in at all. Fighting with the vanilla modkits is a fruitless task, so I think it requires an all or nothing solution.



  • This post is deleted!


  • Aaaaaaaand just when you thought the default modkits couldn't get complicated.

    <Item>0_default_modkit</Item>
    <Item>0_default_no_lower</Item>
    <Item>0_bike_modkit</Item>
    <Item>0_cvtgeabox_modkit</Item>
    <Item>0_hiend_modkit</Item>
    <Item>0_lowcar_modkit</Item>
    <Item>0_sport_modkit</Item>
    <Item>0_suv_modkit</Item>
    

    That turns a simple fix into a rather more complicated process... :( is there no end to this mess?



  • @LeeC2202 said in How to fix tuning parts and lights not working on addons or making your own car packs:

    Aaaaaaaand just when you thought the default modkits couldn't get complicated.

    <Item>0_default_modkit</Item>
    <Item>0_default_no_lower</Item>
    <Item>0_bike_modkit</Item>
    <Item>0_cvtgeabox_modkit</Item>
    <Item>0_hiend_modkit</Item>
    <Item>0_lowcar_modkit</Item>
    <Item>0_sport_modkit</Item>
    <Item>0_suv_modkit</Item>

    That turns a simple fix into a rather more complicated process... :( is there no end to this mess?

    And... those aren't all "0" :)

    For instance the 0_bike_modkit becomes 7 in game :D



  • @sjaak327 said in How to fix tuning parts and lights not working on addons or making your own car packs:

    And... those aren't all "0" :)

    For instance the 0_bike_modkit becomes 7 in game :D

    You know, that almost makes sense**... when I interrogated the docs, the lowest number I could find was 8.

    So if we consider that those 8 I have listed start at 0, that would (if we were dealing with any kind of logic) imply that 0 - 7 were reserved for those default modkits.

    However, this is GTAV, there is no logic... I don't know if I should :D or :cry: or just do both and have done with it.

    **Disclaimer: Nothing makes sense with GTAV and ModKit IDs and I reserve the right to plead insanity if/when required ;)



  • Will be updating this soon to include new information to help get you past the 255 limit of cars with working tuning parts. And also adding more information on how to add more rims into the game by using my carcols.ymt method.



  • @Willief23 The limit isn't 255, it's less than that. Some IDs are not used (or are invalid) and IDs above 235 are reassigned by the game to give you lower values.

    The carcols.ymt method simply works by stealing the IDs from the vanilla vehicles, which would be assigned in carvariations.meta. Which is why the numbers in carcols.ymt stop before the numbers in carcols.meta takes over.

    IIRC, IDs stopped at 78 in carcols.ymt and the next ID of 79 was assigned in carvariations.meta. There's never any overlap, it's one or the other.



  • This post is deleted!


  • @Willief23 Let me just quote from the thread yesterday.

    Then there is the fact that the ID your car is given in the game, is usually different to the ID you set in the documents. As another example, I have a car with an ID of 254, yet if I spawn that car in the game, it actually has an ID of 235.

    Both cars will be spawned with an ID that is very probably unrelated to the numbers you set in the documents. They will both be spawned with a valid ID from the pool of valid IDs the game allows. That pool can only contain numbers from 1 - 235, so all the game has probably done, is used an ID that one of your other cars might have had.

    So whilst they both tuned fine, you can't guarantee that every other car you have got, would also spawn and tune fine. The only way you will prove this, is by systematically spawning 255 cars and checking their tuning.

    Success will lul you into a false sense of winning, then at the last moment it will play a joker and crush your theories... or at least that seems to be my experience... damn this game. :D


  • MODERATOR

    @LeeC2202 said in How to fix tuning parts and lights not working on addons or making your own car packs:

    @Willief23 The limit isn't 255, it's less than that. Some IDs are not used (or are invalid) and IDs above 235 are reassigned by the game to give you lower values.

    The carcols.ymt method simply works by stealing the IDs from the vanilla vehicles, which would be assigned in carvariations.meta. Which is why the numbers in carcols.ymt stop before the numbers in carcols.meta takes over.

    IIRC, IDs stopped at 78 in carcols.ymt and the next ID of 79 was assigned in carvariations.meta. There's never any overlap, it's one or the other.

    Sad, but true, my friend. Unknown Modder has demonstrated, quite convincingly, that the car ID is defined as an 8-bit value. No amount of wishful thinking on our end can change that.



  • @meimeiriver said in How to fix tuning parts and lights not working on addons or making your own car packs:

    Sad, but true, my friend. Unknown Modder has demonstrated, quite convincingly, that the car ID is defined as an 8-bit value. No amount of wishful thinking on our end can change that.

    And here's the code that he showed us...

    char __fastcall SET_VEHICLE_MOD_KIT(signed int vehicle, unsigned int modKitId)
    {
      __int64 v2; // rbx@1
      __int64 v3; // rax@1
      __int64 v4; // rdx@2
      __int64 v5; // rcx@4
      __int64 v6; // rdx@4
    
      v2 = modKitId;
      v3 = GetScriptHandleAddressVehicleCheck(vehicle); // CVehicle
      if ( v3 )
      {
    	v4 = *(_QWORD *)(v3 + 0x20); // CVehicleModelInfo
    	if ( (signed int)v2 >= 0 && (unsigned int)v2 < *(_WORD *)(v4 + 0x290) ) // numModKits (16-bit)
    	{
    	  v5 = *(_QWORD *)(v4 + 0x288); // pointer to the mod kits
    	  v6 = *(_QWORD *)(v3 + 0x48); // CVehicleDrawHandler
    	  LOBYTE(v3) = *(_BYTE *)(v2 + v5); **// get mod kit from the mod kit list (lower 8 bits)**
    	  *(_BYTE *)(v6 + 0x3F4) = v3; **// set the mod kit (8-bit value)**
    	}
      }
      return v3;
    }


  • This post is deleted!


  • @Willief23 I just wrote a small mod that displays it but it doesn't really matter. What you see as a conflict in your documents, might not be a conflict in the game... and this is the real problem.

    What you enter and what the game uses are often different, you ultimately have very little control, other than being able to enter a number that convinces you, you are having an effect.

    There is something else at work in this whole modkit ID lark and until we work out what that is, we're basically just rolling a dice.


  • MODERATOR

    And I have given up trying completely.

    Too many cars with tuning I like. Probably I'll use the modkit_ID's I found working for me in my musclecars dlcpack.

    I'm just importing cars now whilst making sure tuning works by testing it with a single test_ID I reuse over and over. After test and initial spawn, it gets renamed to xxx_mods and onto the next car.

    I've got thumbnails to worry about now :smiley_cat:



  • Here's a fine example.. 1005 in the docs, 237 as an 8-bit value, 217 in-game.

    Interestingly, the Bodhi2 that Trevor owns has 14 in the docs and got 14 in-game.

    However, the Zombieb, which has an ID of 181 in the docs, got 171 in-game, so even the vanilla vehicles are not immune.

    alt text



  • If you want the simple script I am using, paste this code into a text file called DisplayVehicleModkitID.cs and drop it into your scripts folder.

    using System;
    using GTA;
    using GTA.Native;
    
    namespace DisplayVehicleModkitID
    {
        public class cDisplayVehicleModkitID : Script
        {
            public cDisplayVehicleModkitID()
            {
                this.Tick += onTick;
                Interval = 1000;
            }
    
            private void onTick(object sender, EventArgs e)
            {
                // Check to see if the player is sat in a vehicle
                if (Game.Player.Character.IsSittingInVehicle())
                {
    				Vehicle _currentVehicle = Game.Player.Character.CurrentVehicle;
    				int _id = Function.Call<int>(Hash.GET_VEHICLE_MOD_KIT, _currentVehicle);
    				string _name = _currentVehicle.DisplayName;
    				UI.ShowSubtitle(string.Format("{0} ModKit ID = {1}", _name, _id));
                }
            }
        }
    }
    

  • MODERATOR

    I might finally know what's going on with the mod kits. Will do more research when I have enough time and confirm my findings.

    In the meantime, here's a list of the mod kits defined in the files (lower 8 bits) and the actual values in-game. I can now get both at runtime:

    adder = 2 (in-game: 2)
    airbus = *none*
    airtug = *none*
    akuma = 11 (in-game: 11)
    alpha = 95 (in-game: 92)
    ambulance = 0 (in-game: 0)
    annihilator = *none*
    armytanker = *none*
    armytrailer = *none*
    armytrailer2 = *none*
    asea = 24 (in-game: 24)
    asea2 = *none*
    asterope = 0 (in-game: 0)
    avarus = 182 (in-game: 172)
    bagger = 63 (in-game: 63)
    baletrailer = *none*
    baller = 22 (in-game: 22)
    baller2 = 4 (in-game: 4)
    baller3 = 0 (in-game: 0)
    baller4 = 0 (in-game: 0)
    baller5 = 0 (in-game: 0)
    baller6 = 0 (in-game: 0)
    banshee = 51 (in-game: 51)
    banshee2 = 131 (in-game: 140)
    barracks = *none*
    barracks2 = *none*
    barracks3 = *none*
    bati = 7 (in-game: 7)
    bati2 = 81 (in-game: 81)
    benson = *none*
    besra = *none*
    bestiagts = 133 (in-game: 149)
    bf400 = 174 (in-game: 168)
    bfinjection = 0 (in-game: 0)
    biff = *none*
    bifta = 87 (in-game: 87)
    bison = 4 (in-game: 4)
    bison2 = 4 (in-game: 4)
    bison3 = 0 (in-game: 0)
    bjxl = 41 (in-game: 41)
    blade = 99 (in-game: 99)
    blazer = 0 (in-game: 0)
    blazer2 = 0 (in-game: 0)
    blazer3 = 0 (in-game: 0)
    blazer4 = 192 (in-game: 184)
    blazer5 = 0 (in-game: 0)
    blimp = *none*
    blimp2 = *none*
    blista = 36 (in-game: 36)
    blista2 = 154 (in-game: 210)
    blista3 = 155 (in-game: 211)
    bmx = *none*
    boattrailer = *none*
    bobcatxl = 4 (in-game: 4)
    bodhi2 = 14 (in-game: 14)
    boxville = *none*
    boxville2 = *none*
    boxville3 = *none*
    boxville4 = *none*
    boxville5 = 0 (in-game: 0)
    brawler = 163 (in-game: 120)
    brickade = 0 (in-game: 0)
    brioso = 140 (in-game: 157)
    btype = 0 (in-game: 0)
    btype2 = 118 (in-game: 130)
    btype3 = 148 (in-game: 141)
    buccaneer = 25 (in-game: 25)
    buccaneer2 = 153 (in-game: 123)
    buffalo = 13 (in-game: 13)
    buffalo2 = 66 (in-game: 66)
    bulldozer = *none*
    bullet = 2 (in-game: 2)
    burrito = 0 (in-game: 0)
    burrito2 = 0 (in-game: 0)
    burrito3 = 0 (in-game: 0)
    burrito4 = 0 (in-game: 0)
    burrito5 = 0 (in-game: 0)
    bus = *none*
    buzzard = *none*
    buzzard2 = *none*
    cablecar = *none*
    caddy = *none*
    caddy2 = *none*
    camper = *none*
    carbonizzare = 76 (in-game: 76)
    carbonrs = 7 (in-game: 7)
    cargobob = *none*
    cargobob2 = *none*
    cargobob3 = *none*
    cargobob4 = *none*
    cargoplane = *none*
    casco = 0 (in-game: 0)
    cavalcade = 15 (in-game: 15)
    cavalcade2 = 4 (in-game: 4)
    cheetah = 70 (in-game: 70)
    chimera = 188 (in-game: 182)
    chino = 201 (in-game: 121)
    chino2 = 117 (in-game: 128)
    cliffhanger = 175 (in-game: 169)
    coach = *none*
    cog55 = 0 (in-game: 0)
    cog552 = 0 (in-game: 0)
    cogcabrio = 3 (in-game: 3)
    cognoscenti = 0 (in-game: 0)
    cognoscenti2 = 0 (in-game: 0)
    comet2 = 56 (in-game: 56)
    comet3 = 213 (in-game: 192)
    contender = 0 (in-game: 0)
    coquette = 69 (in-game: 69)
    coquette2 = 105 (in-game: 104)
    coquette3 = 166 (in-game: 122)
    cruiser = *none*
    crusader = *none*
    cuban800 = *none*
    cutter = *none*
    daemon = 19 (in-game: 19)
    daemon2 = 186 (in-game: 178)
    defiler = 183 (in-game: 174)
    diablous = 0 (in-game: 0)
    diablous2 = 209 (in-game: 194)
    dilettante = 1 (in-game: 1)
    dilettante2 = 1 (in-game: 1)
    dinghy = *none*
    dinghy2 = *none*
    dinghy3 = *none*
    dinghy4 = *none*
    dloader = 0 (in-game: 0)
    docktrailer = *none*
    docktug = *none*
    dodo = *none*
    dominator = 33 (in-game: 33)
    double = 21 (in-game: 21)
    double = 0 (in-game: 0)
    dubsta = 8 (in-game: 8)
    dubsta2 = 30 (in-game: 30)
    dubsta3 = 103 (in-game: 102)
    dump = *none*
    dune = 0 (in-game: 0)
    dune2 = *none*
    dune4 = 6 (in-game: 6)
    dune5 = 6 (in-game: 6)
    duster = *none*
    elegy = 211 (in-game: 193)
    elegy2 = 37 (in-game: 37)
    emperor = 0 (in-game: 0)
    emperor2 = 0 (in-game: 0)
    emperor3 = 0 (in-game: 0)
    enduro = 109 (in-game: 112)
    entityxf = 68 (in-game: 68)
    esskey = 195 (in-game: 183)
    exemplar = 3 (in-game: 3)
    f620 = 3 (in-game: 3)
    faction = 0 (in-game: 0)
    faction2 = 170 (in-game: 124)
    faction3 = 147 (in-game: 144)
    faggio = 7 (in-game: 7)
    faggio2 = 7 (in-game: 7)
    faggio3 = 197 (in-game: 187)
    fbi = 0 (in-game: 0)
    fbi2 = 0 (in-game: 0)
    fcr = 202 (in-game: 201)
    fcr2 = 204 (in-game: 200)
    felon = 34 (in-game: 34)
    felon2 = 5 (in-game: 5)
    feltzer2 = 10 (in-game: 10)
    feltzer3 = 168 (in-game: 117)
    firetruk = *none*
    fixter = *none*
    flatbed = *none*
    fmj = 138 (in-game: 154)
    forklift = *none*
    fq2 = 0 (in-game: 0)
    freight = *none*
    freightcar = *none*
    freightcont1 = *none*
    freightcont2 = *none*
    freightgrain = *none*
    freighttrailer = *none*
    frogger = *none*
    frogger2 = *none*
    fugitive = 6 (in-game: 6)
    furoregt = 0 (in-game: 0)
    fusilade = 49 (in-game: 49)
    futo = 9 (in-game: 9)
    gargoyle = 173 (in-game: 156)
    gauntlet = 5 (in-game: 5)
    gauntlet2 = 0 (in-game: 0)
    gburrito = 0 (in-game: 0)
    gburrito2 = 107 (in-game: 110)
    glendale = 100 (in-game: 100)
    gp1 = 223 (in-game: 206)
    graintrailer = *none*
    granger = 4 (in-game: 4)
    gresley = 39 (in-game: 39)
    guardian = 108 (in-game: 111)
    habanero = 6 (in-game: 6)
    hakuchou = 7 (in-game: 7)
    hakuchou2 = 191 (in-game: 176)
    handler = *none*
    hauler = *none*
    hexer = 7 (in-game: 7)
    hotknife = 62 (in-game: 62)
    huntley = 94 (in-game: 95)
    hydra = *none*
    infernus = 79 (in-game: 79)
    infernus2 = 221 (in-game: 205)
    ingot = 0 (in-game: 0)
    innovation = 7 (in-game: 7)
    insurgent = 0 (in-game: 0)
    insurgent2 = 0 (in-game: 0)
    intruder = 75 (in-game: 75)
    issi2 = 40 (in-game: 40)
    italigtb = 207 (in-game: 198)
    italigtb2 = 208 (in-game: 199)
    jackal = 29 (in-game: 29)
    jb700 = 2 (in-game: 2)
    jester = 92 (in-game: 90)
    jester2 = 156 (in-game: 106)
    jet = *none*
    jetmax = *none*
    journey = *none*
    kalahari = 88 (in-game: 88)
    khamelion = 53 (in-game: 53)
    kuruma = 110 (in-game: 113)
    kuruma2 = 110 (in-game: 113)
    landstalker = 42 (in-game: 42)
    lazer = *none*
    le7b = 178 (in-game: 160)
    lectro = 7 (in-game: 7)
    lguard = 0 (in-game: 0)
    limo2 = 0 (in-game: 0)
    lurcher = 116 (in-game: 129)
    luxor = *none*
    luxor2 = *none*
    lynx = 142 (in-game: 158)
    mamba = 125 (in-game: 135)
    mammatus = *none*
    manana = 64 (in-game: 64)
    manchez = 193 (in-game: 185)
    marquis = *none*
    marshall = 149 (in-game: 212)
    massacro = 91 (in-game: 94)
    massacro2 = 157 (in-game: 107)
    maverick = *none*
    mesa = 4 (in-game: 4)
    mesa2 = *none*
    mesa3 = 4 (in-game: 4)
    metrotrain = *none*
    miljet = *none*
    minivan = 0 (in-game: 0)
    minivan2 = 132 (in-game: 148)
    mixer = *none*
    mixer2 = *none*
    monroe = 5 (in-game: 5)
    monster = 7 (in-game: 7)
    moonbeam = 0 (in-game: 0)
    moonbeam2 = 115 (in-game: 125)
    mower = *none*
    mule = *none*
    mule2 = 0 (in-game: 0)
    mule3 = *none*
    nemesis = 7 (in-game: 7)
    nero = 206 (in-game: 195)
    nero2 = 212 (in-game: 196)
    nightblade = 185 (in-game: 175)
    nightshade = 122 (in-game: 132)
    nimbus = *none*
    ninef = 32 (in-game: 32)
    ninef2 = 18 (in-game: 18)
    omnis = 141 (in-game: 159)
    oracle = 3 (in-game: 3)
    oracle2 = 72 (in-game: 72)
    osiris = 160 (in-game: 114)
    packer = *none*
    panto = 102 (in-game: 101)
    paradise = 89 (in-game: 89)
    patriot = 4 (in-game: 4)
    pbus = *none*
    pcj = 47 (in-game: 47)
    penetrator = 205 (in-game: 197)
    penumbra = 35 (in-game: 35)
    peyote = 67 (in-game: 67)
    pfister811 = 134 (in-game: 150)
    phantom = *none*
    phantom2 = 0 (in-game: 0)
    phoenix = 31 (in-game: 31)
    picador = 6 (in-game: 6)
    pigalle = 104 (in-game: 103)
    police = 0 (in-game: 0)
    police2 = 0 (in-game: 0)
    police3 = 16 (in-game: 16)
    police4 = 0 (in-game: 0)
    policeb = *none*
    policeold1 = *none*
    policeold2 = *none*
    policet = 0 (in-game: 0)
    polmav = 86 (in-game: 86)
    pony = 0 (in-game: 0)
    pony = 0 (in-game: 0)
    pony2 = 0 (in-game: 0)
    pounder = *none*
    prairie = 55 (in-game: 55)
    pranger = 0 (in-game: 0)
    predator = *none*
    premier = 43 (in-game: 43)
    primo = 54 (in-game: 54)
    primo2 = 114 (in-game: 126)
    proptrailer = *none*
    prototipo = 135 (in-game: 151)
    radi = 0 (in-game: 0)
    raketrailer = *none*
    rallytruck = 177 (in-game: 165)
    rancherxl = 4 (in-game: 4)
    rancherxl2 = 0 (in-game: 0)
    rapidgt = 77 (in-game: 77)
    rapidgt2 = 80 (in-game: 80)
    raptor = 0 (in-game: 0)
    ratbike = 187 (in-game: 179)
    ratloader = 27 (in-game: 27)
    ratloader2 = 158 (in-game: 108)
    reaper = 139 (in-game: 155)
    rebel = 48 (in-game: 48)
    rebel2 = 4 (in-game: 4)
    regina = 0 (in-game: 0)
    rentalbus = *none*
    rhapsody = 97 (in-game: 97)
    rhino = *none*
    riot = *none*
    ripley = *none*
    rocoto = 4 (in-game: 4)
    romero = 0 (in-game: 0)
    rubble = *none*
    ruffian = 17 (in-game: 17)
    ruiner = 44 (in-game: 44)
    ruiner2 = 0 (in-game: 0)
    ruiner3 = 0 (in-game: 0)
    rumpo = 85 (in-game: 85)
    rumpo2 = 0 (in-game: 0)
    rumpo3 = 0 (in-game: 0)
    ruston = 217 (in-game: 204)
    sabregt = 71 (in-game: 71)
    sabregt2 = 172 (in-game: 143)
    sadler = 4 (in-game: 4)
    sadler2 = 0 (in-game: 0)
    sanchez = 82 (in-game: 82)
    sanchez2 = 82 (in-game: 82)
    sanctus = 194 (in-game: 173)
    sandking = 59 (in-game: 59)
    sandking2 = 60 (in-game: 60)
    savage = *none*
    schafter2 = 52 (in-game: 52)
    schafter3 = 123 (in-game: 133)
    schafter4 = 124 (in-game: 134)
    schafter5 = 126 (in-game: 136)
    schafter6 = 127 (in-game: 137)
    schwarzer = 58 (in-game: 58)
    scorcher = *none*
    scrap = *none*
    seashark = *none*
    seashark2 = *none*
    seashark3 = *none*
    seminole = 4 (in-game: 4)
    sentinel = 50 (in-game: 50)
    sentinel2 = 61 (in-game: 61)
    serrano = 46 (in-game: 46)
    seven70 = 137 (in-game: 153)
    shamal = 84 (in-game: 84)
    sheava = 179 (in-game: 166)
    sheriff = 0 (in-game: 0)
    sheriff2 = 0 (in-game: 0)
    shotaro = 199 (in-game: 188)
    skylift = *none*
    slamvan = 159 (in-game: 109)
    slamvan2 = 159 (in-game: 109)
    slamvan3 = 171 (in-game: 142)
    sovereign = 7 (in-game: 7)
    specter = 216 (in-game: 189)
    specter2 = 214 (in-game: 191)
    speeder = *none*
    speeder2 = *none*
    speedo = 0 (in-game: 0)
    speedo2 = 0 (in-game: 0)
    squalo = *none*
    stalion = 0 (in-game: 0)
    stalion2 = 0 (in-game: 0)
    stanier = 6 (in-game: 6)
    stinger = 2 (in-game: 2)
    stingergt = 2 (in-game: 2)
    stockade = *none*
    stockade3 = *none*
    stratum = 0 (in-game: 0)
    stretch = 0 (in-game: 0)
    stunt = 83 (in-game: 83)
    submersible = *none*
    sultan = 45 (in-game: 45)
    sultanrs = 130 (in-game: 139)
    suntrap = *none*
    superd = 2 (in-game: 2)
    supervolito = *none*
    supervolito2 = *none*
    surano = 28 (in-game: 28)
    surfer = 0 (in-game: 0)
    surfer2 = 0 (in-game: 0)
    surge = 26 (in-game: 26)
    swift = 106 (in-game: 105)
    swift2 = 106 (in-game: 105)
    t20 = 161 (in-game: 118)
    taco = *none*
    tailgater = 12 (in-game: 12)
    tampa = 128 (in-game: 138)
    tampa2 = 143 (in-game: 162)
    tanker = *none*
    tanker2 = *none*
    tankercar = *none*
    taxi = 0 (in-game: 0)
    technical = 0 (in-game: 0)
    technical2 = 6 (in-game: 6)
    tempesta = 210 (in-game: 202)
    thrust = 96 (in-game: 96)
    tiptruck = *none*
    tiptruck2 = *none*
    titan = *none*
    tornado = 65 (in-game: 65)
    tornado2 = 65 (in-game: 65)
    tornado3 = 0 (in-game: 0)
    tornado4 = 0 (in-game: 0)
    tornado5 = 113 (in-game: 146)
    tornado6 = 196 (in-game: 186)
    toro = 0 (in-game: 0)
    toro2 = 0 (in-game: 0)
    tourbus = *none*
    towtruck = *none*
    towtruck2 = 0 (in-game: 0)
    tr2 = *none*
    tr3 = *none*
    tr4 = *none*
    tractor = *none*
    tractor2 = *none*
    tractor3 = *none*
    trailerlogs = *none*
    trailers = *none*
    trailers2 = *none*
    trailers3 = *none*
    trailersmall = *none*
    trash = *none*
    trash2 = *none*
    trflat = 0 (in-game: 0)
    tribike = *none*
    tribike2 = *none*
    tribike3 = *none*
    trophytruck = 144 (in-game: 163)
    trophytruck2 = 176 (in-game: 164)
    tropic = *none*
    tropic2 = *none*
    tropos = 145 (in-game: 167)
    tug = *none*
    turismo2 = 225 (in-game: 203)
    turismor = 93 (in-game: 91)
    tvtrailer = *none*
    tyrus = 146 (in-game: 161)
    utillitruck = *none*
    utillitruck2 = *none*
    utillitruck3 = *none*
    vacca = 78 (in-game: 78)
    vader = 7 (in-game: 7)
    valkyrie = *none*
    valkyrie2 = *none*
    velum = *none*
    velum2 = *none*
    verlierer2 = 121 (in-game: 131)
    vestra = *none*
    vigero = 57 (in-game: 57)
    vindicator = 162 (in-game: 119)
    virgo = 164 (in-game: 115)
    virgo2 = 119 (in-game: 145)
    virgo3 = 0 (in-game: 0)
    volatus = *none*
    voltic = 38 (in-game: 38)
    voltic2 = 215 (in-game: 190)
    voodoo = 112 (in-game: 127)
    voodoo2 = 6 (in-game: 6)
    vortex = 190 (in-game: 181)
    warrener = 98 (in-game: 98)
    washington = 0 (in-game: 0)
    wastelander = 0 (in-game: 0)
    windsor = 167 (in-game: 116)
    windsor2 = 136 (in-game: 152)
    wolfsbane = 189 (in-game: 180)
    xls = 0 (in-game: 0)
    xls2 = 0 (in-game: 0)
    youga = 23 (in-game: 23)
    youga2 = 198 (in-game: 177)
    zentorno = 90 (in-game: 93)
    zion = 73 (in-game: 73)
    zion2 = 74 (in-game: 74)
    zombiea = 180 (in-game: 170)
    zombieb = 181 (in-game: 171)
    ztype = 20 (in-game: 20)
    


  • @Unknown-Modder That's excellent, thanks for posting that.

    Could you perhaps elaborate on your method for obtaining those numbers please? Or is this another of those instances where SHVDN isn't really suitable for this kind of data processing?

    This is the kind of information that is proving really helpful in the addon tool I am making. The more accurate the data I can work with, the more reliable the end result will be.


  • MODERATOR

    @LeeC2202 It's basically just this

    DWORD64 modKitsAddr = *(DWORD64*)(g_vehicleModelInfoVarGlobal + 0x58);
    
    for (auto& pair : vehicle_hash_table)
    {
    	CVehicleModelInfo* info = CVehicleModelInfo::GetByHash(pair.hash);
    	if (info != nullptr)
    	{
    		if (info->modKitsCount > 0)
    		{
    			for (UINT16 i = 0; i < info->modKitsCount; i++)
    			{
    				BYTE modKitIndex = *(BYTE*)((DWORD64)info->modKitsPtr + i);
    				if (modKitIndex >= 0 && modKitIndex <= 255)
    				{
    					BYTE modKit = *(BYTE*)(modKitsAddr + 0x70 * modKitIndex + 4);
    					Log("%s = %u (in-game: %u)\n", pair.name, modKit, modKitIndex);
    				}
    			}
    		}
    	}
    }
    


  • @Unknown-Modder Okay... I understand what that's doing and can see how some of it would translate over to SHVDN.

    I must confess, every time I see tempting information like this, it almost persuades me to try and learn C++... just not sure my brain is up to the task of another new language at my stage in life. Old age comes with a definite downside. :(

    There just seems to be a whole host of information just waiting to be gathered up and used... and that's the tempting part of it all.

    Thank you again for sharing the info... it is very much appreciated.


  • MODERATOR

    @LeeC2202 I think learning C++ isn't that complicated. It's all the libraries and additions to the standard that take a long time to learn. And dealing with memory is another story. If you don't need to learn it or don't want to then just don't do it, save your time and use unsafe code in C#.

    What I also wanted to point out is that there is also a mod kit array besides the mod kit info stored in CVehicleModelInfoVarGlobal. I'm not sure what's the purpose of this yet but as I said before, I'll look into it when I have enough time.

    void __fastcall SetModKitArrayValues(__int64 vehicleModelInfoVarGlobalAddr, int startVal, int size)
    {
      int v3; // er14@1
      int v4; // ebx@1
      __int64 i; // rsi@1
      __int64 v6; // rbp@2
      signed __int64 v7; // rdi@2
      unsigned __int8 v8; // al@2
    
      v3 = startVal + size;
      v4 = startVal;
      for ( i = vehicleModelInfoVarGlobalAddr; v4 < v3; ++v4 )
      {
        v6 = *(_QWORD *)(i + 0x58); // mod kit info
        v7 = 0x70i64 * (unsigned int)v4;
        v8 = *(_BYTE *)(v7 + v6 + 4);
        if ( v8 == -1 || g_modKitArr[v8] != -1 )
          *(_BYTE *)(v7 + v6 + 4) = SetModKitArrayValueAndReturnIndex(i, v4);
        g_modKitArr[*(_BYTE *)(v7 + *(_QWORD *)(i + 0x58) + 4)] = v4;
      }
    
    


  • @Unknown-Modder Could the modkit array contain all the possible modkit options in each section, that are assigned to that modkit ID.

    For instance, the car might have 10 spoilers, 3 bonnets, 2 skirts etc... that might be what is in that array.


  • MODERATOR

    @LeeC2202 No, this is stored in CVehicleModelInfoVarGlobal. The array does only contain the indices and has a size of 256.

    .data:0000000142322100 ; _BYTE g_modKitArr[256]
    .data:0000000142322100 g_modKitArr     db 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0Ah, 0Bh, 0Ch, 0Dh, 0Eh
    .data:0000000142322100                                         ; DATA XREF: sub_140142F7C+E8o
    .data:0000000142322100                                         ; sub_1404B3464+43o ...
    .data:0000000142322100                 db 0Fh, 10h, 11h, 12h, 13h, 14h, 15h, 16h, 17h, 18h, 19h
    .data:0000000142322100                 db 1Ah, 1Bh, 1Ch, 1Dh, 1Eh, 1Fh, 20h, 21h, 22h, 23h, 24h
    .data:0000000142322100                 db 25h, 26h, 27h, 28h, 29h, 2Ah, 2Bh, 2Ch, 2Dh, 2Eh, 2Fh
    .data:0000000142322100                 db 30h, 31h, 32h, 33h, 34h, 35h, 36h, 37h, 38h, 39h, 3Ah
    .data:0000000142322100                 db 3Bh, 3Ch, 3Dh, 3Eh, 3Fh, 40h, 41h, 42h, 43h, 44h, 45h
    .data:0000000142322100                 db 46h, 47h, 48h, 49h, 4Ah, 4Bh, 4Ch, 4Dh, 4Eh, 4Fh, 50h
    .data:0000000142322100                 db 51h, 52h, 53h, 54h, 55h, 56h, 57h, 58h, 59h, 5Dh, 5Eh
    .data:0000000142322100                 db 5Ah, 5Bh, 5Fh, 5Ch, 60h, 61h, 62h, 63h, 64h, 0FFh, 65h
    .data:0000000142322100                 db 66h, 67h, 68h, 69h, 6Eh, 6Fh, 70h, 71h, 0FFh, 7Fh, 92h
    .data:0000000142322100                 db 7Eh, 7Dh, 81h, 80h, 82h, 91h, 0FFh, 83h, 84h, 85h, 86h
    .data:0000000142322100                 db 87h, 88h, 89h, 8Ah, 0FFh, 8Bh, 8Ch, 94h, 95h, 96h, 97h
    .data:0000000142322100                 db 98h, 99h, 9Ah, 9Bh, 9Dh, 9Fh, 9Eh, 0A2h, 0A3h, 0A7h
    .data:0000000142322100                 db 0A1h, 90h, 8Dh, 0D0h, 0CBh, 0CCh, 0CDh, 7Bh, 0CEh, 0CFh
    .data:0000000142322100                 db 6Ah, 6Bh, 6Ch, 6Dh, 72h, 76h, 77h, 78h, 73h, 0FFh, 7Ah
    .data:0000000142322100                 db 74h, 75h, 0FFh, 7Ch, 8Eh, 8Fh, 9Ch, 0A8h, 0A9h, 0A4h
    .data:0000000142322100                 db 0A5h, 0A0h, 0A6h, 0AAh, 0ABh, 0ACh, 0AEh, 0FFh, 0AFh
    .data:0000000142322100                 db 0B2h, 0B3h, 0B6h, 0B4h, 0B5h, 0B0h, 0B8h, 0B9h, 0ADh
    .data:0000000142322100                 db 0B7h, 0BAh, 0BBh, 0B1h, 0BCh, 0FFh, 79h, 0C9h, 0FFh
    .data:0000000142322100                 db 0C8h, 0C5h, 0C3h, 0C6h, 0C7h, 0C2h, 0CAh, 0C1h, 0C4h
    .data:0000000142322100                 db 0C0h, 0BFh, 0BEh, 0BDh, 0Eh dup(0FFh), 93h, 18h dup(0FFh)
    


  • @Unknown-Modder Hmmm, I wonder if that's a lookup table to translate from the ID in the docs to the ID given by the game. :\

    There are a few 0FFh's in there, which could explain the random (random's not the right word... unexpected) invalid IDs with certain values.

    Edit: Or maybe an ID validation table... something along those lines anyway.

    Edit, just checked, entry 181 is ABh, which is 171

    zombieb = 181 (in-game: 171)


  • MODERATOR

    @LeeC2202 So I did a bit of research and found that even before CVehicleModelInfoVarGlobal is initialized, every item of the array will be set to 0xFF (aka 255).

    memset(g_modKitArr, 0xFF, 256ui64);
    

    After the array was filled with the correct values (see SetModKitArrayValues function I posted earlier) it will be used for some vehicle mods (not sure which ones though) when they are being set.

    v11 = *(_QWORD *)(v3 + 0x20); // vehicle->modelInfo
    if ( !((*(_DWORD *)(v11 + 0x550) >> 22) & 1) ) // FLAG_CANNOT_BE_MODDED
    {
        if ( (signed int)v14 >= 256 )
            v12 = -1;
        else
            v12 = g_modKitArr[v14];
        v14 = v12;
        LOBYTE(v11) = sub_140F023A8(v3, (__int64)&v14);
    }
    

Log in to reply
 

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.