I have a character with an airship that has cannons on it. what do i add to my attack rolls for firing a cannon? do i add my dex + base attack or knowledge engineering? and what to i roll against on creatures their normal AC or touch? my character is a lvl 12 siege mage.
This really depends on the rules set. My take:
In general, I think firearms are best modeled by giving them an accuracy and penetration statistic. The accuracy on a breech loading smoothbore cannon would generally be a negative number, they aren't designed to engage man-sized targets. The other number for a firearm is penetration. Penetration is the number deducted from the target's armor bonus to AC. For a cannon, the penetration is quite high - armor is relatively ineffective against them.
So for a typical say 6lb or 8lb non-rifled light cannon, I might have Accuracy: -3 and Penetration +10, with a range increment of 200 ft. and a maximum effective range of say 20 increments. Rate of fire would be 3 with a crew of 5, adding one to rate of fire for each missing crew member. I'd probably also assess an additional penalty to accuracy against a moving target with less than the ideal crew. Reload Damage would be on the order of 3d6+9, critical range 19-20/x3. For a 12lber or other medium weight cannon, Accuracy: -4, Penetration: +12, range increment 300 ft (maximum 20 increments), rate of fire 4 with crew of 6, Damage: 5d4+12, 19-20/x3.
Cannons can also be used as Area of Effect weapons by loading mini-balls or canister shot. I'd model this as a targeted burst attack in the case of mini-balls or a narrow cone attack out to 1 range increment in the case of canister. All in the area of effect are attacked, but penetration is halved, and accuracy reduced by -2 beyond say 30'. Damage from either attack is just 3d6.
The other question is whether your character is actually proficient in using a cannon. Cannons can be added as an exotic weapon proficiency, but I also assume proficiency with siege weapons if the character has at least 5 ranks in Knowledge (Engineering) or equivalent and cannons are common to the societies technology level. I presume a siege mage has at least some ranks in whatever skill involves knowledge of laying a siege and siege engines. Without a proficiency, assess the usual -4 penalty.
Note that at standard engagement ranges - say 800 yards - the typical target of a cannon shot isn't a character, but an entire unit of troops, building, or ship. Anything other than a immobile colossal object is a very difficult target at such a range.