switching between characters (python question)

I’m trying to make a platformer where the main character can change form and be replaced with another one.

i created two actors (a cube and a ball for that matter) and connected them to the same actuator and tried to write a simple script to switch their visibility on\off. but i can’t figure out how to get each object into the script: will getOwner return an array ? or is there a getOwners() function?

maybe I’m taking the wrong approach here - would it be better to make two separate actors with complete copies of all sensors\actuators ? (i don’t want to have to duplicate basic movement controls). if so, how do i reference the second other actor from the first actor’s script ?

any help will be appreciated.

Hmm… you probably don’t need python at all.
Just set up a system to flip a boolean property from true to false (you can do this by making it set the property’s value to !propertyname). Then just set up your actuators so that they adjust the visibility depending on whether the bool is true or false.
Do you get it?
If not, feel free to ask me for help.

switching visibility isn’t enough - since both actors use the same keys for basic navigation I’ll end up having two characters moving at the same time (although one is hidden). i want to be able to disable their physics evaluation in addition to visibility, and for that i need python access to both actors.

I don’t know if this is exactly what you want, but I think you could use:

(Whatever key you choose) ___ AND ___ Edit Object (Replace Object) [Name of Object].

on both meshes. I think that would work. (?)

nope, sorry. the armature needs to be different too so that is not a solution.

oh, ok. Well, then, this is beyond me. Sorry.

Here:

http://socialstorage.googlepages.com/kflitch_switch.blend

Hope that helps.

Nevermind me. Listen to Social.

Social, you are rad.

Lol, thanks.

a million thanks social ! it seems to be exactly what i need :slight_smile:
I’ll study it and try to see if i can figure out exactly how it works.