Jump to content

Accessing .map attributes from script


nogisz

Recommended Posts

Hi, I'm trying to access custom attribute from .map file but script outputs "false" as a result.

As an example I have "object" node 

<object id="object (bevgrnd03b_law) (1)" [...] myCustomAttr="bleh"></object>

and I'm trying to iterate through all "object" elements and check whether it has "myCustomAttr" by using getElementData(el, "myCustomAttr") but this doesn't work.

I saw in other scripts they do this and it just works but in my case it outputs "false". Could anybody help me with this problem? 

Link to comment
  • Moderators
On 11/01/2022 at 11:32, nogisz said:

I saw in other scripts they do this and it just works but in my case it outputs "false". Could anybody help me with this problem? 

See this meta.xml tag.

Quote
  • <sync_map_element_data /> Controls whether map element data such as "PosX" and "DoubleSided" are transferred to the client. This data is usually not required by most gamemodes or resources. (Map Editor and Interiors require this to be not set to false to work). When set in a gamemode meta.xml, the setting will apply to all maps loaded by that resource.
    • false: Disable transfer of map element data for all resources. This can reduce map download times considerably.
    • true: Enable transfer of map element data for all resources. (If false and true are set in different resources, true will have priority and all resources will transfer map element data)

https://wiki.multitheftauto.com/wiki/Meta.xml
 

Set it to true in the gamemode which you are using:

<sync_map_element_data>true</sync_map_element_data>

 

Link to comment
  • IIYAMA locked this topic
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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