Weapon Image
by genomegames · in Torque 3D Professional · 10/01/2012 (5:43 am) · 4 replies
Hello everybody!
In our game I have one weapon image: HumGunImage
Many weapons inherit property values of this
All of these values are the same; Yes, I know: each object of a datablock is the same
I wanna make different values to different objects
ShapeBaseImageData has not a parent class, and I can not add members to this
Does anybody know what can I make different objects of one image?
In our game I have one weapon image: HumGunImage
Many weapons inherit property values of this
All of these values are the same; Yes, I know: each object of a datablock is the same
I wanna make different values to different objects
ShapeBaseImageData has not a parent class, and I can not add members to this
Does anybody know what can I make different objects of one image?
About the author
#2
I don't wanna create many weapon images
I wanna have single image
10/02/2012 (12:21 am)
Thank you DaveI don't wanna create many weapon images
I wanna have single image
#3
I put 'object' in quotation marks because ShapeBaseImages do not actually exist as separate objects. They only exist when mounted on a ShapeBase. So when you call mountImage(%image, %slot), you are telling a ShapeBase object (like the Player) to display an image that looks like the datablock %image.
10/02/2012 (1:00 am)
What sorts of values do you want to be different for each 'object'?I put 'object' in quotation marks because ShapeBaseImages do not actually exist as separate objects. They only exist when mounted on a ShapeBase. So when you call mountImage(%image, %slot), you are telling a ShapeBase object (like the Player) to display an image that looks like the datablock %image.
#4
I store unique values in player class members
It works well for me
10/02/2012 (1:27 am)
I've found the solutionI store unique values in player class members
It works well for me
Associate David Wyand
Gnometech Inc.
datablock ShapeBaseImageData(MyWeapon2 : HumGunImage) { ... } datablock ShapeBaseImageData(MyWeapon3 : HumGunImage) { ... }I don't think there are any examples of this in the templates, but you can see this in action for the DemoPlayer datablock where it copies everything from DefaultPlayerData and only adds the shootingDelay field. This is in art/datablocks/aiPlayer.cs in the Full template.
I hope that helps.
- Dave