Well the interface methods are:
JASS:
method onFinish
method onBirth
method onUnitCollision
method onGround
Other than that, you can modify the projectile by using these "setup" variables:
JASS:
boolean activeUnitCollision
boolean activePitchRotation
The active-pitch-rotation was recently brought over from an extension struct so that I could remove the
onLoop
virtual method (since it is very inefficient), and should typically be used with the
dummy.mdx model with various pitch animations.
JASS:
real collision
real scale
real timescale
These are available to the user to modify values in real-time. Scale modifies the size of the projectile, time-scale modifies the "slow-motion" effect on the projectile (allows the projectile to be stopped, slowed down, or sped up in the middle of its flight). Collision simply affects the radius of the projectile.
The projectiles are initialized by specifying a unit (you do not
have to imitate WarCraft III projectiles, instead you could make a unit a projectile to simulate a "jump" or something) and then launched by method
doLaunch
which takes various parameters to setup the projection sequence. It uses vectors for the starting point/ending point however if the ending point is changed in the middle of the flight it will activate projectile "homing".
The dynamical aspect of the system comes from the fact that
projectile
is a data-struct that can be extended, opening the door to any user-customizations. By default, the
projectile
struct doesn't require a "source" unit or a "target" unit, instead these things can be added by extending the struct. For example:
JASS:
struct war3missile extends projectile
unit source = null
unit target = null
method onFinish takes nothing returns nothing
call UnitDamageTarget(source, target, ...)
call .destroy() //* If .onFinish is not declared, this is done automatically.
endmethod
endstruct
Once you've launched your projectile, what you have declared here will dictate how the projectiles reacts when predefined events take place. For example, when the projectile is "finished" its trajectory, it will cause the specified source unit to damage the specified target unit.
To be honest this isn't a system for noobs, and I'm not trying to show off how many things you can do with it, because the possibilities are end-less. If the user extends the
projectile
struct he/she can pretty well do whatever he/she wants with it.