milkjunk87 Posted June 24, 2016 Share Posted June 24, 2016 hey guys how do i spawn a prop of glass than can be destroyed like at bus stops and windshields? i have tried the following: prop_sglasss_1b_lod, prop_showroom_glass_1b, prop_fib_broken_window. All of these are indestructible and do not fall apart upon being shot. Thanks mockba.the.borg 1 Link to comment Share on other sites More sharing options...
milkjunk87 Posted June 27, 2016 Author Share Posted June 27, 2016 f*ck it who wants to help me make a building out of props that is frozen entity until damaged then collapses? Link to comment Share on other sites More sharing options...
ins1de Posted June 27, 2016 Share Posted June 27, 2016 (edited) hey guys how do i spawn a prop of glass than can be destroyed like at bus stops and windshields? i have tried the following: prop_sglasss_1b_lod, prop_showroom_glass_1b, prop_fib_broken_window. All of these are indestructible and do not fall apart upon being shot. Thanks The glass you can find at the bus stop seems to be a part of the bus stop itself. There is no possible way to get the glass ID for example. However, I've noticed there was a native for Windshields : static void _DETACH_VEHICLE_WINDSCREEN(Vehicle vehicle) You can use it with : public void OnKeyDown(object sender, KeyEventArgs e) { if(e.KeyCode == Keys.B) { Vehicle currentCar = player.CurrentVehicle; Function.Call(Hash._DETACH_VEHICLE_WINDSCREEN, currentCar); UI.ShowSubtitle("Detached"); } } And it will return : Hope it helps. Edited June 27, 2016 by ins1de jedijosh920 1 Link to comment Share on other sites More sharing options...
milkjunk87 Posted June 28, 2016 Author Share Posted June 28, 2016 awesome sauce hey guys how do i spawn a prop of glass than can be destroyed like at bus stops and windshields? i have tried the following: prop_sglasss_1b_lod, prop_showroom_glass_1b, prop_fib_broken_window. All of these are indestructible and do not fall apart upon being shot. Thanks The glass you can find at the bus stop seems to be a part of the bus stop itself. There is no possible way to get the glass ID for example. However, I've noticed there was a native for Windshields : static void _DETACH_VEHICLE_WINDSCREEN(Vehicle vehicle) You can use it with : public void OnKeyDown(object sender, KeyEventArgs e) { if(e.KeyCode == Keys.B) { Vehicle currentCar = player.CurrentVehicle; Function.Call(Hash._DETACH_VEHICLE_WINDSCREEN, currentCar); UI.ShowSubtitle("Detached"); } } And it will return : Hope it helps. awesome sauce ill give it a go Link to comment Share on other sites More sharing options...
mockba.the.borg Posted June 28, 2016 Share Posted June 28, 2016 It looks to me that the physics on the glass (including the detached windshields) is not real. Only thing that is happening is a trick with textures and transparency maps. The windshield in the picture, for example, when shot, doesn't shatter into a thousand pieces as a frame of glass would do. Its frame stays intact. So, if it was supporting something, that thing would not fall when the glass is shot, as the frame would still hold it. Does it have to be glass? What about bricks and barrels? we see those around the map, and as far as I remember, the bricks indeed shatter and disappear when shot. Not sure if barrels will explode though. Cheers, Mockba. Link to comment Share on other sites More sharing options...
milkjunk87 Posted June 29, 2016 Author Share Posted June 29, 2016 It looks to me that the physics on the glass (including the detached windshields) is not real. Only thing that is happening is a trick with textures and transparency maps. The windshield in the picture, for example, when shot, doesn't shatter into a thousand pieces as a frame of glass would do. Its frame stays intact. So, if it was supporting something, that thing would not fall when the glass is shot, as the frame would still hold it. Does it have to be glass? What about bricks and barrels? we see those around the map, and as far as I remember, the bricks indeed shatter and disappear when shot. Not sure if barrels will explode though. Cheers, Mockba. Yea i dont know how to do this. heres what ive done if (e.KeyCode == Keys.E & modon) { //Prop glassyglass = World.CreateProp("prop_sglasss_1b_lod", Game.Player.Character.Position, true, false); //Prop glassyglass2 = World.CreateProp("prop_sglasss_1b_lod", Game.Player.Character.Position+ new Vector3(0f, 0f, 0f), true, false); //Prop glassyglass3 = World.CreateProp("prop_showroom_glass_1b", Game.Player.Character.Position + new Vector3(0f, 0f, 4f), true, false); //Prop glassyglass3 = World.CreateProp("prop_fib_broken_window", Game.Player.Character.Position + new Vector3(0f, 0f, 4f), true, false); //glassyglass.AddBlip(); //glassyglass2.AddBlip(); //glassyglass3.AddBlip(); /* for (int suicidepilotsindex = 0; suicidepilotsindex < 25; suicidepilotsindex++) { Prop glassyglass = World.CreateProp("prop_acc_guitar_01", Game.Player.Character.Position+ new Vector3(3f, 0f, 0f), true, false); Prop glassyglass2 = World.CreateProp("prop_acc_guitar_01", Game.Player.Character.Position+ new Vector3(3.5f, 0f, 0f), true, false); } */ for (int myindex3 = 1; myindex3 < 2; myindex3++) { Random myrandom = new Random(); int randbottom = myrandom.Next(-5, 0); int randright = myrandom.Next(-1, 5); int randfront = myrandom.Next(-5, 5); GTA.Math.Vector3 skydivepoint = Game.Player.Character.Position + Vector3.RelativeBottom * randbottom; skydivepoint = skydivepoint + Vector3.RelativeFront * randfront; skydivepoint = skydivepoint + Vector3.RelativeRight * randright; //Vehicle biff = World.CreateVehicle(VehicleHash.Biff, skydivepoint); skydivepoint=Game.Player.Character.Position+ 5*Game.Player.Character.ForwardVector; Vehicle biff = World.CreateVehicle(VehicleHash.Biff, skydivepoint); Function.Call(Hash._DETACH_VEHICLE_WINDSCREEN, biff); trucks.Add(biff); biff.AddBlip(); //GTA.Native.Function.Call(GTA.Native.Hash._0x9D77056A530643F6, time, 1); //biff.Delete(); }} Do you know how to void FREEZE_ENTITY_POSITION(Entity entity, BOOL toggle) // 428CA6DBD1094446 65C16D57 get the windscreen entity? Link to comment Share on other sites More sharing options...
milkjunk87 Posted June 25, 2017 Author Share Posted June 25, 2017 Actually the glass physics is quite accurate it doesnt allow player to move through until after shot (see bus stations) then when you move through it shatters as you go threw. Anyone want to code it up? Link to comment Share on other sites More sharing options...
ins1de Posted June 27, 2017 Share Posted June 27, 2017 Actually the glass physics is quite accurate it doesnt allow player to move through until after shot (see bus stations) then when you move through it shatters as you go threw. Anyone want to code it up? There's probably some glass object that does break on collision. Have you tried more objects that the one if your code? http://objects.codeshock.hu/gallery.php?page=5&perpage=12&search=glassthere has to be something Link to comment Share on other sites More sharing options...
devil614 Posted March 19, 2020 Share Posted March 19, 2020 Any way I can get that script that shows every object ID and distance on screen, as shown displaying the windshield? Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now