From character creator to actual game?

So I have this character creator where you can alter object color, mesh, etc. (It’s not finished, but that’s not important)
Now I want to make the actual game. For this, I want to copy the altered object to a new scene, because otherwise the character creator scene would probably be a mess, and I like to keep things clean. But:

  • If I create a linked copy, no changes show up when I switch to the game scene.
  • If I don’t link the object and copy the logic so that the separate character in-game receives the same changes as the one in the character creator, nothing changes either. (Would this be solved if I set the game scene to run in the background? Would this be bad for the performance, or ignored because you can’t see anything anyway?)

I have also thought about linking the objects to a second .blend file, which would be the actual game. But in order to do that, external data would have to be created, right?
Could I possibly solve this with python? Say, get a script to write all the information in a file, save it and then load it on the actual game. (This would also have the advantage of being able to save your characters, I think)
I’m a noob with Python, so I don’t know how to write the data to a file. Probably wouldn’t be that complicated though. (I’d prefer to just export the “dynamic” attributes like object color and scaling instead of the whole model to keep it clean)

I would appreciate any help on how to approach this. Opinions on what I could perhaps put in a separate file would be pretty sweet too. :slight_smile:

(Also, the VideoTexture module doesn’t work for me, not even with a premade .blend I downloaded. And the standalone game export always gives me an error. I have also tried the terminal script method, but it’s no good either. I’m using Mac OSX Snow Leopard and Blender 2.68. Does anyone else have these problems?)

I believe the export to standalone doesn’t work because it exports to .exe, which isn’t supported on Macs. I’m not sure but I think games have to use blender player to run on Mac, but I haven’t looked into that since I’m using a PC. I don’t know about the Video Texture module, I’ve never used it.
As to the character transfer, it’d probably be easiest to learn a bit of Python and save yourself some trouble of working with logic bricks. I’m not a Python expert, but I believe you could have a script that assigns each of the custom objects to a number and then when you load the game it loads the pattern of numbers the player selected and then gives him the desired clothes/hats/whatever. So you’d start by dividing it up into categories like head chest legs or something and then in the head category there are hats one through five. It saves the number of what hat the player chooses and assigns it that hat in game. Maybe someone more experienced could block out some real code for you, but I hope I set you on the right path!

This is how I would do it, especially in a game that requires transferring data between two or more scenes a lot:

(My method relies on the player’s option selections to be assigned to properties.)

Have a main scene with only empties that store properties and add the char creator scene from the main scene. When the player is finished creating their character, use a script to store the char creator scene’s properties into the main scene in the properties of an empty, then remove the char creator scene and add the game scene. Finally, use another script to assign the properties from the main scene to the character in your game scene, and set the meshes appropriately.

A helpful tip: object meshes are global throughout a .blend file, so you can assign a pre-existing mesh from one scene to an object in another.

Using agoose’s globalDict save/load system, you can use this same method to save and load your game between scenes. Which, for a game that uses a character creator, sounds like something you’d want to invest some time in. :stuck_out_tongue:

thanks, that was exactly what I was looking for! :smiley: