You need those extra arguments for proper positioning.
Yeah, if you use SEXPs properly they do what you want. Totally did not see those extra arguments are available.
Well, launching from turret coordinates is fairly easy, then. Now I have the next problem, though. I want the missile to fly in the right direction.
What I want to achieve is that the missiles launch vertically from their turret. So if the turret is on the top of the ship I want it to head "upwards", for turrets on the ventral side I want missiles to head "downwards" and for turrets and starboard and port to head, guess what, to starboard and port, respectively.
I started with just the pitch, i.e. rotation around the x-axis. It's value is never bigger than 90 degrees. Instead of increasing above +90 or decreasing below -90 degrees, bank and heading switch from 0 to 180 degrees and the value of pitch starts to shrink again.
€: ... which perfectly makes sense. Because if you rotate an object by +100 degrees around it's x-axis that is like turning it around the y-axis by 180 degrees and turning around +80 degrees around the x-axis. Right?
So if I use the get-object-pitch +270 degrees argument, than it works as long as bank and heading are 0. But as soon as the ship banks too far and bank and heading switch to 180, the missile goes into the wrong direction ("downward" instead of "upward").
Here is my event:
$Formula: ( when
( key-pressed "1" )
( weapon-create
"XXX"
"AreaBomb"
( get-object-x "XXX" "turret01" )
( get-object-y "XXX" "turret01" )
( get-object-z "XXX" "turret01" )
( + 270 ( get-object-pitch "XXX" ) )
( + 0 ( get-object-bank "XXX" ) )
( + 0 ( get-object-heading "XXX" ) )
"GTC Leviathan 1"
)
)
+Name: Event name
+Repeat Count: 5
+Interval: 2
turret01 is located on the top side of XXX (which is a Satis).