George: more info on <OnSystemWeaponFire> please

Freeform discussion about anything related to modding Transcendence.
Post Reply
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

what type of object supports <OnSystemWeaponFire> and what are the variables it uses (aWeaponUNID aWeaponObj etc)?
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
george moromisato
Developer
Developer
Posts: 2997
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

First, you need to call:

Code: Select all

(objRegisterForSystemEvents obj distance)
obj is the object that you want to receive OnSystemWeaponFire
distance is the radius (in light-seconds) of the area (centered on obj) that you want to watch for events.

You will then get called at OnSystemWeaponFire whenever a ship or a station fires a weapon (I believe it will also include calls to sysCreateWeaponFire, but only if objSource is not Nil). The parameters to OnSystemWeaponFire are:

aWeaponObj is the object that fired the weapon.
aWeaponUNID is the UNID of the weapon being fired.
aWeaponPos is the position where the shot originated.

You will also get called at OnSystemExplosion if there are any ships that explode. The parameters are:

aExplosionObj is the ship that exploded.
aExplosionUNID is the UNID of the explosion (look in StdExplosions.xml).
aExplosionPos is the position of the explosion.
sdw195
Militia Captain
Militia Captain
Posts: 779
Joined: Wed Nov 18, 2009 1:01 am
Location: Still looking for the csc Antarctica
Contact:

cool, ty

*goes to tracker to request some more variables for that event*

would like ahitobj if the weapon fire hits anything and damage amount dealt
Image
Image
Image
Image
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
Post Reply