Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Opposite of MARK_CAR_AS_NO_LONGER_NEEDED


remol
 Share

Recommended Posts

Hi

 

When you use CREATE_CAR to create a car and don't call MARK_CAR_AS_NO_LONGER_NEEDED on it, it will stay in game.

Does anybody know if there's a way to achieve similar result with cars already created by the game engine - ie Niko steals a car and decides to keep it, but without parking it in the savegame parking spot?

 

I've tried STORE_CAR_CHAR_IS_IN_NO_SAVE to keep the car handle in memory, but the car still gets deleted when the distance between the car and the player reaches certain value. So far I've not figured out how to tackle this. Anyone can help?

 

Thanks

Link to comment
Share on other sites

 

When you use CREATE_CAR to create a car and don't call MARK_CAR_AS_NO_LONGER_NEEDED on it, it will stay in game.

 

No, this is not true

If player drives a car and leave it, and then enter another car and drives far away, the first car will disappear

this happens in every gta games

 

STORE_CAR_CHAR_IS_IN_NO_SAVE do the same like GET_CAR_CHAR_IS_USING

 

  local p = {}  GET_PLAYER_CHAR(GET_PLAYER_ID(), p) local PLAYER_CHAR = p.a if PLAYER_CHAR <= 0 then return end  if (IS_CHAR_IN_ANY_CAR(PLAYER_CHAR) == 1) then local NosCar = {} GET_CAR_CHAR_IS_USING(PLAYER_CHAR, NosCar)   local CarBlip = {}   ADD_BLIP_FOR_CAR(NosCar.a, CarBlip)

 

 

  local p = {}  GET_PLAYER_CHAR(GET_PLAYER_ID(), p) local PLAYER_CHAR = p.a if PLAYER_CHAR <= 0 then return end  if (IS_CHAR_IN_ANY_CAR(PLAYER_CHAR) == 1) then local NosCar = {} STORE_CAR_CHAR_IS_IN_NO_SAVE(PLAYER_CHAR, NosCar)   local CarBlip = {}   ADD_BLIP_FOR_CAR(NosCar.a, CarBlip)

 

 

STORE_CAR_CHAR_IS_IN don't work, can't find in any mission script

Link to comment
Share on other sites

Actually the OP is right, if you don't call MarkCarAsNoLongerNeeded, the automatic deletion of cars isn't happening, however the game still manages to delete cars when they use cleararea commands for instance.

 

Now to prevent this from happening, you could try and mark the car as mission car, and continuously (in tick) call this command, that way the game will never be able to clear the car.

Link to comment
Share on other sites

Thanks for replies guys, especially for the SET_CAR_AS_MISSION_CAR tip - works well and who knows how much time I had to spent before I considered using this function.

Anyway, I'm still testing it, but it looks like this is exactly what I needed. The trick does require the function to be invoked after the mission starts, hence the need to run it in loop I guess (fortunately doesn't have to be run very often, I tried in 2 seconds loop). Will keep testing.

 

Cheers

Link to comment
Share on other sites

 

Actually the OP is right, if you don't call MarkCarAsNoLongerNeeded, the automatic deletion of cars isn't happening, however the game still manages to delete cars when they use cleararea commands for instance.

 

 

theoretical yes but in not praxis, it's unbelievable, but I'm right

try it first yourself, get the playercarhandle and keep it in script while player leave it, enter another car and drive far away

but thanks for the tip with SET_CAR_AS_MISSION_CAR, it solve it.

Edited by ZAZ
Link to comment
Share on other sites

ZAZ

Are we talking about version 1.0.0.4? Everytime I'm trying this, it works fine.

I use CREATE_CAR, then MARK_MODEL_AS_NO_LONGER_NEEDED, but not MARK_CAR_AS_NO_LONGER_NEEDED and the car isn't deleted even if I'm at the other end of the city.

Link to comment
Share on other sites

 

ZAZ

Are we talking about version 1.0.0.4? Everytime I'm trying this, it works fine.

I use CREATE_CAR, then MARK_MODEL_AS_NO_LONGER_NEEDED, but not MARK_CAR_AS_NO_LONGER_NEEDED and the car isn't deleted even if I'm at the other end of the city.

version 1.0.0.4, 5.patch and Alice 0.9

DELETE_CAR delete the car

 

MARK_CAR_AS_NO_LONGER_NEEDED(NosCar)DELETE_CAR(NosCar)

 

MARK_MODEL_AS_NO_LONGER_NEEDED don't delete the car, it eliminate the script instance of the car and let the exe delete it by next opportunity, sounds a bit stupid by considering the fact that the car disappear when player drives a car and leave it, and then enter another car and drives far away, also if it is still available in our script.

But this is a special situation and we see now that there is a protection for missions

Link to comment
Share on other sites

ZAZ is right. When you load a car the game loads it from disk in memory, and places it in the street. If you mark it no longer need, the 'reference' or 'blueprint' of the car get deleted from mem, not the car in the street.

 

For ex if you want to spawm 100 cars, you dont want to Mark then until the last car. Otherwise the game wil load it from disk every single spawn.

Link to comment
Share on other sites

ZAZ is right. When you load a car the game loads it from disk in memory, and places it in the street. If you mark it no longer need, the 'reference' or 'blueprint' of the car get deleted from mem, not the car in the street.

 

For ex if you want to spawm 100 cars, you dont want to Mark then until the last car. Otherwise the game wil load it from disk every single spawn.

Hmm, no that is incorrect, that is mark_model_no_longer_needed, it doesn't need to load the model once the car is spawned...

 

Mark_Car_no_longer_needed, will flag the car to be deleted once it is not used anymore. If you mark the car no longer needed, the car is deleted once the player is a certain distance away from it. If you don't call this, the game will not automatically remove the car, and I know this for a fact, as I have done that for cars with a blip, they need to be not flagged for deletion, otherwise the blip would be useless.

 

Now sometimes the game still deletes the car (for instance during missions), to tackle that problem, you can continiously mark the car as mission car, or do other stuff with it, that way, even during missions, the car is not deleted.

 

 

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.