User Tools

Site Tools


modding:function:syscreateweaponfire

This is an old revision of the document!


Discuss this page on this pages TalkPage

sysCreateWeaponFire

See sysCreateWeaponFire at Xelerus

Syntax (sysCreateWeaponFire weaponID objSource posVector dir speed objTarget [detonateNow] [weaponBonus]) → 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
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]: bonus damage as if from enhancement
Returns obj: The shotObject created by the weapon
Category create, system, unid
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)

Return to Functions list

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