Jump to content

.map or createObject


Forrest

Recommended Posts

Posted

Hey, just looking into something that has never really bothered me before, but now I'd like my server maps to be hidden and not accessible, so I thought now would be the time to ask.

What are the differences between using .map or server-sided createObject? Is there any difference in streaming, or performance?

Thanks.

  • Moderators
Posted

.map vs createObject

There is a difference between loading speed. Because for loading a map file there is only 1 MTA function needed(or none when it is included in the meta.xml). When using createObject you have to execute that per object and you have to use other functions to add properties.

Map files will be loading directly with the C++ functions which are intern. When using MTA functions, they will call those functions external. Which is slower.

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

Posted

Oooh, that makes sense I guess.

How about streaming? Does that make any difference?

Is there any way to use .maps without them being stored on the client?

  • Moderators
Posted

They both create the same type of elements.

The only difference is that they use a different (middle) parent element.

See here more information about those middle parents:

https://wiki.multitheftauto.com/wiki/Element_tree

Do you want to improve your Lua programming skills and make less mistakes?   Start with Lua Language Server!   🙀

 

  Useful functions  3x 

  Tutorials  4x 

 

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...