Increasing Vehicle Spawns?

muggerfugger

Well-Known Member
I thought I understood how the new system works, but i guess not.

i found events.xml, which i assume is what all the mission, zombie, and other spawns are based on.

i tried editing the vehicle parts to:

Code:
<event name="VehicleOffroadHatchback">
        <waves>0</waves>
        <nominal>25</nominal>
        <min>20</min>
        <max>25</max>
        <lifetime>300</lifetime>
        <restock>0</restock>
        <saferadius>1000</saferadius>
        <distanceradius>500</distanceradius>
        <cleanupradius>200</cleanupradius>
        <flags deletable="0" init_random="0" remove_damaged="1" sec_spawner="0"/>
        <position>fixed</position>
        <limit>mixed</limit>
        <active>0</active>
        <children/>
    </event>

but so far now have loaded, ami doing it right? or i just have to give it more time?
 
I was playing with vehicles a couple nights ago. Couldn't figure out a way to make them spawn out of events. I tried the way you wrote but with

<active>1</active>. I also tried with a child like:

C:
    <event name="VehicleOffroadHatchback">
        <waves>0</waves>
        <nominal>6</nominal>
        <min>3</min>
        <max>6</max>
        <lifetime>300</lifetime>
        <restock>0</restock>
        <saferadius>1000</saferadius>
        <distanceradius>500</distanceradius>
        <cleanupradius>200</cleanupradius>
        <flags deletable="0" init_random="0" remove_damaged="1" sec_spawner="0"/>
        <position>fixed</position>
        <limit>child</limit>
        <active>1</active>
        <children>
            <child lootmax="1" lootmin="0" max="30" min="30" type="OffroadHatchback"/>
        </children>
    </event>

Logs never reported them spawning. The only way that I got a vehicle in was force spawning it on the player.
 
Hey,
can you please tell me how to spawn one on the player? Wanna test it out :)

Thanks!

in init.c just below your character equip code (inside StartingEquipSetup) put:

C:
        EntityAI myVeh = EntityAI.Cast(GetGame().CreateObject("OffroadHatchback", player.GetPosition(), false, true));
        myVeh.GetInventory().CreateAttachment("HatchbackWheel");
        myVeh.GetInventory().CreateAttachment("HatchbackWheel");
        myVeh.GetInventory().CreateAttachment("HatchbackWheel");
        myVeh.GetInventory().CreateAttachment("HatchbackWheel");
        myVeh.GetInventory().CreateAttachment("HatchbackWheel");
        //myVeh.GetInventory().CreateAttachment("HatchbackDoors_Driver");
        myVeh.GetInventory().CreateAttachment("HatchbackDoors_CoDriver");
        myVeh.GetInventory().CreateAttachment("HatchbackHood");
        myVeh.GetInventory().CreateAttachment("SparkPlug");
        myVeh.GetInventory().CreateAttachment("EngineBelt");
        myVeh.GetInventory().CreateAttachment("CarRadiator");
        myVeh.GetInventory().CreateAttachment("CarBattery");
        myVeh.GetInventory().CreateAttachment("HeadlightH7");

for the hatchback

C:
        EntityAI myVeh= EntityAI.Cast(GetGame().CreateObject("V3S_Cargo", player.GetPosition(), false, true));
        myVeh.GetInventory().CreateAttachment("V3SWheel");
        myVeh.GetInventory().CreateAttachment("V3SWheel");
        myVeh.GetInventory().CreateAttachment("V3SWheel");
        myVeh.GetInventory().CreateAttachment("V3SWheel");
        myVeh.GetInventory().CreateAttachment("V3SWheelDouble");
        myVeh.GetInventory().CreateAttachment("V3SWheelDouble");
        myVeh.GetInventory().CreateAttachment("V3SWheelDouble");
        myVeh.GetInventory().CreateAttachment("V3SWheelDouble");
        //myVeh.GetInventory().CreateAttachment("V3SDoors_Driver");
        myVeh.GetInventory().CreateAttachment("V3SDoors_CoDriver");
        myVeh.GetInventory().CreateAttachment("V3SHood");
        myVeh.GetInventory().CreateAttachment("GlowPlug");
        myVeh.GetInventory().CreateAttachment("TruckRadiator");
        myVeh.GetInventory().CreateAttachment("TruckExhaust");
        myVeh.GetInventory().CreateAttachment("TruckBattery");
        myVeh.GetInventory().CreateAttachment("HeadlightH7");

for the V3S_Cargo etc etc...

I commented out the Driver door because sometimes they are a pain.

Make sure you only do one at a time privately because they will crash the client and eventually the server. The V3S_Cargo seemed to go forever, just when you get out the player character can't do any timed actions like drinking/eating/crafting until you log out and log back in.
 
in init.c just below your character equip code (inside StartingEquipSetup) put:

I have anonther question. When I log out the car is still there, right?
But when I restart the Server the car with it's inventory is gone.

I want the car forever. My opinion was:
1. add the line for the V3S_Cargo in the init.c
2. Spawn with a new Char on my Server
3. Delete the lines in the init.c
3. Start the Server and the car will be still there.

Any way to get that?
 
Back
Top