Per team player models
by Ian Morrison · in Torque Game Engine · 01/11/2006 (4:49 pm) · 3 replies
My game is a team based FPS. One of the things I want to do in order to make the teams look visually distinct (to avoid confusing friend from foe) is have each team use separate models.
I'm currently just setting up a separate datablock (ActorData is the default orc, AlienData is a green alien that came with the 1.3 tutorial) for each model... but this means a lot of duplicated code, and a pain in the butt to edit anything. Is there a way around this... a way to set up the aliendata datablock to inherit all properties of actordata EXCEPT for the model?
It was probably just ignorance as to how inheritence in torquescript works on my part, but I couldn't get the properties to carry over before.
Thanks!
I'm currently just setting up a separate datablock (ActorData is the default orc, AlienData is a green alien that came with the 1.3 tutorial) for each model... but this means a lot of duplicated code, and a pain in the butt to edit anything. Is there a way around this... a way to set up the aliendata datablock to inherit all properties of actordata EXCEPT for the model?
It was probably just ignorance as to how inheritence in torquescript works on my part, but I couldn't get the properties to carry over before.
Thanks!
#2
Note that this is just a duplicated datablock with the shape name overwritten/
01/11/2006 (8:29 pm)
Yes! In fact, it's extremely trivial:datablock PlayerData(ActorData)
{
shapeName = ......
...........
}
datablock PlayerData(AlienData : ActorData)
{
// different shape file
shapeName = "path/filename";
};Note that this is just a duplicated datablock with the shape name overwritten/
#3
datablock PlayerData(AlienData) : ActorData
Since that SOMEHOW seemed more consistent with the C++ I'm used to. Oops.
01/12/2006 (2:28 pm)
Ah... what I was TRYING to do was:datablock PlayerData(AlienData) : ActorData
Since that SOMEHOW seemed more consistent with the C++ I'm used to. Oops.
Torque Owner Jon Jorajuria