798
« on: May 08, 2010, 10:50:14 AM »
Currently I have it like this:
Inputs
onItemUse
onItemUnUse
onItemTrigger
onItemProjectileHit
(my existing onItemPickup event is compatible)
Outputs
Weapon -> spawnProjectile
Weapon -> spawnExplosion
Weapon -> setTimeout (Delays firing for a set time)
Weapon -> playSound (Plays a sound like most normal guns do)
If you pick up the specially created item "Event Gun", these events all work with it, triggering on the brick you got it from.
onItemTrigger -> Weapon -> playSound [spearFire.wav]
onItemTrigger -> Weapon -> spawnProjectile [90, Spear, "0 0 0" no spread, 0.5]
onItemTrigger -> Weapon -> setTimeout [500]
(Clicking fires a half-scale spear very fast)
onItemProjectileHit -> Target -> setPlayerScale [0.3]
(Shrinks target on hit)
I'm not sure whether the projectile should deal damage. Perhaps it does unless there are any on-hit events/effects?
spawnExplosion works for making some of the "emitter" effects, but they don't stick to the end of the gun so if you walk and fire at the same time the particles stay in mid-air behind you...