remol Posted March 24, 2010 Share Posted March 24, 2010 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 More sharing options...
ZAZ Posted March 24, 2010 Share Posted March 24, 2010 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 trueIf 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 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
sjaak327 Posted March 24, 2010 Share Posted March 24, 2010 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 More sharing options...
remol Posted March 24, 2010 Author Share Posted March 24, 2010 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 More sharing options...
ZAZ Posted March 24, 2010 Share Posted March 24, 2010 (edited) 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 March 24, 2010 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
remol Posted March 25, 2010 Author Share Posted March 25, 2010 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 More sharing options...
ZAZ Posted March 25, 2010 Share Posted March 25, 2010 ZAZAre 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 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Intosia Posted March 26, 2010 Share Posted March 26, 2010 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 More sharing options...
sjaak327 Posted March 26, 2010 Share Posted March 26, 2010 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 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