Announcement

Collapse
No announcement yet.

Car Respawning

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [MODLET] Car Respawning

    A18.3 stable b4 version of car respawner. Also respawns buses and army truck. I have changed it to not use an air block and to be one of the wheels with rim laying on ground so that you can tell it is not a normal tire to chop. I also used metal material so that it takes a few more hits to destroy it. Destroying will stop the vehicle respawning for anyone wanting to build where the vehicles are.

    Download by clicking on the "clone or download" button from the link below.

    https://github.com/Anabella00geek/7D...icle-Respawner


    _______________________________________
    Below info kept in case anyone still wants to use the mod in a16. Use the above link to the get updated mod.

    This can be done to where you have all the different colors of cars respawning but due to the limit of block ids I just went with one color. The air block will take up a place where nothing can be put down. To get rid of it you would just simply need to remove the block below it. With limited maps and some of us having days going into the thousands this can be useful.

    ONLY USE THIS VERSION FOR A16
    Spoiler: 
    Code:
    From Blocks
    
    <block id="1455" name="cntCar03Damage2">
    	<property name="Class" value="CarExplode" /> 
    	<property name="Material" value="metal" />
    	<property name="Shape" value="ModelEntity" />
    	<property name="Texture" value="26" />
    	<property name="IsTerrainDecoration" value="true" />
    	<property name="Place" value="TowardsPlacer" />
    	<property name="Model" value="Entities/Vehicles/car03_dmg3_Prefab" />
    	<property name="MultiBlockDim" value="2,2,6" />
    	<property name="ShowModelOnFall" value="false" />
    	<drop event="Harvest" name="shortMetalPipe" count="5" prob="0.5" tool_category="Disassemble" />
    	<drop event="Harvest" name="gasCan" count="20" prob="0.3" />
    	<drop event="Harvest" name="headlight" count="1" prob="0.45" tool_category="Disassemble" />
    	<drop event="Harvest" name="scrapIron" count="4" prob="1" tool_category="Disassemble"/>
    	<drop event="Destroy" name="scrapIron" count="1,2" prob="1" />
    	<drop event="Fall" name="scrapMetalPile" count="1" prob="1" stick_chance="1" />
    	<property name="BigDecorationRadius" value="5" />
    	<property name="CanDecorateOnSlopes" value="false" />
    	<property class="Explosion"> 
    		<property name="ParticleIndex" value="4" /> <!-- which prefab/particle is used -->
    		<property name="RadiusBlocks" value="5" /> <!-- damage radius for blocks -->
    		<property name="BlockDamage" value="5000" /><!-- damage for blocks in the center of the explosion -->
    		<property name="RadiusEntities" value="5" /> <!-- damage radius for entities -->
    		<property name="EntityDamage" value="100" /> <!-- damage for entities in the center of the explosion -->
    	</property> 
    	<property name="DowngradeBlock" value="CarRespawner-AirBlockStage" />
    </block>
    
    
    	<block id="2030" name="CarRespawner-AirBlockStage">
    		<property name="CustomIcon" value="sidingBluePlasterMiddleBlock" />
    		<property name="IsDeveloper" value="true" />
    		<property name="Class" value="PlantGrowing" />	
    		<property name="Material" value="airEnhanced" />
    		<property name="Shape" value="Invisible" />
    		<property name="Texture" value="250" />
    		<property name="CanMobsSpawnOn" value="false" />
    		<drop event="Destroy" count="0" />	
    		<property name="IsTerrainDecoration" value="true" />
    		<property name="PlantGrowing.Next" value="cntCar03Red" />
    		<property name="PlantGrowing.GrowthRate" value="180" /><!-- amount of days for respawn 60 equals 1 day-->
    		<property name="PlantGrowing.FertileLevel" value="0" />
    		<property name="PlantGrowing.IsRandom" value="false" />
    	</block>
    
    From Materials
    
    	<material id="airEnhanced">
    		<property name="collidable" value="false" />
    		<property name="lightopacity" value="0" />
    		<property name="Hardness" type="float" value="50000" />
    		<property name="Mass" type="int" value="30" />	  
    	</material>
    Last edited by Anabella; 02-04-2020, 05:37 PM. Reason: Updated that it works for a18.3 b4

    #2
    Car Respawning

    Reserved
    Last edited by Roland; 11-16-2019, 11:43 PM.

    Comment


      #3
      Car Respawning

      Reserved

      Comment


        #4
        Cool workaround.

        Comment


          #5
          Originally posted by Carlzilla View Post
          Cool workaround.
          Thanks.

          Comment


            #6
            Originally posted by Anabella View Post
            This can be done to where you have all the different colors of cars respawning but due to the limit of block ids I just went with one color. The air block will take up a place where nothing can be put down. To get rid of it you would just simply need to remove the block below it. With limited maps and some of us having days going into the thousands this can be useful.
            Spoiler: 
            Code:
            From Blocks
            
            <block id="1455" name="cntCar03Damage2">
            	<property name="Class" value="CarExplode" /> 
            	<property name="Material" value="metal" />
            	<property name="Shape" value="ModelEntity" />
            	<property name="Texture" value="26" />
            	<property name="IsTerrainDecoration" value="true" />
            	<property name="Place" value="TowardsPlacer" />
            	<property name="Model" value="Entities/Vehicles/car03_dmg3_Prefab" />
            	<property name="MultiBlockDim" value="2,2,6" />
            	<property name="ShowModelOnFall" value="false" />
            	<drop event="Harvest" name="shortMetalPipe" count="5" prob="0.5" tool_category="Disassemble" />
            	<drop event="Harvest" name="gasCan" count="20" prob="0.3" />
            	<drop event="Harvest" name="headlight" count="1" prob="0.45" tool_category="Disassemble" />
            	<drop event="Harvest" name="scrapIron" count="4" prob="1" tool_category="Disassemble"/>
            	<drop event="Destroy" name="scrapIron" count="1,2" prob="1" />
            	<drop event="Fall" name="scrapMetalPile" count="1" prob="1" stick_chance="1" />
            	<property name="BigDecorationRadius" value="5" />
            	<property name="CanDecorateOnSlopes" value="false" />
            	<property class="Explosion"> 
            		<property name="ParticleIndex" value="4" /> <!-- which prefab/particle is used -->
            		<property name="RadiusBlocks" value="5" /> <!-- damage radius for blocks -->
            		<property name="BlockDamage" value="5000" /><!-- damage for blocks in the center of the explosion -->
            		<property name="RadiusEntities" value="5" /> <!-- damage radius for entities -->
            		<property name="EntityDamage" value="100" /> <!-- damage for entities in the center of the explosion -->
            	</property> 
            	<property name="DowngradeBlock" value="CarRespawner-AirBlockStage" />
            </block>
            
            
            	<block id="2030" name="CarRespawner-AirBlockStage">
            		<property name="CustomIcon" value="sidingBluePlasterMiddleBlock" />
            		<property name="IsDeveloper" value="true" />
            		<property name="Class" value="PlantGrowing" />	
            		<property name="Material" value="airEnhanced" />
            		<property name="Shape" value="Invisible" />
            		<property name="Texture" value="250" />
            		<property name="CanMobsSpawnOn" value="false" />
            		<drop event="Destroy" count="0" />	
            		<property name="IsTerrainDecoration" value="true" />
            		<property name="PlantGrowing.Next" value="cntCar03Red" />
            		<property name="PlantGrowing.GrowthRate" value="180" /><!-- amount of days for respawn 60 equals 1 day-->
            		<property name="PlantGrowing.FertileLevel" value="0" />
            		<property name="PlantGrowing.IsRandom" value="false" />
            	</block>
            
            From Materials
            
            	<material id="airEnhanced">
            		<property name="collidable" value="false" />
            		<property name="lightopacity" value="0" />
            		<property name="Hardness" type="float" value="50000" />
            		<property name="Mass" type="int" value="30" />	  
            	</material>
            Still working in A16 ?

            Comment


              #7
              I think it you choose the green one it is the placeholder for random tinting. Ask stompy, it was something he said in game once... Or something.

              Comment


                #8
                Use to have the code on my old build and did the following changes to see if it would work on the new build. Figured i would share.

                Changes from the original code is where the downgradeblock is placed, and what car it respawns. I could be wrong but i should know in about 7 days <-changed it so the cars respawn after 7 days.

                Remember to put the material code in, but below is the code i have in the blocks.

                Spoiler: 


                <block id="1455" name="cntCar03SedanDamage2"> <!-- car wreck, no color -->
                <property name="Class" value="CarExplode"/>
                <property name="Material" value="metal"/>
                <property name="Shape" value="ModelEntity"/>
                <property name="ImposterDontBlock" value="true"/>
                <property name="IsTerrainDecoration" value="true"/>
                <property name="Place" value="TowardsPlacer"/>
                <property name="Model" value="Entities/Vehicles/car03_dmg2_Prefab"/>
                <property name="MultiBlockDim" value="2,2,6"/>
                <property name="ShowModelOnFall" value="false"/>
                <drop event="Harvest" name="shortMetalPipe" count="5" prob="0.5" tool_category="Disassemble"/>
                <drop event="Harvest" name="gasCan" count="50,150" prob="0.5"/>
                <drop event="Harvest" name="gasCan" count="50,150" prob="0.5" tool_category="Disassemble"/> <!-- together 100 avg -->
                <drop event="Harvest" name="headlight" count="1" prob="0.45" tool_category="Disassemble"/>
                <drop event="Harvest" name="scrapIron" count="20" tool_category="Disassemble"/>
                <drop event="Destroy" count="0"/>
                <drop event="Harvest" name="mechanicalParts" count="1,5" tool_category="Disassemble"/>
                <drop event="Harvest" name="electricParts" count="0,2" prob="0.1" tool_category="Disassemble"/>
                <drop event="Harvest" name="scrapIron" count="12"/>
                <drop event="Fall" name="scrapMetalPile" count="1" prob="1" stick_chance="1"/>
                <property name="DowngradeBlock" value="CarRespawner-AirBlockStage" />
                <property name="BigDecorationRadius" value="5"/>
                <property name="CanDecorateOnSlopes" value="false"/>

                <block id="2034" name="CarRespawner-AirBlockStage">
                <property name="CustomIcon" value="sidingBluePlasterMiddleBlock" />
                <property name="IsDeveloper" value="true" />
                <property name="Class" value="PlantGrowing" />
                <property name="Material" value="airEnhanced" />
                <property name="Shape" value="Invisible" />
                <property name="Texture" value="250" />
                <property name="CanMobsSpawnOn" value="false" />
                <drop event="Destroy" count="0" />
                <property name="IsTerrainDecoration" value="true" />
                <property name="PlantGrowing.Next" value="cntCar03SedanDamage0" />
                <property name="PlantGrowing.GrowthRate" value="420" /><!-- amount of days for respawn 60 equals 1 day-->
                <property name="PlantGrowing.FertileLevel" value="0" />
                <property name="PlantGrowing.IsRandom" value="false" />
                </block>
                Last edited by puppetec; 07-19-2017, 04:58 AM. Reason: updated ID number

                Comment


                  #9
                  Changed it as follows

                  Made the Placeholer a Bunch of grass you can Punch easy away
                  Made the Upgrade a Random Car State with a random color and the chance that the Circle breaks by spawning a oil Barrel
                  Here the code (Only a few minutes testet until now)



                  In loot XML
                  Code:
                  	<placeholder name="lootMyCarsHelper">
                  		<block name="oilBarrel"/>
                  		<block name="cntCar03SedanDamage0"/>
                  		<block name="cntCar03SedanDamage1"/>
                  		<block name="cntCar03SedanDamage2"/>
                  	</placeholder>
                  In Blocks XML

                  New
                  Code:
                  	<block id="2018" name="Nothing">
                  		<property name="CustomIcon" value="steelMaster" />
                  		<property name="CustomIconTint" value="ffa0ff"/>		
                  		<property name="IsDeveloper" value="true" />
                  		<property name="Class" value="PlantGrowing" />	
                  		<property name="Material" value="Mtallgrass"/>
                  	<property name="StabilitySupport" value="false"/>
                  	<property name="Shape" value="Grass"/>
                  	<property name="Mesh" value="grass"/>
                  	<property name="Texture" value="350,368,369,370,350,368"/>		
                  		<property name="Collide" value="melee"/>
                  		<property name="CanMobsSpawnOn" value="false" />
                  		<drop event="Destroy" count="0" />	
                  		<property name="IsTerrainDecoration" value="true" />
                  		<property name="PlantGrowing.Next" value="lootMyCarsHelper" />
                  		<property name="PlantGrowing.GrowthRate" value="4" /><!-- amount of days for respawn 60 equals 1 day-->
                  		<property name="PlantGrowing.FertileLevel" value="0" />
                  		<property name="PlantGrowing.IsRandom" value="false" />
                  	</block>
                  	
                  	<block id="2019" name="lootMyCarsHelper">
                  	<property name="Extends" value="lootWastelandHelper" param1="CustomIcon,DescriptionKey"/>
                  	<property name="Texture" value="278"/>
                  	<property name="CreativeMode" value="Dev"/>
                  </block>
                  and edited/added in the Car
                  <block id="1455" name="cntCar03SedanDamage2">
                  Code:
                  	<property name="DowngradeBlock" value="Nothing"/>

                  So all cars will end as a Bush/Grass Bundle you can destroy or there will respawn a Random Car

                  The time is very low to test, no idea which Grow Rate will be a god choice, but i think this depends on the server too. And maybe it will make sense to give the Oil Barrel a lower or Higher chance

                  And good work, i had some problems by my own solution, was very helpfull to use yours as Base.



                  Planted

                  Grown
                  Last edited by Royal Deluxe; 07-24-2017, 12:17 AM.

                  Comment


                    #10
                    Nice changes on it.

                    Comment


                      #11
                      does this still work? I tried using this and couldn't get the cars to respawn. I just want a simple car respawn mod lol

                      Comment


                        #12
                        Spoiler: 
                        Originally posted by Royal Deluxe View Post
                        Changed it as follows

                        Made the Placeholer a Bunch of grass you can Punch easy away
                        Made the Upgrade a Random Car State with a random color and the chance that the Circle breaks by spawning a oil Barrel
                        Here the code (Only a few minutes testet until now)



                        In loot XML
                        Code:
                        	<placeholder name="lootMyCarsHelper">
                        		<block name="oilBarrel"/>
                        		<block name="cntCar03SedanDamage0"/>
                        		<block name="cntCar03SedanDamage1"/>
                        		<block name="cntCar03SedanDamage2"/>
                        	</placeholder>
                        In Blocks XML

                        New
                        Code:
                        	<block id="2018" name="Nothing">
                        		<property name="CustomIcon" value="steelMaster" />
                        		<property name="CustomIconTint" value="ffa0ff"/>		
                        		<property name="IsDeveloper" value="true" />
                        		<property name="Class" value="PlantGrowing" />	
                        		<property name="Material" value="Mtallgrass"/>
                        	<property name="StabilitySupport" value="false"/>
                        	<property name="Shape" value="Grass"/>
                        	<property name="Mesh" value="grass"/>
                        	<property name="Texture" value="350,368,369,370,350,368"/>		
                        		<property name="Collide" value="melee"/>
                        		<property name="CanMobsSpawnOn" value="false" />
                        		<drop event="Destroy" count="0" />	
                        		<property name="IsTerrainDecoration" value="true" />
                        		<property name="PlantGrowing.Next" value="lootMyCarsHelper" />
                        		<property name="PlantGrowing.GrowthRate" value="4" /><!-- amount of days for respawn 60 equals 1 day-->
                        		<property name="PlantGrowing.FertileLevel" value="0" />
                        		<property name="PlantGrowing.IsRandom" value="false" />
                        	</block>
                        	
                        	<block id="2019" name="lootMyCarsHelper">
                        	<property name="Extends" value="lootWastelandHelper" param1="CustomIcon,DescriptionKey"/>
                        	<property name="Texture" value="278"/>
                        	<property name="CreativeMode" value="Dev"/>
                        </block>
                        and edited/added in the Car
                        <block id="1455" name="cntCar03SedanDamage2">
                        Code:
                        	<property name="DowngradeBlock" value="Nothing"/>

                        So all cars will end as a Bush/Grass Bundle you can destroy or there will respawn a Random Car

                        The time is very low to test, no idea which Grow Rate will be a god choice, but i think this depends on the server too. And maybe it will make sense to give the Oil Barrel a lower or Higher chance

                        And good work, i had some problems by my own solution, was very helpfull to use yours as Base.



                        Planted

                        Grown


                        works with 16.2?
                        Last edited by Roland; 11-17-2019, 01:52 AM.

                        Comment


                          #13
                          For a really simple version of this, I just changed the entry for the "stripped to the frame" car block like so:
                          Code:
                          <block id="1455" name="cntCar03SedanDamage2"> <!-- car wreck, no color -->
                          	<property name="Class" value="PlantGrowing"/>
                          	<property name="Material" value="metal"/>
                          	<property name="Shape" value="ModelEntity"/>
                          	<property name="ImposterDontBlock" value="true"/>
                          	<property name="IsTerrainDecoration" value="true"/>
                          	<property name="Place" value="TowardsPlacer"/>
                          	<property name="Model" value="Entities/Vehicles/car03_dmg2_Prefab"/>
                          	<property name="MultiBlockDim" value="2,2,6"/>
                          	<property name="ShowModelOnFall" value="false"/>
                          	<property name="PlantGrowing.Next" value="randomCarsHelper"/>
                          	<property name="PlantGrowing.GrowthRate" value="60" /><!-- amount of days for respawn 60 equals 1 day-->
                          	<property name="PlantGrowing.FertileLevel" value="0" />
                          	<property name="PlantGrowing.IsRandom" value="false" />
                          	<drop event="Harvest" name="shortMetalPipe" count="5" prob="0.5" tool_category="Disassemble"/>
                          	<drop event="Harvest" name="gasCan" count="50,150" prob="0.5"/>
                          	<drop event="Harvest" name="gasCan" count="50,150" prob="0.5" tool_category="Disassemble"/> <!-- together 100 avg -->
                          	<drop event="Harvest" name="headlight" count="1" prob="0.45" tool_category="Disassemble"/>
                          	<drop event="Harvest" name="scrapIron" count="20" tool_category="Disassemble"/>
                          	<drop event="Destroy" count="0"/>
                          	<drop event="Harvest" name="mechanicalParts" count="1,5" tool_category="Disassemble"/>
                          	<drop event="Harvest" name="electricParts" count="0,2" prob="0.1" tool_category="Disassemble"/>
                          	<drop event="Harvest" name="scrapIron" count="12"/>
                          	<drop event="Fall" name="scrapMetalPile" count="1" prob="1" stick_chance="1"/>
                          	<property name="BigDecorationRadius" value="5"/>
                          	<property name="CanDecorateOnSlopes" value="false"/>
                          	<!--
                          	<property name="RandomTintColor1" value="0,50,110" param1="car03_white"/>
                          	<property name="RandomTintColor2" value="148,119,10" param1="car03_white"/>
                          	<property name="RandomTintColor3" value="200,161,17" param1="car03_white"/>
                          	<property name="RandomTintColor4" value="212,50,7" param1="car03_white"/>
                          	<property name="RandomTintColor5" value="246,0,15" param1="car03_white"/>
                          	<property name="RandomTintColor6" value="255,204,16" param1="car03_white"/>
                          	<property name="RandomTintColor7" value="255,255,255" param1="car03_white"/>
                          	<property name="RandomTintColor8" value="5,95,190" param1="car03_white"/>
                          	<property name="RandomTintColor9" value="70,158,255" param1="car03_white"/>
                          	<property name="RandomTintColor10" value="184,6,40" param1="car03_frame"/>
                          	-->
                          	<property class="Explosion">
                          		<property name="ParticleIndex" value="4"/> <!-- which prefab/particle is used -->
                          		<property name="RadiusBlocks" value="5"/> <!-- damage radius for blocks -->
                          		<property name="BlockDamage" value="5000"/> <!-- damage for blocks in the center of the explosion -->
                          		<property name="RadiusEntities" value="5"/> <!-- damage radius for entities -->
                          		<property name="EntityDamage" value="70"/> <!-- damage for entities in the center of the explosion -->
                          	</property>
                          	<property name="ActivationDistance" value="6"/>
                          </block>
                          This way, as long as you don't fully destroy the cars, they have a chance to upgrade each day. The randomCarsHelper block is already defined, and gives probabilities for the undamaged, damaged, and stripped versions. Each time the frame grows, it's replaced with the randomCarsHelper block, which will just be the same stripped frame most of the time, so nothing will appear to happen. But you have a chance at the damaged and undamaged states as well.

                          Eventually this would cause all the stripped cars in the game to regenerate to damaged or undamaged cars, but it would take a very long time.

                          If you want a more reliable version you could create another car helper loot placeholder without the cntCar03SedanDamage2 block in it, but this would mean your world would have no stripped car frames in it in short order. I'd recommend setting the growth rate to at least 420 (7 days) if you went that route.

                          Comment


                            #14
                            Does this have to be done with a fresh server install? Or can you modify on a active server?

                            Comment


                              #15
                              I added that mod to my server while it was active, so yeah. It works.

                              Comment

                              Working...
                              X