Notifications
Clear all

[Closed] Help with custom geometry, simple object

I want to use max as a game(level) editor. I have game specific objects that need to be placed all around the level.

My approach is to create every object in a separate max file. Then when creating the level using an scripted plugin, I load the max file of the particular object, so every object of the same type will always have the same geometry. I am using a simpleObject for this:

on buildMesh do 
( 
    file = scriptsPath + "\objects	ree.max"
    mergeMAXFile file #(tree) #select #MergeDups
    s = selection[1]
    setMesh mesh s.mesh
    delete s
) --end buildMesh

First problem is, it doesn’t copy the material to the new object, so it starts with just a plain color.

The second problem is that when I create a second object, it removes the first one. So I can only create one object in a row. If I deselect the first object and try again, it works.

This is my approach, I don´t know if there is a better one, or maybe some tutorials on how to create a level editor using max…

Thanks…

3 Replies

Have you tried working with XRefs instead?

Cheers,
Martijn

Ok, so now I am using XRef… but

When I load the Xref it become a separate object.

on buildMesh do 
( 
    file = scriptsPath + "\objects	ree.max"
    p_obj = xrefs.addNewXrefObject archivo "tree"
    .
    .
 )

How do I attach this XRef obj to my new object, so I would get an object of my type, but that looks like the Xref object…?

Ok, fixed it…

I am using XRef to import the objects I need.

And I created a SimpleMod, that lets me set the specific game properties.

Thanks…