Driving tank & rotating turret? Created 12 years ago2011-12-31 17:14:20 UTC by 23-down 23-down

Created 12 years ago2011-12-31 17:14:20 UTC by 23-down 23-down

Posted 12 years ago2011-12-31 17:15:56 UTC Post #302303
hey people this time I have a more complicated question I'm not even sure if it's possible at all. But I'm pretty sure I saw something like that being done before..

Following situation.

A have a tank standing at a location. Now when the player comes in the range I want the tank turret to rotate towards me and then back to another more important target. A simulated shot (env_explosion) will get fired and then I want to tank to drive away.

For the rotating turret I've used a func_trackchange what works just fine till now. But the new problem for me now how do I link it with a track_train.

I've tried using a trigger_changetarget linking it to the main chassis of the tank which is already assigned as a track_train but of course it wont work.

Do you know of any other possible ways how to simulate what I'm trying to do?
Posted 12 years ago2011-12-31 17:39:50 UTC Post #302304
You can't link/parent it to anything in vanilla GoldSource.
If the second, more important target is static (i.e. you know what angle the turret will be facing when it rotates to it), you can just make it and the initial tank body invisible once it rotates to its goal. Then, in its place, show a new func_train, which has the turret rotated at the right angle. You can then move it where you like w/o any complex train setups.

I'm not sure if that makes sense, I could whip up a quick example if you want. :)
Daubster DaubsterVault Dweller
Posted 12 years ago2011-12-31 19:43:17 UTC Post #302309
Man I love the spirit engine. It just makes things like this so much more simple. Not that that helps you at all but I just thought I'd throw it out there.
monster_urby monster_urbyGoldsourcerer
Posted 12 years ago2011-12-31 23:41:09 UTC Post #302317
Ye spirit would be better but is unfortunately in this case not possible. However eventually I will get my own custom code but till then I'll have to make use of what I've got.

@Urby: I was thinking about something similiar but somehow it wont work for me.

I used 2 tanks one with the turret stationary and the other one that is supposed to get beamed in there on my mark as a func_tracktrain while the other one will get deleted with trigger_relays mili seconds later. But my tank simply wont get teleported no matter what I do. however when I give it an initial speed it works fine but that of course isn't a solution for the final map as we never know when the player will reach the specific area.

I would appreciate it if you could construct me a smaller example map showing how it gets done right. thx

I've uploaded you my testmap to save you some time.

http://www.gamefront.com/files/21140380/tanktest.rmf

Wish you a happy new year. :)
Posted 12 years ago2012-01-01 04:36:53 UTC Post #302322
Posted 12 years ago2012-01-01 20:34:07 UTC Post #302340
Thank you Barnyinblue.

That was exactly what I was looking for. I was able to finish it based on your example map. :)

Never considered using a func_rotatingdoor & an env_rendering to hide the turret. Great work.
You must be logged in to post a response.