• Hello and welcome to MSFC. We are a small and close knitted community who specialises in modding the game Star Trek Armada 2 and the Fleet Operations modification, however we have an open field for discussing a number of topics including movies, real life events and everything in-between.

    Being such a close community, we do have some restrictions, including all users required to be registered before being able to post as well as all members requiring to have participated in the community for sometime before being able to download our modding files to name the main ones. This is done for both the protection of our members and to encourage new members to get involved with the community. We also require all new registrations to first be authorised by an Administrator and to also have an active and confirmed email account.

    We have a policy of fairness and a non harassment environment, with the staff quick to act on the rare occasion of when this policy is breached. Feel free to register and join our community.

[Help] Rotating Turrets?

Dan1025

Every Mods Biggest Fan :P
Joined
31 Jan 2007
Messages
1,883
Age
33
I'm working on a full race mod that I'd like to create some rotating turrets for (turrets that rotate to face their target). Before I make the models I'd like to know if it's actually possible to code them so they rotate properly when they fire, since I'd be designing them around that function.

If it it possible, could someone tell me what coding I'd need to get that to function ingame? Would I have to code the turrets as ships or something?

Any help with how I'd accomplish this would be appreciated, IIRC there was a rotating turret in B5A2 wasn't there?
 

Starfox1701

Master of the Arwing
Warrant Officer
Joined
29 Jan 2008
Messages
2,561
Age
48
I dont think that you can do an animation for a gun turret that will do that. I have tinkered with the idea of giving the station engines and in the physics file setting the forward speed to somethng super low and the turing values up super high but I've never tried ingame implamentation so I don't know if it would work or not.
 

Dominus_Noctis

Lasciate ogni speranza...
Joined
18 Aug 2010
Messages
409
Sounds like a really nice idea :thumbsup: . Hm, I imagine that if you coded them as ships it would work ok (though the turret might want to slowly move across the map...), but I can't recall anybody making a working 'real-moving' and not just animated turret. :sweat: . I really hope I'm wrong.
 

Adm_Z

Gettin' down and GUI!
Joined
23 Nov 2009
Messages
2,745
Yeah, actually, make the part of the turret you want to fire from the front of the object and give it physics without forward movement. It will turn to fire on its enemy, but since it has no no forward movement, it just doesn't move.:cool:
 

Borg_Queen

Bringer of order to chaos
Joined
25 Apr 2006
Messages
4,831
Age
44
(though the turret might want to slowly move across the map...),

"Hey, turret! Who told you to move to the enemy base? Even though you are doing nice against the enemy I need you right here to defend my base." Sorry, couldn't resist. :lol2:

Anyway, it sounds like a good and interesting idea to have animated turrets. If you find out how I would download them then they are available. :)
 

Dominus_Noctis

Lasciate ogni speranza...
Joined
18 Aug 2010
Messages
409
Indeed! Yeah, if Adm. Zaxxon's method works (wasn't aware that you could make it have zero forward movement and still rotate), that would be really sweet :excited:
 

Adm_Z

Gettin' down and GUI!
Joined
23 Nov 2009
Messages
2,745
A working example is the superbl(Ranger Cannon) from the antithesis mod by Interstellar Machine. i think its available at both STG and FF if you are interested.
 

Undying_Nephalim

Orange and Blue is too epic for you.
Joined
29 Aug 2010
Messages
258
Age
33
It is possible, you just need to give them a classlabel of a ship I think and a physics file with everything set to zero. In Sigma the Jessmisic Turrets rotate like that.
 

CABAL

<< ■ II ▶ >>
Staff member
Administrator
Star Navigator
Rogue AI technocrat
Joined
15 Aug 2009
Messages
3,511
Age
33
Here's the way that I can think of to do it.

Make a mining station with the cost and appearance of the turret. Make sure that the mining station has at least 150% of the turret's intended shielding. Add "hidden = 1" and "avoidMe = 0" to the new mining station odf and set the docking speed factor to 0. Make sure that the miner dock hardpoint is set to the model root.

Program the real turret as a ship that can turn but not move and set it as the mining station's freighter. It needs its own physics file with "dockingSpeedFactor = 0.0". Give it a tiny shockwave, with a radius of about 1, that will deal enough damage to destroy the mining station at full health.

Add the new mining station to a construction ship and you should have a working system that the AI will also use. The only problem is that it's possible that freighters may try to dock with the turret. I don't think there's a way around that.
 

Dan1025

Every Mods Biggest Fan :P
Joined
31 Jan 2007
Messages
1,883
Age
33
Thanks for the replies guys, nice to know it can be done.

I'll get working on those models then, there'll be an annoucement about what race I'm working on sometime in the (hopefully near) future :)
 

Ryderstorm

Fight to live, Live to die
Joined
14 Sep 2009
Messages
221
Yeah what Zaxxon said. It works. I have had COWPs in my custom installs that tracked targets as well as some custom EA turrents as well. I have played with trying to put turrents on stations as pods but I couldnt get things to work out. Just remember the AI name in the odf needs to be craft usually. Unfortunately it is a lil buggy or at least it was for me. Dont forget to put restricted firearcs on your equiped weapons that way the turrent works good.

Code:
combatspeed = 0.01
impulsespeed = 0.01
physics = "smooth"
warpspeed = -1
combatphysicsfile = "basic_smooth_combat.odf"
tooclosetoturn = 100;
pathleaddistance = 400;
forwardaccel = 0.2;
backwardaccel = 4;
turnomega = 400;
turnalpha = 400;
pitchomega = 400;
pitchalpha = 400;
rollcoupling = 0;
turnomegafractionatrest = 2;
turnalphafractionatrest = 2;
pitchomegafractionatrest = 2;
pitchalphafractionatrest = 2;
pitchdefault = 0;
pitchdefaultspeed = 0.5;
turncontrolsquared = 0;
turncontrolangle = 20;
forwardcontroldistance = 70;

Thats typicly what I use for physics.
 

Dan1025

Every Mods Biggest Fan :P
Joined
31 Jan 2007
Messages
1,883
Age
33
Thanks, that should definitely be useful when I get to the coding stage :ty:
 

Majestic

Administrator
Staff member
Administrator
Seraphim Build Team
Joined
17 Apr 2006
Messages
18,367
Age
39
I have a working version in COE. If you want them just ask.

Also out of curiosity what full race endeavour are you doing? :)
 

Dan1025

Every Mods Biggest Fan :P
Joined
31 Jan 2007
Messages
1,883
Age
33
I have a working version in COE. If you want them just ask.

That would be a brilliant help, thanks mate. :ty:

Could you email me the files at your earliest convenience please?

Also out of curiosity what full race endeavour are you doing? :)

I'll be posting a thread to accounce the race & show progress soon, stay tuned :)
 

Majestic

Administrator
Staff member
Administrator
Seraphim Build Team
Joined
17 Apr 2006
Messages
18,367
Age
39
I don't know your email off the top of my head, you can however email me at (myusername) at msfc.com.au.

:)
 

Majestic

Administrator
Staff member
Administrator
Seraphim Build Team
Joined
17 Apr 2006
Messages
18,367
Age
39
It's on it's way. :)
 
Top