Jump to content

Custom elements & map elements


Recommended Posts

I have two elements, they have to be parents of everything. One of their children is "the spawn points" which is defined in a map file. How can I make "the spawn points" children of the two parent elements, from the map file?

I tried:

  
<map> 
    <parent1 id="x"> 
        <spawnpoints> 
            ... 
        </spawnpoints> 
        <cameras> 
            ... 
        </cameras> 
    </parent1> 
    <parent2 id="y"> 
        <cameras> 
            ... 
        </cameras> 
    </parent2> 
</map> 
  

But that code just made another two elements, instead of adding cameras and spawnpoints to the elements created already (which is what I want). Is this possible from the map file?

Link to comment

each element can only have one direct parent, but it can have many children...

the best thing that you can do is:

<map> 
    <parent1 id="x"> 
        <spawnpoints> 
            ... 
        </spawnpoints> 
        <parent2 id="y"> 
            <cameras> 
                ... 
           </cameras> 
        </parent2> 
    </parent1> 
</map> 

event handlets and functions attached to parent1 will work for spawnpoints and cameras, the ones attached to parent2 will only work for cameras

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