Difference between revisions of "Ideas for triggers"

From Bitfighter
Line 9: Line 9:
 
onFlagDropped(flag, dropper)
 
onFlagDropped(flag, dropper)
  
 +
onShipAboutToSpawn(ship, proposedSpawnPoint)
 
onShipSpawned(ship, spawnpoint)
 
onShipSpawned(ship, spawnpoint)
 
onShipDamaged(ship, damager)
 
onShipDamaged(ship, damager)
 
onShipKilled(ship, killer)
 
onShipKilled(ship, killer)
// The following function will be called before a ship will spawn and will return a
+
 
// the spawn point at witch it will spawn. onShipSpawned would be called after the
+
// ship will spawn
+
getSpawnPointFor(ship)
+
  
 
onTurretKilled(turret, killer)
 
onTurretKilled(turret, killer)

Revision as of 20:11, 6 January 2010

A working list of ideas for triggers that could cause execution of code in a robot or supervisor script. Remember that robots are a kind of ship, so, generally, there's no need differentiate the two.

// Here, zone could be any polygonal entity: loadout zones, nexus, goal zones, etc.
onShipEnteredZone(ship, zone) 
onShipLeftZone(ship, zone)

onFlagGrabbed(flag, ship)
onFlagDropped(flag, dropper)

onShipAboutToSpawn(ship, proposedSpawnPoint)
onShipSpawned(ship, spawnpoint)
onShipDamaged(ship, damager)
onShipKilled(ship, killer)


onTurretKilled(turret, killer)
onAllTurretsKilled(team)
onForceFieldKilled(forcefield, killer)
onAllForceFieldKilled(team)

onTeamScored(team, score, scoringEvent, scoringShip)
onIndividualScored(scoringShip, score, scoringEvent)
onLeadingTeamChanged(team, previousLeadingTeam)
onLeadingPlayerChanged(player, previousLeadingPlayer)

onAsteroidSpawned(asteroid)
onAsteroidShot(asteroid, shooter)
onAsteroidDestroyed(asteroid, shooter)

onHealthPackUsed(healthpack, ship)
onHealthPackReplenished(healthpack)


onTurretSelectedTarget(turret, target)
onTurretFired(turret, target)

// Game specific events: named on<Game>EventName

onNexusOpen(nexus)
onNexusClose(nexus)
onNexusFlagCollected(flag, ship)

onRabbitKilled(rabbit, killer)
onRabbitGrabbedFlag(rabbit)

onZoneControlZoneCaptured(zone, capturer)
onZoneControlTouchDownScored(scoringShip) ( or onZonesReset() )

onHTFFlagReturnedToZone(flag, zone, returner)
onHTFFlagRemovedFromZone(flag, zone, taker)

onSoccerBallPossesionChanged(ball, possessingShip, previousPossesser)
onSoccerGoalScored(ball, goal, scorer)
onSoccerBallReset(ball) (when ball actually arrives back at starting position)