Putting Mount Points Back In
by Chip Lambert · in RTS Starter Kit · 04/15/2008 (7:53 pm) · 4 replies
Hello guys, another question, as I said I'm back and now I'm just full of questions. :)
I want to add mount points back into the models. I know they were removed for effieciency purposes, and I completely agree with that. However the project I'm working on now, at most there would ever be about 20 units or so on a screen at one time, so I don't think there would to much of a lag issue (I could be wrong, I admit).
I'm not sure however where all the code for mount points are. I know some is in:
shapeBase.h
shapeBase.cc
shapeImage.cc
Is there any other files I'll need to merge?
Thanks guys.
I want to add mount points back into the models. I know they were removed for effieciency purposes, and I completely agree with that. However the project I'm working on now, at most there would ever be about 20 units or so on a screen at one time, so I don't think there would to much of a lag issue (I could be wrong, I admit).
I'm not sure however where all the code for mount points are. I know some is in:
shapeBase.h
shapeBase.cc
shapeImage.cc
Is there any other files I'll need to merge?
Thanks guys.
#2
04/15/2008 (8:30 pm)
Thanks Dave. I couldn't remember if it was in the player class or tucked away somewhere else.
#3
I'm going from memory, but I *believe* the only mount point code that was removed in the RTS-SK, was actually networking code. So you can still mount/unmount stuff in the RTS-SK, if you can do it solely only the client side.
You could override onAdd() (in either TorqueScript or C++, I think), check whether the object is a ghost object, and then do your mounting there. Of course that assumes you've got the info you need on the client side - what to mount, ghost object ids, etc.
Alternatively, if you want to put the networking code back in, it's in RTSUnit.cc's packUpdate() / unpackUpdate(). The RTS-SK replicates that code from ShapeBase, and skips over ShapeBase's implementation.
04/15/2008 (9:54 pm)
Hi Chip,I'm going from memory, but I *believe* the only mount point code that was removed in the RTS-SK, was actually networking code. So you can still mount/unmount stuff in the RTS-SK, if you can do it solely only the client side.
You could override onAdd() (in either TorqueScript or C++, I think), check whether the object is a ghost object, and then do your mounting there. Of course that assumes you've got the info you need on the client side - what to mount, ghost object ids, etc.
Alternatively, if you want to put the networking code back in, it's in RTSUnit.cc's packUpdate() / unpackUpdate(). The RTS-SK replicates that code from ShapeBase, and skips over ShapeBase's implementation.
#4
04/16/2008 (6:22 am)
Thank you Geom. Thinking back, I believe I remember someone from GarageGames (may have been Josh Williams) saying that is what was removed. I'll try it out and see what happens. Thanks to both you and Dave.
Torque 3D Owner Dave Young
Dave Young Games
Player::renderMountedImage