Glad to help.
Quote: "I can't see how moving the turret to the original cannonball spawn offset and then back again would do anything useful.. Wouldn't that just load up spawnx# spawny# and spawnz# with the same value as xoffset# yoffset# and zoffset#"
It's actually moving the turret on it's local axes by an amount relative to its current position. If your turret was always positioned at 0,0,0 and not rotated at all, then yes, the spawn coordinates would equal the offset coordinates. However, if the turret is in any other position or rotated (or both), the spawn coordinates will be the offset coordinates relative to the turret's current position and rotation. Try running this snippet to see what I mean. The cube is the turret and the sphere is the spawn point.
CreateObjectBox(1,4,4,8)
CreateObjectSphere(2,2,8,8)
// try changing these to change the spawn point
offsetx# = 0
offsety# = 0
offsetz# = 6
do
RotateObjectGlobalY(1,1)
RotateObjectLocalX(1,2)
RotateObjectGlobalZ(1,1.5)
SetObjectPosition(1,GetObjectX(1),GetObjectY(1),GetObjectZ(1) + 0.1)
oldx# = GetObjectX(1)
oldy# = GetObjectY(1)
oldz# = GetObjectZ(1)
MoveObjectLocalX(1,offsetx#)
MoveObjectLocalY(1,offsety#)
MoveObjectLocalZ(1,offsetz#)
spawnx# = GetObjectX(1)
spawny# = GetObjectY(1)
spawnz# = GetObjectZ(1)
SetObjectPosition(1,oldx#,oldy#,oldz#)
SetObjectPosition(2,spawnx#,spawny#,spawnz#)
print(spawnx#)
print(spawny#)
print(spawnz#)
sync()
loop