PDA

View Full Version : Help with custom geometry, simple object


ricardoarango
06-20-2007, 04:00 AM
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\tree.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..

magicm
06-20-2007, 10:20 AM
Have you tried working with XRefs instead?

Cheers,
Martijn

ricardoarango
06-20-2007, 08:08 PM
Ok, so now I am using XRef.. but

When I load the Xref it become a separate object.

on buildMesh do
(
file = scriptsPath + "\objects\tree.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...?

ricardoarango
06-20-2007, 08:58 PM
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..

CGTalk Moderation
06-20-2007, 08:58 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.