Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Darkhill on April 05, 2005, 07:40:50 pm

Title: Rotating subobjects
Post by: Darkhill on April 05, 2005, 07:40:50 pm
Is there anyway to limit the radius they spin?  Theres the $fov field but it doesn't seem to do anything.
Title: Rotating subobjects
Post by: Trivial Psychic on April 05, 2005, 08:07:03 pm
Probably Bob's triggered animations could probably do this.  Are you thinking of a Radar dish which only scans a certain portion of a full circle like doppler weather radar?
Title: Rotating subobjects
Post by: Darkhill on April 05, 2005, 08:08:57 pm
What I thought.  A bit of an ugly code hack and radar subobjects use $fov now.
Title: Rotating subobjects
Post by: StratComm on April 05, 2005, 08:51:58 pm
do they require it?
Title: Rotating subobjects
Post by: Grug on April 05, 2005, 09:05:06 pm
Maybe if you wanted a huge hammer on the front of a ship.
Or a giant Grandfather clock floating in space...
Title: Rotating subobjects
Post by: Darkhill on April 05, 2005, 09:08:47 pm
Quote
Originally posted by StratComm
do they require it?


No, if there is no value then it defaults to 180.  All it does is take the fov value and cut it in half.  Thats how much it rotates to each side.  This has given me the idea of s-foils on a X-wing working properly.
Title: Rotating subobjects
Post by: Darkhill on April 05, 2005, 09:09:48 pm
Quote
Originally posted by Grug
Maybe if you wanted a huge hammer on the front of a ship.
Or a giant Grandfather clock floating in space...


Or radar dishes you don't want spinning 360 degress for whatever reason.
Title: Rotating subobjects
Post by: StratComm on April 05, 2005, 09:53:19 pm
Quote
Originally posted by darkchrono4


No, if there is no value then it defaults to 180.  All it does is take the fov value and cut it in half.  Thats how much it rotates to each side.  This has given me the idea of s-foils on a X-wing working properly.


But what if you actually want it to go all the way around?  That sounds like it's going to spin until it's backwards, then turn around and spin the other way.
Title: Rotating subobjects
Post by: Darkhill on April 05, 2005, 11:22:32 pm
I think I'll see about adding a flag to the properties of the subobjects.  If there is the flag then it only rotates a certain amount, no flag then its like the original.  That way any of the subobjects could be set to rotate.
Title: Rotating subobjects
Post by: Taristin on April 05, 2005, 11:24:52 pm
Quote
Originally posted by StratComm


But what if you actually want it to go all the way around?  That sounds like it's going to spin until it's backwards, then turn around and spin the other way.


It shouldn't. That'd break backwards compatability with the Faustus, and Anuket, no?
Title: Rotating subobjects
Post by: Darkhill on April 05, 2005, 11:26:09 pm
Actually what it will do is make a full rotation in one direction then reverse and do it the other way.
Title: Rotating subobjects
Post by: Taristin on April 05, 2005, 11:44:06 pm
Right, which would break the Anuket and Faustus, if they don't have $fov in their details.
Title: Rotating subobjects
Post by: Darkhill on April 05, 2005, 11:42:06 pm
The way I'm setting it up is if an additional flag for limited rotation isn't there it will rotate normally.
Title: Rotating subobjects
Post by: Taristin on April 05, 2005, 11:52:13 pm
Ok, good then :p

It's late. I need to sleep and stop surfing :p
Title: Rotating subobjects
Post by: StratComm on April 06, 2005, 02:25:51 am
I actually think they do (have fov in their detail), which is what concerns me.  I know the radars on the orion have a fov by default.
Title: Rotating subobjects
Post by: Darkhill on April 06, 2005, 10:12:04 am
You sure?  From what I see in the code the only thing that reads $fov is a turret object.
Title: Rotating subobjects
Post by: StratComm on April 06, 2005, 10:23:33 am
I am sure.  I know it doesn't get used, but that doesn't mean it isn't there.
Title: Rotating subobjects
Post by: karajorma on April 06, 2005, 01:23:12 pm
Quote
Originally posted by darkchrono4
What I thought.  A bit of an ugly code hack and radar subobjects use $fov now.


I'd check carefully that you didn't just f**k up all your turrets if I were you. Fov controls their firing angles.
Title: Rotating subobjects
Post by: Darkhill on April 07, 2005, 11:26:42 am
Quote
Originally posted by StratComm
I actually think they do (have fov in their detail), which is what concerns me.  I know the radars on the orion have a fov by default.


I checked out the Orion on a completely clean install of FS2 (no FS2_Open or anything else) and all three radar dishes turned 360 degrees.  I'm not sure what it would be doing with $fov, the only place in the code that ever reads a variable for that is if its a turret.
Title: Rotating subobjects
Post by: Darkhill on April 07, 2005, 11:28:12 am
Quote
Originally posted by karajorma


I'd check carefully that you didn't just f**k up all your turrets if I were you. Fov controls their firing angles.


Still work.
Title: Rotating subobjects
Post by: StratComm on April 07, 2005, 02:08:27 pm
Quote
Originally posted by darkchrono4


I checked out the Orion on a completely clean install of FS2 (no FS2_Open or anything else) and all three radar dishes turned 360 degrees.  I'm not sure what it would be doing with $fov, the only place in the code that ever reads a variable for that is if its a turret.


No, no, you're missing my point.  The Orion model (and probably all the others with rotating bits) actually have $fov=360 in the subobject properties.  I know the game doesn't use it, but it is there nonetheless.  It's probably got more to do with how :v: coded their converter than it being useful, but if you impose a check that looks for the fov tag to determine new rotational behavior, you may end up affecting old things that should be left alone.
Title: Rotating subobjects
Post by: Darkhill on April 07, 2005, 02:11:27 pm
I understand you know.  Could always add another entry to the properties part.
Title: Rotating subobjects
Post by: WMCoolmon on April 07, 2005, 03:09:15 pm
Just add a new TBL field, $RotationLimit or something.
Title: Rotating subobjects
Post by: StratComm on April 07, 2005, 03:19:19 pm
I'd agree, do it in tables.  That's where the rest of the animation code is handled.
Title: Rotating subobjects
Post by: Darkhill on April 07, 2005, 03:33:38 pm
I'll have to look into it.
Title: Rotating subobjects
Post by: WMCoolmon on April 07, 2005, 04:19:19 pm
Code: [Select]
void parse_ship(bool is_chunk)
{
...
     if(optional_string("$RotationLimit"))
     {
          stuff_float(&submodelp->rotation_limit);
     }
...
}


something like that, the submodel stuff is at the bottom of parse_ship