Functions Documentation
View Function Edit Function
Name sysCreateWeaponFire
Syntax (sysCreateWeaponFire weaponID objSource posVector dir speed objTarget [detonateNow] [weaponBonus]) -> obj
Argument List weaponID: the UNID of the called weapon effect
objSource: the spaceObject who is the controller of the weaponfire, can also be Nil
posVector: position of the weaponfire
dir: angle of the direction of the weapon
speed: velocity of the weaponfire
objTarget: the target of the weapon, can also be Nil
[detonateNow]: if True the failsafe variable in the <Weapon> tag is ignored
[weaponBonus]: the bonus damage multiplier, eg from aWeaponBonus if used in <onFireWeapon>
Returns obj: The shotObject created by the weapon
Category unid, system, create
Description Creates the weaponfire effect of a weapon selected from the UNID
Example This is a typical example of firing the source weapon (in an OnFireWeapon event) with many of its base attributes intact, ie. firing in the same angle with the same speed. This is for non missile-weapons.
(sysCreateWeaponFire (itmGetUNID gItem) gSource aFirePos 
aFireAngle (typGetDataField (itmGetUNID gItem) 'speed) aTargetObj)
This one is for omnidirectional weapons:
(block (shot)
(setq shot (sysCreateWeaponFire (itmGetUNID gItem) gSource aFirePos (sysCalcFireSolution (sysVectorSubtract (objGetPos aTargetObj) aFirePos) (sysVectorSubtract (objGetVel aTargetObj) (objGetVel gSource)) (typGetDataField (itmGetUNID gItem) 'speed)) (typGetDataField (itmGetUNID gItem) 'speed) aTargetObj Nil aWeaponBonus))
(objIncVel shot (objGetVel gSource))
Comment Highly customizable function that creates weapon fire effects.
The target of the weapon is specified in order to be used for tracking weapons.