Game Development Community

Overlaying the player actor with equips

by Michael Celey · in Torque X Platformer Kit · 03/05/2010 (1:35 pm) · 3 replies

I'm relatively new to the PSK and Torque X in general so please bear with me while I butcher this explanation.

I have my player actor and all of his animations working properly in the builder. At this point he's naked. What I'm trying to do is use different materials and have them render over the character to represent different armors. Right now I have the different armors as their own materials and made animations for them that line up with the player actor animations.

I tried mounting the armor to the player as its own actor but I couldn't get the armor to animate with the player when the player changed states.

Any tips?

About the author

Full Sail University graduate and indie game developer.


#1
03/09/2010 (9:41 pm)
I'm still new to programming and Torque but I have an idea that might suit your needs. If you don't have too many different pieces of armor it would probably work better to create multiples of the character with all possible armor combos though doing this would probably be exhausting as you would have to implent code that will figure out what pieces of armor the character is wearing to pick the correct combo. Hopefully someone can come up with a better solution than mine.
#2
03/09/2010 (10:12 pm)
Ten different armors, helmets, weapons, boots, and gloves. The number of different configurations would just be too much art to make. I've been working off an idea that was given to me by a poster in another thread where it was suggested to remove gravity and use the same controller as the player to make everything line up properly.

As of right now I have them animating together and lining up properly on idle. The only problem is that when the player is moving, the actor for the armor doesn't line up properly all the time. In the _preUpdate for the player I'm getting the armor from object manager and setting it's position to be the same as the player but even then it's not lining up for some reason. It could quite well be in the way that I'm doing it though.

T2DSceneObject Armor = TorqueObjectDatabase.Instance.FindObject<T2DSceneObject>("BurlapArmor");
if(Armor != null)
{
     ActorComponent armorPiece = Armor.Components.FindComponent<ActorComponent>();
     if(armorPiece != null)
     {
          armorPiece.Actor.SetPosition(this.Actor.Position, true);
          armorPiece.SceneObject.SetPosition(this.SceneObject.Position, false);
     }
}

Any help would be appreciated here.
#3
03/10/2010 (3:24 pm)
I was able to solve this problem using the above code. I was forgetting to set the masses and jump forces to be the same for each item... silly me.