Scrap Mechanic

Scrap Mechanic

Destructible Corn (Survival Mod)
19 Comments
Funtime Gabe 2 Jan, 2024 @ 3:53pm 
yeah this isnt needed anymore
Vajdani 2 Apr, 2022 @ 4:13am 
this was made way before the devs added breakable corn
David "Blackoil" Wilson 1 Apr, 2022 @ 7:13pm 
bro this mod should not exist
ZoLatKam 1 Sep, 2021 @ 4:16pm 
wrgarland - Not by vehicles. Just a few years ago, Corn was a solid as a rock when you hit it with your vehicle. It was terrible.
wrgarland 1 Sep, 2021 @ 1:27pm 
hasn't corn always been destructible in survival mode???
Vajdani 28 Aug, 2020 @ 4:51am 
Hey! Does this still work?
HastyTurtle 18 Jun, 2020 @ 1:04pm 
How did you get to that kind of code and stuff? I have an idea for a mod but i don't know how to make it.
yankeevader 7 Jun, 2020 @ 12:26pm 
I love being able to hit the corn with my car but after awhile I had too many laying around and didnt want to stop and pick them up. and it was beginning to affect the game with 3 of us playing
so I modified the file to destroy when hit by anything but the hammer

in the CornPlant.lua file you can change 2 lines of code to achieve this - Change self:sv_onHit() in both the _onProjectile and _onExplosion to self.harvestable:destroy()

I also changed the one on impact velocity from self:sv_onHit() to self.harvestable:destroy()
not sure if it was needed but its working exactly as I wanted.



function CornPlant.server_onProjectile( self, hitPos, hitTime, hitVelocity, projectileName, attacker, damage )
self.harvestable:destroy()
end

function CornPlant.server_onMelee( self, hitPos, attacker, damage )
self:sv_onHit()
end

function CornPlant.server_onExplosion( self, center, destructionLevel )
self.harvestable:destroy()
ZoLatKam 5 Jun, 2020 @ 12:36am 
@Spastic Cube - Destroying the corn by crashing into it still allows you to loot it!
ZoLatKam 5 Jun, 2020 @ 12:35am 
@Exund Ah! Fantastic! I've downloaded your copy of the CornPlant.lua & replaced the necessary bits to make it destructable - Works GREAT!
Exund  [author] 3 Jun, 2020 @ 12:18pm 
@ZoLatKam you can look in the mod folder but to summarize I added an areaTrigger similarly to the fences in CornPlant.lua
ZoLatKam 3 Jun, 2020 @ 11:27am 
Just wondering if you'd be able to point out which files, or lines of code, you've changed in this mod so I can make the changes myself, as I've heavily edited many of the survival files for quality-of-life purposes. Message me on steam, if you don't mind. Thx! :)
Adamanticore 30 May, 2020 @ 6:46am 
if i were to only be allowed to install 1 mod for this game THIS WOULD BE IT !! that corn is the bane of my life when trying to maneuver my big ass miner around the map ! THANK YOU !!
Metal Master 29 May, 2020 @ 6:36pm 
Ok, this dude's a hero.
Metal Master 29 May, 2020 @ 6:36pm 
HOW'ED U KNOW WUT WE VVANTED????
Juan Ito 27 May, 2020 @ 5:48am 
can we do the same for crates ?
Tman 24 May, 2020 @ 3:01pm 
i managed to get it working so dont worry about it when i was copying it over and editing it i didnt realize there was already an oncreate function for the loot crate and combing the 2 got it to work
Tman 24 May, 2020 @ 2:14pm 
this is good thanks and i tried to use the code from this to do the same to loot crates but i couldnt get it to work so could you please make one for the loot crates as well
#ff7f00 Spastic Cube 21 May, 2020 @ 10:44am 
Can you still pick up the corn afterwards?