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.
- Procedure OnInitialization - it is loaded by game engine at the beginning of module working
- Procedure OnConclusion - it is loaded by game engine before module will be destroy
Events for module global.pfs
- Function OnUnitActionWithObject - called when unit does action with object;
- Function OnUnitActionWithItem - called when unit does action with item from inventory
- Function OnExchange - called when units make exchange of inventory items
- Procedure OnAfterFade - сalled after screen fade will finish
- Procedure OnBeginGame - сalled before loading of main game menu
- Function OnUnitGetTurn - сalled when object get turn (only during fight). Called after finished work of same named event from unit_events.pfs
- Procedure OnUnitDeath - сalled on unit death. Called after finished work of same named event from unit_events.pfs
- Function OnGetDamage - сalled on calculation of damage at attack. Called after successful finished work of same named event from unit_events.pfs
- Function isDamageCritical - сalled on calculation of critical damage probability at attack. Called after successful finished work of same named event from unit_events.pfs
- 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
- Function OnWorldMapToLevelMap - сalled before hero will go from current worldmap to level location
- Function OnGetRandomLocation - сalled before hero gets to random location on worldmap
- Procedure OnLevelMapToWorldMap - сalled when hero goes to worldmap from any level location
- Procedure OnGetUnitPath - сalled before calculate unit walking path with name <unit_name> to relative tile (hexagon) with coordinate (ex, ey)
- Procedure OnTurnToTarget - called when is necessary calculate right unit direction to object-target
- 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
- Procedure BuildMap - called always on creation/loading of level location (should exist anyway !).
- Procedure OnCreateInventory - called at creation of inventory for units on current location
Events for module map_events.pfs
- Function OnMapExit - declared location name which should be loaded at exit from current location
- Procedure OnRandomMapAction - called for declaration of current random action on location (play music, move units, etc)
- Procedure OnBeginFight - called when fight has begun
- Procedure OnEndFight - called when fight is finished by unit
- Procedure OnAfterMapBuild - called when creation of current location was finished
Events for module unit_events.pfs
- Function OnUnitActionWithObject - called when unit doing action with object. Called before call of same named event from global.pfs
- Function OnUnitSkill - called when unit doing skill with object
- Function OnPutItem - called when unit puts item in his inventory
- Function OnUnitLook - called when unit looks at other object
- Function OnHeroAnswer - called when unit talks with other unit and selects answer
- Procedure OnUnitTalk - called when talking window is created
- Function OnUnitGetTurn - called when unit got turn (only during fight)
- Procedure OnUnitDeath - called on unit death
- Function OnGetDamage - called on calculation of damage at attack
- Function isDamageCritical - called on calculation critical damage probability at attack. Called of system after call event OnGetDamage
- Procedure OnUnitSkipTurn - called when unit skips his turn
- Procedure OnAfterMapBuild - called when creation of current location was finished
- Procedure OnUnitStay - called when unit finished last action or stayed (added in 1.1)