zzKratoszz Posted November 14, 2016 Share Posted November 14, 2016 I have seen several posts asking about Grass Gekkos and how to turn them off in a pre-existing games. The main concern seems to stem from grass farms packing their bags and leaving. This peaked my interest and I decided to look into their lua file for possible solutions or workarounds. Spoiler These 2 lines of code caught my eye. if #TheSim:FindEntities(x, y, z, 10, { "grassgekko" }) < 8 then local gekko = SpawnPrefab("grassgekko") The "10" stands for distance and the "< 8" is the spawn threshold. (feel free to correct me if I am wrong) To put this knowledge to the test we need to know 1 more thing. How big is 1 distance? As seen in this image, 1 distance is the same size of 1 wall; and 1 tile is the same as 4 distance. So in theory, as long as we have 8 or more Grass Gekkos with in 10 distance of our grass, no more Grass Gekkos should spawn. I decided to put this theory to the test using trial and error (also godmode) and made an 8X8 enclosure. I used 8X8 instead of 10X10 in case hugging the walls glitched the Grass Gekkos into the next tile. I planted grass, fertilized it, and picked grass until my inventory was full. In conclusion, I can find 1 of 2 things to be true. Either A I just got lucky and some how never caused more spawns after the first 8. Or B no Grass Gekkos can spawn when 8 or more are already near by. http://imgur.com/a/OaNZT I would like to stress 1 more thing. The images show an 8X8 area of grass. 10X10 should be perfectly legal and can easily hold a stack and a half of grass not counting the Grass Gekkos. Link to comment https://forums.kleientertainment.com/forums/topic/71684-how-to-stop-grass-gekko-spawns-without-mods/ Share on other sites More sharing options...
DarkXero Posted November 14, 2016 Share Posted November 14, 2016 TheSim:FindEntities(x, y, z, 10, { "grassgekko" }) This returns a table with all entities that have the tag "grassgekko", that are within a 10 units radius. # This operator returns the number of entities on the table. < 8 This is a number comparison. Therefore if #TheSim:FindEntities(x, y, z, 10, { "grassgekko" }) < 8 then means "if the number of entities with the grasgekko tag is less than 8, within a 10 units radius". B is correct. Link to comment https://forums.kleientertainment.com/forums/topic/71684-how-to-stop-grass-gekko-spawns-without-mods/#findComment-837323 Share on other sites More sharing options...
zzKratoszz Posted November 14, 2016 Author Share Posted November 14, 2016 Thanks. That is exactly how I read the argument (thanks non lua but math reading skills) but I wasn't entirely sure. The reason the body is so long is because I needed to be sure this wasn't another gobbler. Even though the gobbler has stupid damage it never actually attacks anyone. Link to comment https://forums.kleientertainment.com/forums/topic/71684-how-to-stop-grass-gekko-spawns-without-mods/#findComment-837330 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.