How to create cracks in the ground?
-
Does anyone know how to put cracks in the ground like the superman mod / hulk script?
-
Does anyone know how?
-
@NotCrunchyTaco Wish I could tell you, I need to know too but haven't gotten around it it. You can get Native Watcher and JulioNIB's Superman script and examine the natives that are used. If I get around to it I'll let you know but it won't be today
-
@stillhere Alright, do you know of any native watchers?
-
@stillhere Never mind. Found one with a simple search
-
@NotCrunchyTaco said in How to create cracks in the ground?:
@stillhere Alright, do you know of any native watchers?
Main site, search for the words I have highlighted.
-
@LeeC2202 got it
-
@NotCrunchyTaco LOL
I just noticed the post out of the corner of my eye and knew there was one on there because I used it the other day.
Ground my GTAV to an almost standstill using it though, so beware the performance hit.
-
@LeeC2202 alright. My FPS is already low enough......
-
@NotCrunchyTaco
I decompiled his mod. I'm pretty sure you have to use the ADD_DECAL native function. This is his function and enum for ADD_DECAL: http://pastebin.com/xYe6R0eX
The decal you're looking for is bang_concrete_bang (of which the value is 5000).
-
@Jitnaught i'll try it
-
@Jitnaught @LeeC2202 @stillhere It didn't work. I did this:
Function.Call<int>(Hash.ADD_DECAL, "bang_concrete_bang", p.Position.X, p.Position.Y, p.Position.Z, 0, 0, -1.0, 0, 1.0, 0, 1.0, 1.0, 0.1, 0.1, 0.1, 1.0, 20.0, 0, 0, 0);
-
@NotCrunchyTaco The first parameter is not a string, it is an integer. You want to use the value 5000, or just use that enum and use DecalType.band_concrete_bang.
-
@Jitnaught oh
-
@Jitnaught Didn't work and I did this:
Function.Call<int>(Hash.ADD_DECAL, 5000, p.Position.X, p.Position.Y, p.Position.Z, 0, 0, -1.0, 0, 1.0, 0, 1.0, 1.0, 0.1, 0.1, 0.1, 1.0, 20.0, 0, 0, 0);
-
@NotCrunchyTaco It might not be visible since you are adding it to the ped's position, which would be inside of the ped. You should use the bone coords of one of the feet of the ped so you can see the decal on the ground.
-
@Jitnaught good idea!
-
@Jitnaught I am trying this right now:
Function.Call<int>(Hash.ADD_DECAL, 5000, p.GetBoneCoord(Bone.SKEL_R_Foot).X, p.GetBoneCoord(Bone.SKEL_R_Foot).Y, p.GetBoneCoord(Bone.SKEL_R_Foot).Z, 0, 0, -1.0, 0, 1.0, 0, 1.0, 1.0, 0.1, 0.1, 0.1, 1.0, 20.0, 0, 0, 0);
-
@Jitnaught @LeeC2202 @stillhere Cheers! It worked!
Function.Call<int>(Hash.ADD_DECAL, 5000, p.GetBoneCoord(Bone.SKEL_R_Foot).X, p.GetBoneCoord(Bone.SKEL_R_Foot).Y, p.GetBoneCoord(Bone.SKEL_R_Foot).Z, 0, 0, -1.0, 0, 1.0, 0, 1.0, 1.0, 0.1, 0.1, 0.1, 1.0, 20.0, 0, 0, 0);
-
@NotCrunchyTaco Awesome! Btw, if the decal floating above ground when the player's foot is picked up (while walking) irritates you, you can replace the foot position with the ground position.
Vector3 pPos = p.Position; Function.Call<int>(Hash.ADD_DECAL, 5000, pPos.X, pPos.Y, World.GetGroundHeight(pPos), 0, 0, -1.0, 0, 1.0, 0, 1.0, 1.0, 0.1, 0.1, 0.1, 1.0, 20.0, 0, 0, 0);
-
@Jitnaught Do you know about the problem with that function?
It always sets the source Z position at 1000, so if you walk under a bridge, it detects the ground on top of the bridge.. or anything else you might walk under that's higher than the player.
-
@Jitnaught Ah, yes! But, I have been using this for about 10 minutes now and I haven't seen 1 decal floating
-
@LeeC2202 True, I didn't think about that. Instead just make your own function that gets the value from GET_GROUND_Z_FOR_3D_COORD.
private float getGroundZ(Vector3 pos) { OutputArgument outArg = new OutputArgument(); Function.Call<bool>(Hash.GET_GROUND_Z_FOR_3D_COORD, pos.X, pos.Y, pos.Z, outArg, false); return outArg.GetResult<float>(); }
-
@Jitnaught That's what I do... I had to do all that for my helicopter effects as I needed to detect ground height and water height. That was where I discovered the problem with it, when I first flew under a bridge and the particle effects disappeared.
-
@LeeC2202 How did you detect what terrain was underneath the player's chopper e.g. desert, city, gras/dirt