IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Post mod/code requests in the Mod Requests topic

Post mod releases in the Mod Showroom

Read the Modding Rules BEFORE posting!

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Changing the decal limit?

 
somedood  
Posted: Thursday, Oct 4 2012, 23:34
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Oct 4, 2012

XXXXX



Hey guys, just wondering if there is any way to change the decal limits ingame (it sucks when youre in a massive firefight with cops and damage decals disappear from my car and the cars around). Googling it gave nothing (I cant be the first one to think of it..) so if anyone knows a way to make decals stay longer (perhaps bodies too?) it would be pretty awesome.
PM
  Top
 

 
Grady Featherstone  
Posted: Friday, Oct 5 2012, 13:47
Quote Post


GTAPoliceMods.com Web Developer
Group Icon
Group: Members
Joined: Jan 4, 2012

au.gif

XXXXX



When you say damage decals, are you talking about, like bullet holes in cars and such? If so, I'm not sure you're going to be able to have much luck in getting that to stay... I may be wrong however, so I'm not saying it's impossible....
To keep dead bodies from despawning should be easy, however.
You could try a simple C# script something like this:

CODE

using System;
using GTA;

namespace KeepDeadBodiesFromDisappearing
{
   public class keepDeadBodiesFromDisappearing : Script
   {
       Ped[] allPeds;
       public keepDeadBodiesFromDisappearing()
       {
           Interval = 1000;
           this.Tick += new EventHandler(keepDeadBodiesFromDisappearingTick);
       }
       public void keepDeadBodiesFromDisappearingTick(object sender, EventArgs e)
       {
           allPeds = World.GetAllPeds();
           foreach (Ped deadPed in allPeds)
           {
               if (deadPed.isDead)
               {
                   if (!deadPed.isRequiredForMission)
                   {
                       deadPed.isRequiredForMission = true;
                   }
               }
           }
       }
   }
}


What that does is gets all the peds currently in the world, and then checks to see which ones of them are dead...
It then sets them as "Mission Peds" which means the game thinks it needs them for a mission and therefore won't delete them....
No guarantee this code will work, as I just quickly wrote it, but I hope it helps you out!!!
Just save all that into a blank notepad file and save it as "ihopethatthisscriptworksforyou.cs" (without speech marks tounge.gif) and place it in your "scripts" folder in your main GTA IV directory!!!!

I hope it works for you!!! If not, tell me and I'll see where I went wrong!!!
biggrin.gif
Users WebsitePM
  Top
 

 
ch3y3zze  
Posted: Friday, Oct 5 2012, 19:40
Quote Post


ni**erKILLER
Group Icon
Group: BUSTED!
Joined: Aug 30, 2012

us.gif

XXXXX



that will probably mess ur game up because then game wont be able to spawn new peds once it hits the ped limit because ur not deleting dead ones
PM
  Top
 

 
Grady Featherstone  
Posted: Friday, Oct 5 2012, 22:25
Quote Post


GTAPoliceMods.com Web Developer
Group Icon
Group: Members
Joined: Jan 4, 2012

au.gif

XXXXX



True! Yes!!! So somedood, how would you like the peds to disappear? When you get a certain distance away? Or would you like to manually clear them? Something like that maybe?
Users WebsitePM
  Top
 

 
somedood  
Posted: Saturday, Oct 6 2012, 15:35
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Oct 4, 2012

XXXXX



Thanks for the help! Wow, I didnt even think manual disappearing is an option, it sounds awesome(going back to previous scenes of massacre with bodies already laying around there). If there is a way to make manual disappearing and having all bodies cleared out in case I die- that would probably be the best. Its a shame there is no way to make damage decals stay on cars, but its no big deal.
PM
  Top
 

 
Grady Featherstone  
Posted: Saturday, Oct 6 2012, 18:15
Quote Post


GTAPoliceMods.com Web Developer
Group Icon
Group: Members
Joined: Jan 4, 2012

au.gif

XXXXX



Ok then, well replace everything in the file (original script) with this:

CODE
using System;
using GTA;

namespace KeepDeadBodiesFromDisappearing
{
   public class keepDeadBodiesFromDisappearing : Script
   {
       Ped[] allPeds;
       public keepDeadBodiesFromDisappearing()
       {
           Interval = 1000;
           this.Tick += new EventHandler(keepDeadBodiesFromDisappearingTick);
       }
       public void keepDeadBodiesFromDisappearingTick(object sender, EventArgs e)
       {
           allPeds = World.GetAllPeds();
           foreach (Ped deadPed in allPeds)
           {
               if (deadPed.isDead)
               {
                   if (!deadPed.isRequiredForMission)
                   {
                       deadPed.isRequiredForMission = true;
                   }
                   if (Player.Character.isDead)
                   {
                       deadPed.isRequiredForMission = false;
                       deadPed.Delete();
                   }
               }
           }
       }
   }
}

Alright, now this script will work exactly the same as originally, except now, if you die, all the dead peds will be removed!!!!
Try this out and tell us how it goes!!!! biggrin.gif
Users WebsitePM
  Top
 

 
somedood  
Posted: Sunday, Oct 7 2012, 09:24
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Oct 4, 2012

XXXXX



Hmmm, I dont have a scripts folder in the main game folder, and the closest thing to a .cs type file I had was some .csv files in common/data folder. What did I get wrong?
PM
  Top
 

 
Grady Featherstone  
Posted: Sunday, Oct 7 2012, 11:30
Quote Post


GTAPoliceMods.com Web Developer
Group Icon
Group: Members
Joined: Jan 4, 2012

au.gif

XXXXX



Ok, all you have to do is follow a few steps and you're good to go!!!
If you don't have a "scripts" folder in your main Grand Theft Auto IV directory, then just create one! Call it "scripts" without the speech marks!

Then copy the code just above and paste it into a new notepad file! Then save that file as whateveryouwant.cs It doesn't matter what you call the file, as long as it has a .cs extension!
Then make sure you have the Scripthook installed, and I think you will need an ASI loader too!!!

Once you have completed all those steps the script should work!!!

Here is a link to the Scripthook: http://www.gtaforums.com/index.php?showtopic=392325
And here is an ASI loader: http://www.gtaforums.com/index.php?showtopic=394806

If you still have problems post back and I will see if I missed something!!!!! tounge.gif
Users WebsitePM
  Top
 

 
somedood  
Posted: Sunday, Oct 7 2012, 17:06
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Oct 4, 2012

XXXXX



Tried the steps above, with ASI loader game wouldnt start, and after I deleted ASI game crashes as soon as the level is loaded. My bet would be conflict with icenhancer...
PM
  Top
 

 
ch3y3zze  
Posted: Sunday, Oct 7 2012, 17:19
Quote Post


ni**erKILLER
Group Icon
Group: BUSTED!
Joined: Aug 30, 2012

us.gif

XXXXX



no, it's not ice, read my signature LOL

if ur using 1.0.4, use scripthook.dll 0.4.0
PM
  Top
 

 
somedood  
Posted: Sunday, Oct 7 2012, 18:58
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Oct 4, 2012

XXXXX



Thanks for the help! Works like a charm, until I die, then game crashes..
PM
  Top
 

 
ch3y3zze  
Posted: Sunday, Oct 7 2012, 21:52
Quote Post


ni**erKILLER
Group Icon
Group: BUSTED!
Joined: Aug 30, 2012

us.gif

XXXXX



CODE
using System;
using GTA;

namespace KeepDeadBodiesFromDisappearing
{
  public class keepDeadBodiesFromDisappearing : Script
  {
      Ped[] allPeds;
      public keepDeadBodiesFromDisappearing()
      {
          Interval = 1000;
          this.Tick += new EventHandler(keepDeadBodiesFromDisappearingTick);
      }
      public void keepDeadBodiesFromDisappearingTick(object sender, EventArgs e)
      {
          if (Player.Character.isDead)
          {
              while (Player.Character.isDead) { Wait(0); }
              foreach (Ped ped in World.GetAllPeds())
              {
                   if (Game.Exists(ped) && ped.isDead)
                   {
                       ped.Delete();
                   }
              }
          }

          allPeds = World.GetAllPeds();
          foreach (Ped deadPed in allPeds)
          {
              if (Game.Exists(deadPed) && deadPed.isDead)
              {
                  if (!deadPed.isRequiredForMission)
                  {
                      deadPed.isRequiredForMission = true;
                  }
              }
          }
      }
  }
}


not tested so let us know wink.gif

@Grady Featherstone i thought id move checking the player death out of the loop that sets peds required and just check on the loop then let world load again before deleting the dead peds, in theory should avoid the crash and delete all the saved dead peds

This post has been edited by ch3y3zze on Monday, Oct 8 2012, 02:29
PM
  Top
 

 
somedood  
Posted: Monday, Oct 8 2012, 02:59
Quote Post


Player Hater
Group Icon
Group: Members
Joined: Oct 4, 2012

XXXXX



Seems to work fine, thanks! Im posting another thread with another cool idea, maybe local script wizards will like it too.
PM
  Top
 

 
ch3y3zze  
Posted: Monday, Oct 8 2012, 03:28
Quote Post


ni**erKILLER
Group Icon
Group: BUSTED!
Joined: Aug 30, 2012

us.gif

XXXXX



cool glad its workin
PM
  Top
 

 
Grady Featherstone  
Posted: Monday, Oct 8 2012, 06:07
Quote Post


GTAPoliceMods.com Web Developer
Group Icon
Group: Members
Joined: Jan 4, 2012

au.gif

XXXXX



Alright cool!!!! Will check it out! And thanks for the corrections ch3y3zze!!!!
Users WebsitePM
  Top
 

 

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG