-
Notifications
You must be signed in to change notification settings - Fork 1
Callbacks
This page contains documentation for the Extra Utilities callback functions. Use them the same way you'd use CreateObject()/AddPlayer() etc, define the body in your script to utilize the values.
function AddScrap(team: number, amount: number) -> nilThis function is called every time Team::AddScrap is called internally, it captures the team number of the operation as well as the integer amount of scrap. This is called any time the scrap counter changes, so this includes scavenger dropoff, building units, as well as cancelling units mid-build which will refund their scrap. Spending scrap will simply pass in a negative amount.
function BulletHit(odf: string, shooter?: handle, hitObject: handle, transform: matrix, ordnanceHandle: Ordanance*) -> nilThis function is called every time Bullet::Hit is called internally, use it to capture the odf of the ordnance, the handle of the shooter, the handle of the target that was hit (if it exists), the transform matrix of the bullet when it hit, and a special handle to the ordnance. It does not capture bouncing ordnance like MDM mortars and splinters (though it will capture an MDM impacting a ship and the splinter spinner shots), as well as explosion damage. Untested in multiplayer, but will likely fire off on ANY bullet impacts even ones from remote players, so you may have to filter by shooter. In rare circumstances the shooter handle can be nil, the only known case of this is when a bullet is generated by an explosion. You should NOT Send() remote players a local ordnance handle, all ordnance handling should be local.
function BulletInit(odf: string, shooter?: handle, transform: matrix, ordnanceHandle: Ordnance*) -> nilThis function is called every time Bullet::Init is called internally. It captures the following parameters for most ordnance (Bullet class is the base class of the majority of attacks excluding some specials like thumper and laying any of the mine items). One note about continuous beam weapons like flash cannon is that this is only called when first firing, and it is not called during the rest of the attack. In rare circumstances the shooter handle can be nil, the only known case of this is when a bullet is generated by an explosion. You should NOT Send() remote players a local ordnance handle, all ordnance handling should be local.