Log in to reply
 

[Tutorial] How to create ambient vehicle spawn locations via cargens



  • Hey guys, I'm having troubles finding any info regarding this and I think any tutorials would benefit the community regarding this dilemma, anyway...

    We got instructions on how to add vehicles to spawn in traffic and police chases however, nobody seems to cover how you create vehicle spawners for simply parked cars.

    Say one of the LSPD stations for example, in-game there are only a few parking spaces with the random police and police3 cars spawning in those spaces. In codewalker, there are vehicle spawner boxes over these parking spaces that spawn these vehicles.

    So my question is-
    a) how can you edit these parking spaces to add more possibilities of say adding police2 and police4 to have a chance to spawn there rather than just police and police3?
    b) how do you create one of these spawners from scratch?

    If we had an in-depth guide to do this... Anyone say who makes a police car mod (there have to be millions of them I swear...) rather than just having the replace or addon folders to spawn your car via a trainer or mod... Mod authors can also add their car to spawn alongside other ambient naturally spawning cop cars in other parking lots around the city.



  • @ReNNie Please? :blush:


  • MODERATOR

    @GTAV-Noob-Modder117 @inbetweendays_

    you'll want the lastest CW, version R30_dev13

    only available from dexyfex' discord, https://discord.gg/BxfKHkk

    ambiently spawning vehicles are controlled by ymaps, via a cargen

    alt text

    alt text

    alt text

    alt text

    Start CW and press T for the toolbar

    so you can create a new ymap with a new cargen inside
    and press the << icon to your right, in that side window:
    then set the View tab to World View and on the Selection tab select cargens in the drop-down box
    so you'll see the vanilla cargens as blue squares placed on your map
    as you don't want to place your vehicle over a vanilla vehicle ;)

    alt text

    alt text

    alt text

    In the dialogue you can type a specific vehicle model

    or even a POPGROUP VEH CATEGORY such as LARGE_CITY eg
    to have to game choose a model from what you have in set in popgroups in that category

    alt text

    You can also make the cargen spawn a vehicle in a specific color
    (just like in carvariations.meta) and even a specific livery
    where the livery to use is one minus the sign_ in the YTD
    so if you want vehicle_sign_8 to show up, set to livery to value '7'

    I always set Flags value to 3683 as I found this to work in my game

    alt text

    You can move the vehicle around via the blue/red/green arrows
    but only when the move icon is selected on the Toolbar (the icon with arrows surrounding it)

    alt text

    for some reason a ymap always needs to have at least ONE prop inside
    I took JRod's protagonists garage ymap as a template and worked on that
    as he placed a small prop invisible under the world map

    you can export an ymap to ymap.xml for Notepad editing via OpenIV
    via right-mouse button 'export to OpenFormats'
    after I create my own cargen I copy those entries via Notepad into JRod's ymap.xml
    and drag that file into my custom dlcpack to make the game load it

    you can import the created ymap via OpenIV into your game
    use a custom_maps dlcpack to make the game load your own created cargens

    alt text

    Good Luck!



  • Wow... It actually worked. I got the Scout police car spawning in a vacant space outside one of the city precincts. My plans are working!!

    Thanks for the help guys, wouldn't have done this without you! Special thanks to JRod for the un-intrusive 'egg' template.



  • Ok, there is one little bump I encountered...

    The having a randomly chosen vehicle from a popgroup doesn't seem to be working for me no matter what experiments I try.

    I put LARGE_CITY in the CarModel line, PopGroup line and both and all three methods failed me, nothing ever spawned.

    Odd... I know I'm doing it wrong.


  • MODERATOR

    @GTAV-Noob-Modder117

    no entry in carModel and LARGE_CITY in popcyle entry
    this is what a vanilla ymap with the method looks like

    alt text



  • @ReNNie

    Hmmmmm....... VEH_LARGE is supposed to be trucks right? I seem to be getting different colored Huntley SUVs spawning in the spot now...

    Odd, its working but now I don't seem to be getting the models listed from the popgroup.

    alt text


  • MODERATOR

    @GTAV-Noob-Modder117

    carModel says 0 meaning 'choose a random game model'
    instead of not having a value there
    so that probably overrides the entry in PopGroup?

    I don't know, keep experimenting, export your ymap to ymap.xml
    and compare it against the screenshot I posted on the vanilla ymap above



  • @ReNNie

    So this was my original single car spawner, it worked perfect as my police18 car spawns. Side note- I find it a little annoying how it literally ALWAYS spawns (I'd prefer a chance spawn but whatever at least its spawning).

    <carGenerators>
    <Item>
    <position x="627.31130000" y="23.79878000" z="88.16220000"/>
    <orientX value="1.67764400"/>
    <orientY value="-4.71015000"/>
    <perpendicularLength value="2.60000000"/>
    <carModel>police18</carModel>
    <flags value="3683"/>
    <bodyColorRemap1 value="-1"/>
    <bodyColorRemap2 value="-1"/>
    <bodyColorRemap3 value="-1"/>
    <bodyColorRemap4 value="-1"/>
    <popGroup/>
    <livery value="-1"/>
    </Item>
    </carGenerators>

    Now the 'plop' groups crap:

    <carGenerators>
    <Item>
    <position x="627.31130000" y="23.79878000" z="88.16220000"/>
    <orientX value="1.67764400"/>
    <orientY value="-4.71015000"/>
    <perpendicularLength value="2.60000000"/>
    <carModel/>
    <flags value="3683"/>
    <bodyColorRemap1 value="-1"/>
    <bodyColorRemap2 value="-1"/>
    <bodyColorRemap3 value="-1"/>
    <bodyColorRemap4 value="-1"/>
    <popGroup>LARGE_CITY</popGroup>
    <livery value="-1"/>
    </Item>
    </carGenerators>


  • MODERATOR

    @GTAV-Noob-Modder117
    In the screenshot on the vanilla ymap with the poop group it uses 3616 as a flag, would that make a difference?
    Probably flag value also controls chance, but as I said, I don't know diddly on flags

    Van_Zandt isn't registered on the forums so can't even tag him, check his remark on February 21, 2019
    https://www.gta5-mods.com/maps/static-planes-removed-add-on

    You could ask in CW discord if anyone has more Intel on flags usage in cargens?
    I'd love to hear back



  • @ReNNie

    Well... It seems the problem is with spawning popgroups themselves. No matter what I copy or change, the vehicle remains as an Infernus in codewalker and random SUVs, Super cars and bikes spawn.

    Maybe the flags do dictate what spawns?

    I think this is just too complicated for my simple brain to comprehend. I'll poke around and ask. This is just odd...



  • UPDATE: FAILURE. I cannot get any cargens to spawn random vehicles from a pool of vehicles from a popgroup.


Log in to reply
 

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