Scrap Mechanic

Scrap Mechanic

Destructible Corn (Survival Mod)
19 kommentarer
Funtime Gabe 2. jan. 2024 kl. 15:53 
yeah this isnt needed anymore
Vajdani 2. apr. 2022 kl. 4:13 
this was made way before the devs added breakable corn
David "Blackoil" Wilson 1. apr. 2022 kl. 19:13 
bro this mod should not exist
ZoLatKam 1. sep. 2021 kl. 16:16 
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 kl. 13:27 
hasn't corn always been destructible in survival mode???
Vajdani 28. aug. 2020 kl. 4:51 
Hey! Does this still work?
HastyTurtle 18. juni 2020 kl. 13:04 
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. juni 2020 kl. 12:26 
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. juni 2020 kl. 0:36 
@Spastic Cube - Destroying the corn by crashing into it still allows you to loot it!
ZoLatKam 5. juni 2020 kl. 0:35 
@Exund Ah! Fantastic! I've downloaded your copy of the CornPlant.lua & replaced the necessary bits to make it destructable - Works GREAT!
Exund  [ophavsmand] 3. juni 2020 kl. 12:18 
@ZoLatKam you can look in the mod folder but to summarize I added an areaTrigger similarly to the fences in CornPlant.lua
ZoLatKam 3. juni 2020 kl. 11:27 
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. maj 2020 kl. 6:46 
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. maj 2020 kl. 18:36 
Ok, this dude's a hero.
Metal Master 29. maj 2020 kl. 18:36 
HOW'ED U KNOW WUT WE VVANTED????
Juan Ito 27. maj 2020 kl. 5:48 
can we do the same for crates ?
Tman 24. maj 2020 kl. 15:01 
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. maj 2020 kl. 14:14 
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. maj 2020 kl. 10:44 
Can you still pick up the corn afterwards?