[A9] Events from space - Meteors/Meteorites/RazorRain

Started by skullywag, February 01, 2015, 05:12:05 PM

Previous topic - Next topic

Ninefinger

Quote from: skullywag on April 10, 2015, 06:12:51 PM
Ninefinger its nothing to do with what they are, even if you used projectiles id need to code what it was allowed to pass through and what it wasnt, there is a line of code in the utility class that searches for a cell, it is simply coded in there in GenCellFinder.RandomCellWith and then passed some parameters, id need to do the same with projectiles, they need a firing source and a destination, guess how id pick that destination...yep..GenCellFinder.RandomCellWith..

Seriously dont get hung up on WHAT these "things" are (they are all Things). I can make them land wherever i choose very easily, if people want a version that doesnt care about roofs, just ask. Its like a 3 word change to make it happen.

Ok that seems a fine, i was just guessing since i clearly stated i was not 100% sure, and that i i have absolutely no idea how to mod with c++ or visual studios, but now that you have clarified that, maybe you could simply post the solution since it is only a "3 word change" that places parameters to not allow them to land on Overhead mountains or Thin rock roofs sepcifically and still allowing them to land on constructed ones?

skullywag

Quote from: Ninefinger on April 10, 2015, 07:21:45 PM
Quote from: skullywag on April 10, 2015, 06:12:51 PM
Ninefinger its nothing to do with what they are, even if you used projectiles id need to code what it was allowed to pass through and what it wasnt, there is a line of code in the utility class that searches for a cell, it is simply coded in there in GenCellFinder.RandomCellWith and then passed some parameters, id need to do the same with projectiles, they need a firing source and a destination, guess how id pick that destination...yep..GenCellFinder.RandomCellWith..

Seriously dont get hung up on WHAT these "things" are (they are all Things). I can make them land wherever i choose very easily, if people want a version that doesnt care about roofs, just ask. Its like a 3 word change to make it happen.

Ok that seems a fine, i was just guessing since i clearly stated i was not 100% sure, and that i i have absolutely no idea how to mod with c++ or visual studios, but now that you have clarified that, maybe you could simply post the solution since it is only a "3 word change" that places parameters to not allow them to land on Overhead mountains or Thin rock roofs sepcifically and still allowing them to land on constructed ones?

I lied, its actually a 1 word change.

In Thing_RazorSpawner change:


IntVec3 dropCenter = GenCellFinder.RandomCellWith((IntVec3 sq) => GenGrid.Standable(sq) && !Find.RoofGrid.Roofed(sq) && !Find.FogGrid.IsFogged(sq));


to:


IntVec3 dropCenter = GenCellFinder.RandomCellWith((IntVec3 sq) => GenGrid.Standable(sq) && !Find.RoofGrid.RoofAt(sq).isThickRoof && !Find.FogGrid.IsFogged(sq));


;)

edit oh sorry misread, you said thickroof and thin rock roofs, change the isThickRoof to IsNatural. You could also remove the fog part if youre not bothered by that.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Ninefinger

Quote from: skullywag on April 10, 2015, 07:30:07 PM
Quote from: Ninefinger on April 10, 2015, 07:21:45 PM
Quote from: skullywag on April 10, 2015, 06:12:51 PM
Ninefinger its nothing to do with what they are, even if you used projectiles id need to code what it was allowed to pass through and what it wasnt, there is a line of code in the utility class that searches for a cell, it is simply coded in there in GenCellFinder.RandomCellWith and then passed some parameters, id need to do the same with projectiles, they need a firing source and a destination, guess how id pick that destination...yep..GenCellFinder.RandomCellWith..

Seriously dont get hung up on WHAT these "things" are (they are all Things). I can make them land wherever i choose very easily, if people want a version that doesnt care about roofs, just ask. Its like a 3 word change to make it happen.

Ok that seems a fine, i was just guessing since i clearly stated i was not 100% sure, and that i i have absolutely no idea how to mod with c++ or visual studios, but now that you have clarified that, maybe you could simply post the solution since it is only a "3 word change" that places parameters to not allow them to land on Overhead mountains or Thin rock roofs sepcifically and still allowing them to land on constructed ones?

I lied, its actually a 1 word change.

In Thing_RazorSpawner change:


IntVec3 dropCenter = GenCellFinder.RandomCellWith((IntVec3 sq) => GenGrid.Standable(sq) && !Find.RoofGrid.Roofed(sq) && !Find.FogGrid.IsFogged(sq));


to:


IntVec3 dropCenter = GenCellFinder.RandomCellWith((IntVec3 sq) => GenGrid.Standable(sq) && !Find.RoofGrid.RoofAt(sq).isThickRoof && !Find.FogGrid.IsFogged(sq));


;)

edit oh sorry misread, you said thickroof and thin rock roofs, change the isThickRoof to IsNatural. You could also remove the fog part if youre not bothered by that.

Awesome i think im starting to understand how those parameters work thanks for the fast reply :D

joachimalaya

I really like the idea of this mod, but it appears to be incompatible with Alpha 11. Do you plan to update it?

If not, I put something together myself, that drops exploding droppods which contain stone chunks or small amounts of minerals. With a few tweaks and a nice texture (instead of the default DropPod) I would love to share it.

Btw: your code helped a lot to learn the basics. thanks for that

skullywag

Yep im updating all my mods. Keep an eye out they are coming...slowly.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?