Game Development Community

Possible idea for gun optics...

by Chris DeBoy · in Torque 3D Beginner · 06/14/2014 (2:10 pm) · 8 replies

So in stock T3D, it is not possible to attach optics as a separate model to a node on the gun model(given that you create it yourself) or other weapons(I think(last I checked(don't quote me on that))), but what if you created the gun model with different optics already attached to different nodes, each with a name for what type of optic(something like opt_REDDOT, opt_FOURX, opt_ACOG, opt_SCOPE etc.) and simply delete the nodes containing the optics you aren't using. Would something like this be possible in torquescript, and if so, how? If not, would it be possible to make presets like that in the shape editor?

About the author

One dude... in his bedroom... making video games... But in AMERICA!

Recent Threads


#1
06/14/2014 (3:33 pm)
I could be wrong here but I'm pretty sure you can use the mountObject() TS command on weapon objects just as you can with player objects.
#2
06/14/2014 (3:46 pm)
I'll have to try that, but I'll need to figure out where to put the command.
#3
06/14/2014 (5:37 pm)
Weapons are usually mounted as ShapeBaseImages, which are not real objects, so you can't mount anything to them (they don't have an object ID). I wrote a resource to let you mount images on other images.

You could also use mesh hiding - I'm not familiar with the API but here's a start.
#4
06/14/2014 (8:23 pm)
so mesh hiding can(possibly) accomplish what I want?
#5
06/14/2014 (8:29 pm)
Ooh, actually now I think about it, I'm not sure if you can hide meshes on an image. Quite possibly not. The Image system really messes with doing anything beyond really basic weapons. Back in TGE I actually ripped it out entirely and used Item for weapons. I transplanted the state machine code into a subclass of Item and that was that.
#6
06/14/2014 (8:59 pm)
Daaaaaaaaaaang, but would it be possible to open up the weapon shape in the shape editor, delete one of the optics and set it as a preset shape or something?
#7
06/14/2014 (11:17 pm)
Possibly. I'm not super familiar with the shape editor. And by 'super familiar', I mean 'at all familiar' :P.
#8
06/18/2014 (7:37 am)
I tried messing around with the lurker model - I can't seem to delete nodes, but I can attach stuff to it, but it seems there's only a save option, not a save-as one. I'll have to keep playing around with it.