Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: redmenace on February 23, 2003, 07:05:39 pm
-
what part of the code would handle the default(the position that the turrets are in the not engaging an enemy) position of turrets?
-
None. The starting positions are set on the model. When a turret stops attacking someone for whatever reason, it stops moving till something else comes into it's field of view that it can fire at.
-
Well would it be possible to setup the turrets to be a certain way just before it jumps out. This is a question relating more towards the TBP than just Freespace in general.
-
It'd be cool if we could set the default positions in the model and not be restricted to straight up and down of the turret barrels.
And it would be cool perhaps to either have a sexp or have a auto function so that all turrets reset their positions if no enemies are within a radius of 8 kilometers for say 60 seconds.
EDIT: The radius thing might cause some trouble....perhaps another method?
-
Perhaps if the turret has nothing to track when its weapon is ready to fire again, it moves back to its default position. Don't know how this would be implimented, but presumably you could use the same code as for normal tracking but track to a default normal, either global or pof-specified.
-
Yeah, I just think it looks silly when the Nova's big giant turrets are pointing straight up all the time when going into battle...so if we can make that look better it'd be great.
-
So does anyone know how we could implement this into the source code. Also, Icefire why do the turrets need to be pointing straight up on TBP models?
-
Originally posted by redmenace
Icefire why do the turrets need to be pointing straight up on TBP models?
It is not just TBP models. All FS2 ships have the same problem.
At the moment I can't remember why though.
Look at the Hecate, it's turrets are not as big as Nova's, but they are also pointing straight up at first.
-
Originally posted by Mr. Fury
It is not just TBP models. All FS2 ships have the same problem.
At the moment I can't remember why though.
if they're not, they rotate weird when tracking a ship: aiming anywhere save at the target.
-
Originally posted by venom2506
if they're not, they rotate weird when tracking a ship: aiming anywhere save at the target.
Aeolus is the best example, really bad.
Someone should re-make the Aeolus. Same overal shape, but fix those turrets, and the textures. They are quite poorly done.
-
Originally posted by Mr. Fury
It is not just TBP models. All FS2 ships have the same problem.
At the moment I can't remember why though.
Look at the Hecate, it's turrets are not as big as Nova's, but they are also pointing straight up at first.
The program assumes turrets will either be pointing straight up or straight down, so it can tell how to rotate the barrel to face an enemy ship. If the barrel was pointing forward, it would point the top side of the barrel at the ships it's firing at. Changing this behavior could be problematic, but making a SEXP to point a turret in a direction relative to it's center might be possible. (Though someone would have to figure out how the turret figures out where to point now. Was too convulted for me to get last time I looked at it.) Pointing a turret at an enemy ship isn't quite as simple as it sounds on the surface. :)
-
I hate to necromance this thread but, I am planning on taking up the challenge of implementing the way a turret points based upon a value from the ship.tbl file or possibly from the pof. Does anyone have an understanding of how the turrets currently target objects, and work in general, which .cpp and .h files in general handle this. also how can I get a current version the source code?
-
Originally posted by redmenace
how can I get a current version the source code?
Use WinCVS. Should be a thread or two about how to setup and use it here.
As for the rest, IIRC I couldn't make heads or tails of the turret targeting code (what I could find) so can't help you there. I'm sure, given the way the game in general is made, that parts of it will be split between multiple files. I would think the code would be in the ship and AI related files. Can't say what ones or what functions to look for. It seemed pretty complex from what I remember.