How to edit parked cars?
Ok so, I will TRY to explain what I mean, hopefully you get what I'm trying to ask- popgroups don't control the randomly spawning vehicles in car parks and the vehiclemodelsets doesn't seem to control anything. For example, editing the LGUARD (or any police sections) section you'd expect to add more cars OR replace the LGUARD vehicle with another one but in-game the regular LGUARD spawns regardless so that file obviously does nothing either. Adding new lines spawns no new vehicles and replacing the original vehicles doesn't replace them in-game so these aren't the right files people claim that control these things.
So in a nutshell, how do you:
- Alter what cop cars spawn parked at cop stations?
- Alter what ambulances and fire trucks spawn parked at stations and hospitals?
- Alter what vehicles spawn parked in parking lots?
It seems that altering the previously mentioned files has no effect on these things, so what does exactly?
cargenerators in .ymt files, to be edited with CodeWalker
chanching or adding an additional LGUARD2 in vehiclemodelsets indeed does nothing, (tried adding IlayArye's that way)
yet at the Lifeguard Heli I did add Bduck's Mallard with ad-banner, so there's a 50-50 chance on either the heli or the ad-banner plane go figure
Ah alright. Well I tried looking for a tutorial but there is nothing about it.
I don't get it. I cannot really find any definitive tutorials regarding scripts and code walker. Either my keywords are off or people are just not willing to share how they go about making things these days.
Yeah, there's a bit of a brick wall with no-one saying anything constructive when it comes to teaching/sharing knowledge on Codewalker. I've asked a few mod authors to give me just a few clues as to how they did what they did... silence. I just use it to tell me where stuff is in the game files so at least it's still of some use.
The 'LGUARD' in vehiclemodelsets will be a single vehicle spawn of the 'lguard' vehicle, possibly at multiple spawn locations around Los Santos, that randomly & occasionally appears driving around. It won't affect the parked vehicles at the beach etc (same applies for police/fire etc parked vehicles). Afaik you would need to replace the 'lguard' vehicle or use Codewalker to create a new ymap to change the parked driverless vehicles.
Theoretically it should also be possible to edit the game's ymaps in place if you just want to replace the vehicles with another (they are really just text files). Thinking about it, it should also be possible to change the vehicle location & orientation etc as well. F**k this esoteric Codewalker cabal of secrecy, we don't need a key we'll break in! brb, I'm going to check this out...
Yep, it's fricking possible
The basic process is this:
- Open Codewalker > hit arrow thing top right > 'Selection' Tab > tick 'Mouse select (right-click)' box > change 'Mode' drop-down to 'Car Generator'
- Move (WSAD to move (Shift = Faster) & mouse click & drag to look) to location of car generator spawn.
- Right-click car generator box (it should turn green) & info should be displayed in right text box (drag it left so you can see all the lines of text etc)
- Start OpenIV & hit Ctrl+F3 to open the search box & search for the name of the '.ymap' you found in Codewalker (in this case 'vb_35_strm_0.ymap').
Note: You can drag over the name & copy & then paste it into OpenIV (to avoid typos etc)
- There will most likely be more than one of the same name. Use the same logic you use when replacing a vanilla vehicle to select the '.ymap' the game actually uses (patchdays beat x64a>w.rpf, update.rpf beats patchdays etc)
- Go to the '.ymap' location in OpenIV & right-click it & select 'Edit' (Ctrl+Enter)
- Search (Ctrl+F) for & replace the name of the vanilla vehicle with the spawn name of the vehicle you want to replace it with.
Note: If you want to replace ALL (3 in this case) of the stationary cargen locations for that vanilla vehicle (LGUARD in this case) then feel free to replace all the references to 'lguard' etc in the 'ymap' you find. If you want to be more selective use the position coordinates given 4 lines above the vehicle name to identify it's location & only replace the exact ones you want.
- Save the '.ymap' (bottom right) & that's it Load up the game & test.
If for some reason this doesn't work it is most likely that you have edited the wrong '.ymap'.
Any questions or problems I'll help you out
Wow... I might have to sit down tonight and have a read of this... Before I do, in a nut shell, what I want to achieve-
There are random car parks, cars parked on the streets, the lifeguard, ambulance, fire trucks and cop cars at stations. I would like to ADD MORE vehicles to spawn in those spots. Just skimming through this, towards the end of your reply, so could you just simply open the ymap in OpenIV, export the meta and add more lines to spawn more cars?
E.g. under cargenerators could you just add more vehicles beneath it like popgroups or is it ONLY done in Code Walker?
EDIT: Ok I got the idea. So how do we go about adding a NEW cargenerator and saving it as a NEW ymap in our custom DLC?
If you want to add a completely new Car Generator location I would say it should be possible to copy & paste a new block of data. This bit:
<Item> <position x="-1487.36800000" y="-1019.31200000" z="5.29558000"/> <orientX value="5.54916500"/> <orientY value="7.23182300"/> <perpendicularLength value="6.07700600"/> <carModel>lguard</carModel> <flags value="3683"/> <bodyColorRemap1 value="-1"/> <bodyColorRemap2 value="-1"/> <bodyColorRemap3 value="-1"/> <bodyColorRemap4 value="-1"/> <popGroup/> <livery value="-1"/> </Item>
& then manually edit the '<position' line coordinates & the '<orientX/Y' to the new location (should be able to find coordinated with a trainer etc (or see 'Edit:' below))
This hasn't been tested by me but in theory & given the other '.ymap' centric stuff I've messed with in the last 24hrs I'm confident the game will read the data & do what it is told (for once )
I created a [ Tutorial ] - How to edit vanilla Car Generators in ymaps & replace them with your own vehicles that covers all I have learned here & also has a brief bit at the start about using custom_maps add-on dlc.
- You extract the ymap from the game
- Edit it as above etc
- & then place it in the custom_maps add-on folder structure
- It will then load over the top of the vanilla ymap of the same name
Edit: Ask ReN on how to use Codewalker to get the exact coordinates/orientation values for a new Car Generator location. He sussed it out so I don't want to steal his thunder.
Still only able to load CW on the latest version of the game btw which is pretty vanilla
Maybe it doesn't like loading 60+ dlcpacks per manufacturer (ranging 200MB - 3 GB)?
I did first had to select First Person Mode via 'P' to even be able to roam around via WASD
Anyway, I'll try and find a location where I can place a pounder3 (Fenton's)
and try to learn orientation and how you set it up so it spawns the desired livery even
Lucy got some readin' to do!
//edit: moved and rotated one entity via Toolbar T options
Awesome work by the way
I was looking at these for coordinates/orientation but your CW way will give the exact details. No variables/rounding errors etc.
GTAV Noob Modder117
Is this how this was created: https://www.gta5-mods.com/misc/ls-car-generators
I basically want to do what @JRod did.
It's most likely @JRod used Codewalker to create his Car Generators mod (he credits CW in the mod download so he certainly used it to some degree) but you can create exactly the same thing using the way I outlined above. It's preference really, just 2 different ways of doing the same thing.
I started my adventure into modding games with Dawn of War ~10 years ago so I'm very at home digging into data files to create what I want & often find community created software unintuitive, frustrating to use & surrounded by an inherent elitism that harms creativity (grinds my gears that does ).
If you plan to use Codewalker for other things in future then learning how to do cargens like this is a pretty good way of picking up the basics. It's certainly one of the better modding programs I've seen & very powerful & far reaching in it's capabilities. You won't regret learning how to use it
You wouldn't be able to release it without his permission but why not take @JRod's mod & then kitbash it into what you want? If it's close to what you want already it'll certainly reduce your workload. You then just add whatever you want to it/change what vehicles spawn where etc
here's another good example
note that the carmodel entry is empty yet the popgroup entry has a specific zone
so the cargen will take a random vehicle listed in that zone from popgroups.ymt
//edit @Dekurwinator do you know what flags value 3680 versus 3616 means?
And perhaps also how I get it to spawn a specific livery number -only-? Or should I look into scenarios then?
I noticed that looking at police & army cargens Pondering where it takes the selection of vehicles it then uses from? (I would really want full control over exactly what spawns to utilize it to it's fullest potential).
It's NOT from vehiclemodelsets anyway. I tested that by changing all the vehicles under the 'police' 'CAmbientModelSet' but the same police vehicles continued to spawn at those locations.
Edit: LOL Just noticed your popgroups reference. Sweet, that's that sorted
more lessons this morning were
- had an occurance where I lost LODS ingame and severe stuttering, also didn't see my added cargen no matter what so changed flags from 3680 to 3683 and my added tanker showed up;
- for a specific livery it's best to use the color codes too I think and the desired livery is 'minus one' in the YTD. So on this tanker4b shown below the 'Bottom Feeders' is sign_4 in my YTD so I have to set it to 3 in the cargen...;
- you can use comments in the ymap.xml to know what's what and where as OpenIV won't import
<!-- comment -->(at least not in a ymap)
using one of Jrod's ymaps as a base works wonders
from what I understood from one of the guys in Discord is you need to have at least one single prop inside the cargen for it to work
guess that's why saves straight out of CW won't work when imported
you need to have at least one single prop inside the cargen for it to work
^Good to know
I noticed the alien egg at the start of all of @JRod's ymaps & wondered what it was all about?!
<Item type="CEntityDef"> <archetypeName>Prop_Alien_Egg_01</archetypeName> <flags value="32"/> <guid value="0"/> <position x="-53.64770000" y="-1102.87700000" z="22.43800000"/> <rotation x="0.00000000" y="0.00000000" z="0.00000000" w="1.00000000"/> <scaleXY value="1.00000000"/> <scaleZ value="1.00000000"/> <parentIndex value="-1"/> <lodDist value="500.00000000"/> <childLodDist value="500.00000000"/> <lodLevel>LODTYPES_DEPTH_HD</lodLevel> <numChildren value="0"/> <priorityLevel>PRI_REQUIRED</priorityLevel> <extensions/> <ambientOcclusionMultiplier value="255"/> <artificialAmbientOcclusion value="255"/> <tintValue value="0"/> </Item>
Best one to use as I presume it is very small. Reckon it should be easy to hide by placing under/off the map etc.
Edit: The upgrades numbering in vehiclemodelsets is the same as the liveries numbering here then (0=1st, 1=2nd etc). Just so you know