Author Topic: Hey, he can't do that!  (Read 16220 times)

0 Members and 1 Guest are viewing this topic.

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Hey, he can't do that!
if you just made a fire turret weapon controll that would be cool, you could probibly script the blindfire gauge.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline aldo_14

  • Gunnery Control
  • 213
Re: Hey, he can't do that!


Toggled on via a ships.tbl "gun convergence" flag. To change the angle of weapons, use the "Normal" field for gun points. Unfortunately, POFCS doesn't let you set gun/missile point normals, so you'll have to use ModelView.

Oh, and if somebody ever told you, "When fiery ordinance flies out a Viper's ass!!", now you can reply...



"Oh, it does. It does indeed..."

http://fs2source.warpcore.org/exes/latest/C04042006.zip

You bastard, you got a Viper.  I've wanted one of those for ages.

 

Offline Trivial Psychic

  • 212
  • Snoop Junkie
Re: Hey, he can't do that!
WMC's on the BSG:BTRL team.  Of course he's gonna have access to a Viper.  The real question is, how does he fit it in his garrage?  :lol:
The Trivial Psychic Strikes Again!

 

Offline Mars

  • I have no originality
  • 211
  • Attempting unreasonable levels of reasonable
Re: Hey, he can't do that!
WMC's neighbor comes over, asking for a jumpstart. He opens his garage...

 

Offline Grug

  • 211
  • From the ashes...
Re: Hey, he can't do that!
Woah. Nice work dude. Very handy. :D :yes:

  
Re: Hey, he can't do that!
I so like it! :)
Great job!

 

Offline Harbinger of DOOM

  • 28
  • Three fries short of a Happy Meal.
Re: Hey, he can't do that!


Toggled on via a ships.tbl "gun convergence" flag. To change the angle of weapons, use the "Normal" field for gun points. Unfortunately, POFCS doesn't let you set gun/missile point normals, so you'll have to use ModelView.

Oh, and if somebody ever told you, "When fiery ordinance flies out a Viper's ass!!", now you can reply...



"Oh, it does. It does indeed..."

http://fs2source.warpcore.org/exes/latest/C04042006.zip
Envious, just doesn't quite describe what I'm feeling........... grrrrrrrrrrr :eek: :eek2: :shaking:
aldo_14 ~ "The ego has landed."
an0n ~ "Wheee, I can spam and no-one will notice!"

 

Offline Admiral Nelson

  • Resurrecter of Campaigns
  • 211
  • The GTA expects that every man will do his duty.
Could someone take a moment to lay out the required mathematics for me?

I understand that I need: 1) the distance at which I want the projectiles to converge. 2) the offset of the gun mount from the center of the craft.
These give the base and altitude of a right triangle.  I then need to transform the resulting angle into normals to enter in modelview.  I presume that the hypotenuse of this triangle is the vector of the projectile.  What I do not understand is how to derive the unit vector described by the hypotenuse and express it in the correct terms that modelview requires.
If a man consults whether he is to fight, when he has the power in his own hands, it is certain that his opinion is against fighting.

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
hypotenuse_angle = atan2((target_distance-gun_offset.z), -gun_offset.x)

unit_vector.x = cos(hypotenuse_angle)
unit_vector.z = sin(hypotenuse_angle)

EDIT: Corrected signs.

Note that atan2 is a c function which takes the y value (target_distance-gun_offset.z) over the x value (-gun_offset.z) like a normal arctan function, but returns the angle in the proper quadrant. IF you do this with a normal calculator's arctan function, you will need to take the absolute value of y/x before giving it to the function and correct them manually. (eg if gun_offset.z is positive, your answer will be 180-angle, otherwise it will just be angle). Otherwise you'll get values for a target behind and to the right of the ship when you calculate values forward and to the left of the ship.
« Last Edit: December 08, 2007, 02:50:47 pm by WMCoolmon »
-C

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
i used to use a simple formula, simply pick a point in model space where the guns will converge, vector subtract the location of the fire point from it to get your directional vector, then normalize it. to normalize use 1 / sqrt(x*x + y*y +z*z). take the resulting number and vector multiply your directional vector by it.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Oh, and if somebody ever told you, "When fiery ordinance flies out a Viper's ass!!", now you can reply...

Very nice.  Let me know when you've perfected the self-destruct kamikaze missile out the back.  I've got a few people I'd like to give that to in loadout.
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
speaking of which i was thinking of making ships with a rather unorthadox weapon layout. which would include things like sidefire guns and torps. which would allow you to circle and shoot. and whatever target you had a hankering to shoot at would be dead. thing is you could attack a cap without being a stationaty blip in a turrets fov.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Oh, and if somebody ever told you, "When fiery ordinance flies out a Viper's ass!!", now you can reply...

Very nice.  Let me know when you've perfected the self-destruct kamikaze missile out the back.  I've got a few people I'd like to give that to in loadout.

You should be able to do that with a little weapons.tbl or -wep.tbm tweaking. See Detonation Range on the Freespace Wiki.

Alternatively, you can probably launch remote-detonation missiles out the back, but I don't know if they would show up on the HUD.
-C

 

Offline Admiral Nelson

  • Resurrecter of Campaigns
  • 211
  • The GTA expects that every man will do his duty.
Here's a handy convergence calculator I made with Goober's help.  Enter the desired convergence distance and the gun offset distance, and the spreadsheet will display the values to enter into the normal.  Thanks for the help.

[attachment deleted by admin]
If a man consults whether he is to fight, when he has the power in his own hands, it is certain that his opinion is against fighting.

 

Offline MP-Ryan

  • Makes General Discussion Make Sense.
  • Global Moderator
  • 210
  • Keyboard > Pen > Sword
speaking of which i was thinking of making ships with a rather unorthadox weapon layout. which would include things like sidefire guns and torps. which would allow you to circle and shoot. and whatever target you had a hankering to shoot at would be dead. thing is you could attack a cap without being a stationaty blip in a turrets fov.

That's where thrusters in main FS2 would be extraordinarily useful.
"In the beginning, the Universe was created.  This made a lot of people very angry and has widely been regarded as a bad move."  [Douglas Adams]

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Here's a handy convergence calculator I made with Goober's help.  Enter the desired convergence distance and the gun offset distance, and the spreadsheet will display the values to enter into the normal.  Thanks for the help.

:yes:

EDIT: Have you tested the calculator? It looks like your x and z values are reversed.
« Last Edit: December 12, 2007, 02:02:57 pm by WMCoolmon »
-C

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Is it even needed to use normalized vectors for the firing point normals? (AFAIK it is but i aint 100% sure)

I mean if the use of 'unnormalized' vectors is allowed then it is really, really simple to set the normals for what ever convergence you like..
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Admiral Nelson

  • Resurrecter of Campaigns
  • 211
  • The GTA expects that every man will do his duty.
Simple if you understand vectors, which most people (myself included, do not).  I wanted the most basic way possible to get at what to enter in Modelview.  With this spread you only need to know the gun displacement from center and how far off you want the projectiles to meet.

I forgot to save my changes after reversing the labels in the spread.  Attached it again.

[attachment deleted by admin]
If a man consults whether he is to fight, when he has the power in his own hands, it is certain that his opinion is against fighting.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Umh.. the exact same is needed for the unnormalized vector too... x & y coordinates for the normal equal to the opposite of the firing points respective coordinates and z equals to the convergence distance (minus the weapons z coordinate - if the design is really weird)...

Though that proggie will most likely have its users as vectors are at times seen as being too difficult to understand.
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Admiral Nelson

  • Resurrecter of Campaigns
  • 211
  • The GTA expects that every man will do his duty.
The issue being that many folks, myself included, will have no idea what that first sentence of yours means.  :)
I can only interpret that to mean that I can put in the distance in meters for offset and distance in both the x and z boxes in pcs2 without transforming them in any way.  The simpler it is for people to understand how to use what the SCP has created, the more likely it is that these features will be used without endless "HELP" threads being created.
If a man consults whether he is to fight, when he has the power in his own hands, it is certain that his opinion is against fighting.