User Tools

Site Tools


Discuss this page on this pages TalkPage


See sysCreateWeaponFire at Xelerus

Syntax (sysCreateWeaponFire weaponID objSource posVector dir speed objTarget [options] [bonus]) → obj
Arguments weaponID: the UNID of the called weapon effect. Can also be an itemStruct (for weapon scaling)
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. If this is Nil and objTarget is defined, then automatically calculates the angle needed to hit objTarget. Otherwise, defaults to 0.
speed: velocity of the weaponfire
objTarget: the target of the weapon, can also be Nil
[options]: if True the failsafe variable in the <Weapon> tag is ignored
[bonus]: Percent bonus damage to add as if from an hpBonus enhancement.
Returns obj: The shotObject created by the weapon
Category create, system, unid
Description Creates the shot of a weapon


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)

Return to Functions list

modding/function/syscreateweaponfire.txt · Last modified: 2017/02/14 02:36 by 0xabcdef