En:Events

Материал из Pocket Fallout для КПК на PDA PC PPC Mobile.

Содержание

Predefined procedures and functions (events)

For support of correct reaction of a script on those or other events in game, in Pocket F.A.L.L.O.U.T. engine are used The Predetermined procedures and functions or "Events". The given procedures/functions system is calling at occurrence of a some situation (for example - random operation of a local map, fights, etc.). Each script (see Types of script files) has a number of such specific predetermined procedures/functions. They can and not exist, in case of absence of this or that event, the system will try to call the internal handler.
The list of the predetermined procedures/functions (further - Events) for each sort of files of units.

General events

Events can exist in any type of module.

  1. Procedure OnInitialization - it is loaded by game engine at the beginning of module working
  2. Procedure OnConclusion - it is loaded by game engine before module will be destroy

Events for module global.pfs

  1. Function OnUnitActionWithObject - called when unit does action with object;
  2. Function OnUnitActionWithItem - called when unit does action with item from inventory
  3. Function OnExchange - called when units make exchange of inventory items
  4. Procedure OnAfterFade - сalled after screen fade will finish
  5. Procedure OnBeginGame - сalled before loading of main game menu
  6. Function OnUnitGetTurn - сalled when object get turn (only during fight). Called after finished work of same named event from unit_events.pfs
  7. Procedure OnUnitDeath - сalled on unit death. Called after finished work of same named event from unit_events.pfs
  8. Function OnGetDamage - сalled on calculation of damage at attack. Called after successful finished work of same named event from unit_events.pfs
  9. Function isDamageCritical - сalled on calculation of critical damage probability at attack. Called after successful finished work of same named event from unit_events.pfs
  10. Procedure OnUnitSkipTurn - сalled when unit has skipped his turn. Called after successful finished work of same named event from unit_events.pfs

Events for module wmap_events.pfs

  1. Function OnWorldMapToLevelMap - сalled before hero will go from current worldmap to level location
  2. Function OnGetRandomLocation - сalled before hero gets to random location on worldmap
  3. Procedure OnLevelMapToWorldMap - сalled when hero goes to worldmap from any level location
  4. Procedure OnGetUnitPath - сalled before calculate unit walking path with name <unit_name> to relative tile (hexagon) with coordinate (ex, ey)
  5. Procedure OnTurnToTarget - called when is necessary calculate right unit direction to object-target
  6. Function isNearObject - called after checking: object with name <object_name> is near to object with name <target_name> in distance radius with value <radius>?

Events for different game level module

Below you can see all events than used only in special script files.

Events for module map_build.pfs

  1. Procedure BuildMap - called always on creation/loading of level location (should exist anyway !).
  2. Procedure OnCreateInventory - called at creation of inventory for units on current location

Events for module map_events.pfs

  1. Function OnMapExit - declared location name which should be loaded at exit from current location
  2. Procedure OnRandomMapAction - called for declaration of current random action on location (play music, move units, etc)
  3. Procedure OnBeginFight - called when fight has begun
  4. Procedure OnEndFight - called when fight is finished by unit
  5. Procedure OnAfterMapBuild - called when creation of current location was finished

Events for module unit_events.pfs

  1. Function OnUnitActionWithObject - called when unit doing action with object. Called before call of same named event from global.pfs
  2. Function OnUnitSkill - called when unit doing skill with object
  3. Function OnPutItem - called when unit puts item in his inventory
  4. Function OnUnitLook - called when unit looks at other object
  5. Function OnHeroAnswer - called when unit talks with other unit and selects answer
  6. Procedure OnUnitTalk - called when talking window is created
  7. Function OnUnitGetTurn - called when unit got turn (only during fight)
  8. Procedure OnUnitDeath - called on unit death
  9. Function OnGetDamage - called on calculation of damage at attack
  10. Function isDamageCritical - called on calculation critical damage probability at attack. Called of system after call event OnGetDamage
  11. Procedure OnUnitSkipTurn - called when unit skips his turn
  12. Procedure OnAfterMapBuild - called when creation of current location was finished
  13. Procedure OnUnitStay - called when unit finished last action or stayed (added in 1.1)
Личные инструменты