using 3d modeller as Level editor?

Some have mentioned that with tags and empties, Blender and chicken exporter can be used as a level editor. Code would need to be written which reads tags and does things accordingly.

Ive never used tags. And I dont understand them. Can anyone enlighten me?

Suppose I have a level with doors which should open upon contact (collision) and place pick-ups on the level. How can tags and other techniques be used here?

In the Logic panel in Blender, you can set properties, which will be translated to tags. A tag is nothing more than an arbitrary property assigned to a node. You can access these from the game using getTag/getNetTag. (Some special properties, like ‘Collide’, have different meanings and are not exported into tags by Chicken.)

I advise looking at Naith. It uses a really cool technique - in Blender, it links objects like trees to the level file in Blender, which you can instance into the level and instantly see the result, while you can still modify the tree separately (and it will automatically update in the level .blend file).
The trees will be exported as empties to the .egg file, and the .egg versions of those trees are put in place from the code. (Although I believe Chicken also supports {{}} structures that reference other .egg files).

code.google.com/p/naith/

Oh, ok, so a tag is like a 1 member dictionary which has a key string and value string?

I guess I could use it for doors, for example:
setKey(“door”, “locked”) to determine if a node is a door and then if it can be opened or not. Is this the usual idea?

In the Logic panel the properties can be of different type, like int and string. Am I only allowed to use String?

BTW, Ive also read that you can instance one egg from another.

Yes, that’s the idea. You only have string, but you can of course convert int->string and string->int easily within Python.

You can reference one egg within another, true. It’s not the same thing as instancing in the rendering sense.

David

alright cool.

I guess I need to make a task to do stuff based on the newly loaded model’s tag?

So how do you guys handle the tags in Panda?

You can use getNetTag or getTag to find a tag in a node. You can also use find() with a special syntax to find all nodes with a certain tag or a certain tag value.

Okay, but do you use domethodLater task to check for newly loaded nodes once in a while?
Or you use a wrapper function to load a model and also check it’s tag?

Latter. If you organize your code object oriented, this should be no problem at all.
I personally usually have a class for each Model type (e.g. Vehicle, Scenery, Character) with an own loader method each.