Jump to content
  • 0

Remove all the default sa city models in an MTA map?


dopeboi

Question

Hello I was wondering if there is an easier way to remove all the default sa city models in a multiplayer MTA map? There was an old tool called a "map cleaner" but no longer works.

So far it seems the only way is to find the ID of each object and its texture and add a line to a script to delete each one. Oh my god is that going to take me forever.

I'm trying to make a completely new city with custom assets I made in 3dsmax & zbrush but I wish there was an easier way start with a blank map. I mean, I understand adding a feature to remove default models within the map editor may be added eventually, but I just want to remove EVERYTHING. All models and textures except for characters animations & vehicles. Wouldn't that be easier to do?

Link to comment

17 answers to this question

Recommended Posts

  • 0
removeWorldModel 

Yeah but with that function don't you have to get the ID of each and every single model as well as its texture and that will take like hundreds of lines and alot of time to delete every single model?

Or is there a way to use that function in an easier way to delete every default model at once? Someone experimented and tried this on his server:

for i=1,100000 do removeWorldModel(i,10000,0,0,0)

And most of the world disappeared. Am I on the right track with that? Or can someone give me a better example, there has to be an easier way to remove every default model at once easily

Link to comment
  • 0
removeWorldModel 

for i=1,100000 do 
   removeWorldModel(i,10000,0,0,0) 
end 

And most of the world disappeared. Am I on the right track with that?

yes, and try this:

for i=0,100000 do 
    removeWorldModel(i,99999,0,0,0) 
end 

Warning:You can't actually do anything with no models

Link to comment
  • 0

Warning:You can't actually do anything with no models

Haha thanks for the proper code. I plan to import all my custom models from 3dsmax, I have a big city already made that was being used in another game engine. I want to make a completely new map with all custom models.

I mean this should be possible with multiplayer pretty easily with that function right? And not only that, you can use google 3d warehouse, or rip models from other games to use. You could put like a world of warcraft forest if you wanted already made and change the models around a bit. :D

Link to comment
  • 0

Another question- this function will only remove all default models at runtime when the server is started and not while using the map editor correct? So you will have to start building the new map a few stories above the default city in the editor since everything is still there? And everything thats custom won't be removed since my imported models id's are higher numbers?

Link to comment
  • 0
removeWorldModel 

for i=1,100000 do 
   removeWorldModel(i,10000,0,0,0) 
end 

And most of the world disappeared. Am I on the right track with that?

yes, and try this:

for i=0,100000 do 
    removeWorldModel(i,99999,0,0,0) 
end 

Warning:You can't actually do anything with no models

  
for i = 550, 20000 do 
    removeWorldModel ( i, 10000, 0, 0, 0 ) 
end 
  

San Andreas only have MAX 20.000 objects, so removing 100.000 is a bit crazy ...

Link to comment
  • 0

Update: Okay the following script works there was a pastebin copy paste 1 character problem. :redhotevil:

Ok well I have the script running on my server through deathmatch mode. Although there are still a bunch of models still visible around the map. :evil:

This is the script:

function removeObjects ()

for i = 550, 20000 do

removeWorldModel ( i, 10000, 0, 0, 0 )

end

end

addEventHandler ( "onResourceStart", getResourceRootElement(getThisResource()), removeObjects )

I put that in C:\Program Files (x86)\MTA San Andreas 1.3\server\mods\deathmatch\resources\[gamemodes]\[deathmatch]\deathmatch.zip

inside a new file called removedefault.lua

Then I opened the meta.xml in the deathmatch.zip resource and added rite under

Finally I set the gamemode to deathmatch and most things disappear when map loads :) Now if only I can figure how to completely remove every single default model

Edited by Guest
Link to comment
  • 0

ok, in that meta.xml, the newscript.lua is suppose to be the script name, example: removedefault.lua

="removedefault.lua" type="server" />

here's the new script:

addEventHandler ( "onResourceStart",resourceRoot,function() 
    for i = 550, 20000 do 
        removeWorldModel ( i, 10000, 0, 0, 0 ) 
    end 
end) 

Link to comment
  • 0
You will have to know that in MTA it's recommended that you put your objects in 1 autodesk model, because actually if you put so much custom models in MTA, it would be unstable.

What? Really? I would think combining that many models would cause a crash. You certainly can't do that in other game engines. I'll be having like a whole city worth of models. Do you really combine them all? Or are you exaggerating?

How many custom models exactly can you use before its unstable?

Link to comment
  • 0
Look at Akina map, it is a big and cool montain with only 8 models, so I believe you can do something similar.

That is what I actually do because there isn't another way, otherwise your city will be unstable as hell.

Other experienced map editors on mta irc told me I could probably be safe with 100 - 150 models. Not 8. :shock:

Problem I'm having now is this script is removing even my custom & all models from my map. How can I edit this function to remove most of the game models but leave like 200 left for me to use for custom models? There are 18634 models total in my model browser in my map editor.

Link to comment
  • 0

Alright got it all working now but there is a bug it seems. Alot of models are still not removed until you enter and exit the model viewer. This happens both on server and alone in editor. What's up with that? So without doing this, normal players might still be seeing alot of models for some reason.

The script does remove 70% of the visible models / textures but only once you open and close the model viewer, the script only THEN does what it should and everything is cleared.

Can someone please confirm this or help find out whats causing this? Thanks for all the help so far!

Link to comment
  • 0
Alright got it all working now but there is a bug it seems. Alot of models are still not removed until you enter and exit the model viewer. This happens both on server and alone in editor. What's up with that? So without doing this, normal players might still be seeing alot of models for some reason.

The script does remove 70% of the visible models / textures but only once you open and close the model viewer, the script only THEN does what it should and everything is cleared.

Can someone please confirm this or help find out whats causing this? Thanks for all the help so far!

This is because when a client has models loaded/sees them, and then you remove them with removeWorldObject, they stay visible untill GTA unloads them, after that they won't return.

removeWorldObject just disables that MTA cannot load the model into the world, but if it's already loaded into the world, you will still see it, untill it's unloaded (You go far away from it), after that, it won't reappear.

So... In short, if the script is running BEFORE the client actually joins, he won't see the "random" models.

Also, about your model limit, I do suggest trying to stay as low as possible with an absolute max of about 100.

I'm currently @ 60 models with this project of mine; viewtopic.php?f=93&t=43395 and it's still quite stable (considering the MTA streamer and engineReplace functions are a total mess).

I once tried ~140 objects with another project of mine, which turned into a complete bugged mess.

Link to comment

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...