Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: phreak on November 10, 2002, 02:24:31 pm

Title: Corkscrew missile revamp
Post by: phreak on November 10, 2002, 02:24:31 pm
i recently made some properties of corkscrew missiles be defined in tables, before they were hardcoded in the game.  The new "$Corkscrew:" flag is optional after any EMP and Leech info that is defined.  If "$Corkscrew:" is not defined, it reverts to defaults assigned to the Tornado.  It goes as follows. It ignores this if the weapon does not define "corkscrew" in the flags.

Code: [Select]

$Corkscrew:
+Num Fired: 4       ;; Number fired in single-fire mode
+Radius: 1.25                   ;; radius of spiral
+Fire Delay: 30                 ;; fire delay in milliseconds between each individual missile
+Counter rotate: YES              ;; counter rotate alternate missiles
+Twist: 5                ;; rad/sec the missiles twist


The code is ready to be CVSed now
Title: Corkscrew missile revamp
Post by: Sesquipedalian on November 10, 2002, 04:31:05 pm
:yes:
Title: Corkscrew missile revamp
Post by: Galemp on November 10, 2002, 04:36:16 pm
:nod::yes: Excellent!
Title: Corkscrew missile revamp
Post by: Inquisitor on November 10, 2002, 05:23:16 pm
Will this break anything in the current game if we go ahead and committ it? Do we need to edit old files or something?
Title: Re: Corkscrew missile revamp
Post by: Galemp on November 10, 2002, 05:57:11 pm
Quote
Originally posted by PhReAk
If "$Corkscrew:" is not defined, it reverts to defaults assigned to the Tornado.  
Title: Corkscrew missile revamp
Post by: Inquisitor on November 10, 2002, 07:11:30 pm
Oops :)

Thank you :)

In that case phreak, committ away :)
Title: Corkscrew missile revamp
Post by: phreak on November 11, 2002, 02:36:02 pm
done
Title: Radians Instead of Degrees
Post by: Rampage on November 11, 2002, 02:52:53 pm
Just a [random] suggestion:  Perhaps you might want to change dAngle/dt from degrees to radians.  Because of the circular nature of the corkscrew, a circular measurement might be better than a triangular measurement.

Why? It just sounds better. ;)
Title: Corkscrew missile revamp
Post by: phreak on November 11, 2002, 02:57:43 pm
i was just about to change the comment to read radians.
Title: Corkscrew missile revamp
Post by: LAW ENFORCER on November 12, 2002, 04:58:52 am
Can anyone add acuracy code? SO the missiles fly about abit as if they wern't engineered very well? (unblanance in eninge thrust not gravity and wind:rolleyes: )
Title: Corkscrew missile revamp
Post by: Inquisitor on November 12, 2002, 07:28:26 am
If I can get Bob's CVS issues sorted out, I'll go ahead and tag/release 3.3.1 which will include this.
Title: Corkscrew missile revamp
Post by: Rampage on November 12, 2002, 07:57:46 am
Quote
Originally posted by PhReAk
i was just about to change the comment to read radians.


Um... That will also require some changes in the code itself.  [Radians]=(Degrees)(PI)/(180)
Title: Corkscrew missile revamp
Post by: phreak on November 12, 2002, 02:25:30 pm
the comment in the code read wrong, i set "+Twist:" to 25, it went around *much* faster than 25deg/sec
Title: Corkscrew missile revamp
Post by: Scuddie on November 13, 2002, 11:29:52 pm
Wha...  WHAT THE SAM HELL??  THAT'S MY PROJECT!!!... :( :( :(

Eh, nice job m8.  I had a considerably larger re-vamp to the swarm system itself planned, not just the corkscrew.  I aint surprised that someone else got to it first, considering I don't know C++ :D.  Anyway, what I did was make it so the missiles could do both swarming and corkscrewing, sorta like $swarm and Corkscrew flag together.  It was supposed to have stray distance for swarm, and a smoother version of swarm as well.  Hopefully it would do a random curve instead of a random angle.  It also would have had an inner radius and an outer radius for larger swarms of corkscrews.  That, and all the other common things you did.  I got a very small amount of progress done before it wouldn't compile, but oh well.  Maybe some of this stuff can go into your next build of it!

I really wish I knew C++, then I could have the glory :(.
/me plays his violin...
Title: Corkscrew missile revamp
Post by: Solatar on November 14, 2002, 03:00:10 pm
Maybe we could have it so that a swarm could launch, but with no angles. Maybe four missile would launch at the same time, but out of different firing points.
Title: Corkscrew missile revamp
Post by: Scuddie on November 15, 2002, 03:24:42 pm
Well, I found my plan file, here it is what I hoped it would be:
Code: [Select]
$salvo:
+SalvoType: 3 // 0=None (regular missiles); 1=Swarm; 2=Corkscrew; 3=Both
+Projectiles: 8 // How many are fired
+FireDelay: 150 // Delay in Milliseconds
+SWARM:
+MinDelay 100 // Minimum time before random course change
+MaxDelay: 200 // Maximum time before random course change
+MinAngle: 2 // Minimum angle for random direction
+MaxAngle: 15 // Maximum angle for random direction
+Independant: 0 // Allow missiles to stray (boolean)
+Curved: 0 // Use rads instead of deg (boolean)
+CORKSCREW:
+CounterRotate: 1 // Missiles will counter rotate
+Rotation: 10 // Degrees per second the missiles will twist
+Radius: 1.50 // Radius of the corkscrew
+OuterShell: 2.25 // 2/3 of missiles will be in this shell
// (projectiles must be a factor of 3), 0 for none
Mutate it, build upon it, do whatever to it.  Hell, call me an idiot for not knowing C++, just give me a 5% gross profit share :D.  I know it's possible some of these things can't be done, but can you try, phreak?
Title: Corkscrew missile revamp
Post by: phreak on November 15, 2002, 03:39:35 pm
I think it can be done, but FS2 handles swarm and corkscrew missiles differently
Title: Corkscrew missile revamp
Post by: Scuddie on November 15, 2002, 03:47:09 pm
Yes they are handled differently, but they can be combined if each aspect stays on it's own side of the line.  The Tripod missile I once made had a corkscrew flag, and had $swarm: 3 on it, and it worked quite well:nod:.  I think in this case they might be a bit too conflicting in the properties because of the amount of customization, so perhaps it might be best to leave out type 3.  I'm no programmer, so I cant say.
Title: Corkscrew missile revamp
Post by: Scuddie on December 07, 2002, 08:50:15 pm
Bump...

So, is anyone going to work on it, cause I cant.  Phreak, do you volunteer?
Title: Corkscrew missile revamp
Post by: phreak on December 07, 2002, 08:55:49 pm
i've been busy with the OpenGL port recently.
Title: Corkscrew missile revamp
Post by: TrashMan on April 30, 2003, 02:09:57 am
Can that work on promary weapons (balistic and non-balistic)?
Title: Corkscrew missile revamp
Post by: phreak on April 30, 2003, 02:00:30 pm
never tried. good luck hitting anything with spiraling primaries