En:General procedures and functions

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

Содержание

General procedures and functions

Besides keywords PFSL language contains fixed collection general procedures 
and functions, which are used for performance of mathematical  
calculations, string manipulation, system operations. 
Use procedure and function in a code it is possible anywhere.

Special procedures and functions

CreateObject Procedure is used for creation of descendant-object from class
Length Function returns string length or array
DbgShowValue Display value of the specified variable (for debugging)
DbgLogValue Deduce to log-file dbgscript.log the information about variable
CheckFightStack Used for collision resolution during fight
GetCurrentFighter Get name of a current fighting unit (works only at fight)
ShowWaitCursor Display (in a new parallel stream) the wait cursor
HideWaitCursor Hide the wait cursor
GetWalkAreaValue Get walk area value of relative tiles (hexagon) on the current coordinates.
SetWalkStep Set coordinates of relative tiles (hexagon) on which the unit will move.
GetPlayerName Get gamer name
ExecuteGlobalMethod Execute method (procedure/function) from global module global.pfs
PreLoadObjectImage Load unit image to memory
isFightMode Returns true if fight mode is switched on (added in 1.1 version)

Procedures/functions of quests tool kit

AddQuest Add new quest to the quest list
SetQuestState Set quest state by its identifier
GetQuestState Get the quest state by its identifier
isQuestDefined Check: quest is defined by quest identifier in quest list

Mathematical functions/procedures

Sin Get a sine value
Cos Get a cosine value
Tan Get a tangent value
Randomize Cteate numbers random table
Rand Return a random number taken from numbers random table
Mod Get residue of division
Div Get integer part of division
Round ОRound off number with the fixed degree
Log Get the natural logarithm (on the e basis) of the value
Log10 Get the common logarithm from value
Exp Powering e (exponent)
Pow Powering the number

Procedures/functions of working with user messages

YesNoMessage Display the message window with "Yes/No" buttons
ShowMessage Display the message in the stilized window (with "OK" button)
AddStringMessage Add a message in the message list. This message will be added in the current message list (on user panel) or will be displayed in tooltip
AddStringMessageByIndex Add a message in the message list by its identifier. This message will be added in the current message list (on user panel) or will be displayed in tooltip
AddAnswer Add answer to the talking window for unit
ExitTalk Exit talking window
SetDefaultMessagesState Set state of (on/off) mode of default system message
AddFormattedMessage Add a formatted message

Procedures/functions of working with variables data

Mechanism with "datas repository" is provided in engine. This repository
is used for storage basic type value and exists over a 
period whole game process, and saves in the time of saving. Procedures and 
functions are enumerated for working with datas repository.
SaveValue Save variable value with specified key in data repository
LoadValue Load variable value from repository by key
RemoveValue Remove variable from repository by its identifier
isValueExists Check: value exists in repository

Procedures/functions of string manipulation

NumberToStr Convert number to string
StrToNumber Convert string to number
Pos Return index with which sub_string begins in string
SubStr Return string part from string, starting from a symbol with specified position with the current length
Chr Get symbol (string from one symbol) by its code ASCII
Ord Get code ASCII by symbol (symbol in the form of string)

Procedures/functions of working with audio files

StopMusic Stop music playing
PlayMusic Play infinitely audio file
PlaySfx Play audio file onece
Личные инструменты