FOnline
 Указатель Классы Функции Переменные Группы Страницы
API маппера

Классы

struct  MapperObject
 
struct  MapperMap
 

Зарезервированные функции

void start ()
 
uint loop ()
 
bool console_message (string &message)
 
void render_iface (uint layer)
 
void render_map ()
 
bool mouse_down (int click)
 
bool mouse_up (int click)
 
void mouse_move (int x, int y)
 
bool key_down (uint8 key)
 
bool key_up (uint8 key)
 
void input_lost ()
 

Пользовательские функции

Вызываются из консоли используя символ '#'

string FuncName (string str)
 

Глобальные функции

void SetDefaultCritterParam (uint index, int param)
 Начальные параметры: 0 ST_DIALOG_ID, 1 ST_AI_ID, 2 ST_BAG_ID, 3 ST_TEAM_ID, 4 ST_NPC_ROLE, 5 ST_REPLICATION_TIME, 6..14 -1. Подробнее...
 
MapperMap LoadMap (string &fileName, int pathType)
 
void UnloadMap (MapperMap @+map)
 
bool SaveMap (MapperMap @+map, string &fileName, int pathType)
 
bool ShowMap (MapperMap @+map)
 
int GetLoadedMaps (MapperMap @[]@+maps)
 
void DeleteObject (MapperObject @+obj)
 
void DeleteObjects (MapperObject @[]&objects)
 
void SelectObject (MapperObject @+obj, bool set)
 
void SelectObjects (MapperObject @[]&objects, bool set)
 
MapperObject GetSelectedObject ()
 
uint GetSelectedObjects (MapperObject @[]@+objects)
 
MapperObject GetMonitorObject (int x, int y, bool ignoreInterface=false)
 
void GetMousePosition (int &x, int &y)
 
uint GetMapFileNames (string @+dir, string @[]@+names)
 
ProtoItem GetProtoItem (uint16 protoId)
 
bool LoadDat (string &datName)
 
void MoveScreen (uint16 hexX, uint16 hexY, uint speed)
 
int GetKeybLang ()
 
string GetIfaceIniStr (string &key)
 
bool LoadFont (int font, string &fontFileName)
 
void SetDefaultFont (int font, uint color)
 
void MouseClick (int x, int y, int button, int cursor)
 
void KeyboardPress (uint8 key1, uint8 key2)
 
void Log (string &text)
 
string GetLastError ()
 
int Random (int minimum, int maximum)
 
uint GetTick ()
 
uint GetAngelScriptProperty (int property)
 
void SetAngelScriptProperty (int property, uint value)
 
void GetHexCoord (uint16 fromHx, uint16 fromHy, uint16 &toHx, uint16 &toHy, float angle, uint dist)
 
uint GetPathLength (uint16 fromHx, uint16 fromHy, uint16 toHx, uint16 toHy, uint cut)
 
bool GetHexPos (uint16 hx, uint16 hy, int &x, int &y)
 
bool GetMonitorHex (int x, int y, uint16 &hx, uint16 &hy)
 
void MoveHexByDir (uint16 &hexX, uint16 &hexY, uint8 dir, uint steps)
 
uint GetDistantion (uint16 hexX1, uint16 hexY1, uint16 hexX2, uint16 hexY2)
 
uint8 GetDirection (uint16 fromX, uint16 fromY, uint16 toX, uint16 toY)
 
uint8 GetOffsetDir (uint16 hx, uint16 hy, uint16 tx, uint16 ty, float offset)
 
void Message (string &text)
 
void Message (int textMsg, uint strNum)
 
void MapMessage (string &text, uint16 hx, uint16 hy, uint timeMs, uint color, bool fade, int offsX, int offsY)
 
string GetMsgStr (int textMsg, uint strNum)
 
string GetMsgStr (int textMsg, uint strNum, uint skipCount)
 
uint GetMsgStrNumUpper (int textMsg, uint strNum)
 
uint GetMsgStrNumLower (int textMsg, uint strNum)
 
uint GetMsgStrCount (int textMsg, uint strNum)
 
bool IsMsgStr (int textMsg, uint strNum)
 
string ReplaceText (const string &text, const string &replace, const string &str)
 
string ReplaceText (const string &text, const string &replace, int i)
 
uint LoadSprite (string &name, int pathIndex)
 
uint LoadSprite (uint16 sprNum, uint8 dir, int pathIndex)
 
int GetSpriteWidth (uint sprId, int sprIndex)
 
int GetSpriteHeight (uint sprId, int sprIndex)
 
uint GetSpriteCount (uint sprId)
 
void DrawSprite (uint sprId, int sprIndex, int x, int y, uint color)
 
void DrawSprite (uint sprId, int sprIndex, int x, int y, int w, int h, bool scratch, bool center, uint color)
 
void DrawText (string &text, int x, int y, int w, int h, uint color, int font, int flags)
 
void DrawPrimitive (int primitiveType, int[]&data)
 
void DrawMapSprite (uint16 hx, uint16 hy, uint16 effectPid, uint sprId, int sprIndex, int offsX, int offsY)
 
void DrawCritter2d (uint crType, uint anim1, uint anim2, uint8 dir, int l, int t, int r, int b, bool scratch, bool center, uint color)
 
void DrawCritter3d (uint instance, uint crType, uint anim1, uint anim2, int[]@+layers, float[]@+position, uint color)
 
uint TabGetTileDirs (int tab, string @[]@+dirNames, bool[]@+includeSubdirs)
 
uint TabGetItemPids (int tab, string @+subTab, uint16[]@+itemPids)
 
uint TabGetCritterPids (int tab, string @+subTab, uint16[]@+critterPids)
 
void TabSetTileDirs (int tab, string @[]@+dirNames, bool[]@+includeSubdirs)
 
void TabSetItemPids (int tab, string @+subTab, uint16[]@+itemPids)
 
void TabSetCritterPids (int tab, string @+subTab, uint16[]@+critterPids)
 
void TabDelete (int tab)
 
void TabSelect (int tab, string @+subTab, bool show=false)
 
void TabSetName (int tab, string @+subName)
 
void Update () const
 
uint GetChilds (MapperObject @[]@+objects) const
 
void MoveToHex (uint16 hexX, uint16 hexY)
 
void MoveToHexOffset (int x, int y)
 
void MoveToDir (uint8 dir)
 
MapperObject AddObject (uint16 hexX, uint16 hexY, int mapObjType, uint16 pid)
 
MapperObject GetObject (uint16 hexX, uint16 hexY, int mapObjType, uint16 pid, uint skip) const
 
uint GetObjects (uint16 hexX, uint16 hexY, uint radius, int mapObjType, uint16 pid, MapperObject @[]@+objects) const
 
void UpdateObjects () const
 
string GetTileName (uint16 hexX, uint16 hexY, bool roof, uint index) const
 
void AddTileName (uint16 hexX, uint16 hexY, int offsX, int offsY, int layer, bool roof, string @+picName)
 
uint GetDayTime (uint dayPart) const
 
void SetDayTime (uint dayPart, uint time)
 
void GetDayColor (uint dayPart, uint8 &r, uint8 &g, uint8 &b) const
 
void SetDayColor (uint dayPart, uint8 r, uint8 g, uint8 b)
 
void Resize (uint16 width, uint16 height)
 

Функции для работы с константами (*Names.lst)

int GetConstantValue (int constCollection, string @+name)
 Определение значения константы по имени. Подробнее...
 
string GetConstantName (int constCollection, int value)
 Определение имени константы по значению. Подробнее...
 
void AddConstant (int constCollection, string @+name, int value)
 Добавление отдельной константы в коллекцию. Подробнее...
 
bool LoadConstants (int constCollection, string @+fileName, int pathType)
 Загрузка/перезагрузка коллекции. Подробнее...
 

Геомертия игровой сетки

Указывает надо ли разбивать тайлы в папках по группам.

Группа определяется как строка в имени файла до первого числа (например, abc12.png - группа abc), а если номера нет, то группа определяется как '<other>'.

В скрипте config.fos, в функции InitializeGeometry(), добавлены необходимые настройки для трех игр: Fallout1/2, Fallout Tactics и Arcanum. Данная функция вызывается в скриптах сервера, клиента и маппера, т.к. информация о геометрии нужна всем трем. Четырехугольная изометрия использует восемь направлений, гексогональная шесть.
Рабочие спрайты для геометрии находятся в art/geometry/.

bool __MapHexagonal
 Тип изометрии true - гексогональная, false - четырехугольная. Подробнее...
 
int __MapHexWidth
 Ширина гекса Подробнее...
 
int __MapHexHeight
 Высота гекса Подробнее...
 
int __MapHexLineHeight
 Высота линии гексов Подробнее...
 
int __MapTileOffsX
 Смещение тайлов земли по горизонтали Подробнее...
 
int __MapTileOffsY
 Смещение тайлов земли по вертикали Подробнее...
 
int __MapRoofOffsX
 Смещение тайлов крыши по горизонтали Подробнее...
 
int __MapRoofOffsY
 Смещение тайлов крыши по вертикали Подробнее...
 
int __MapRoofSkipSize
 Кол-во гексов на один тайл крыши (нужно для его корректного скрывания) Подробнее...
 
float __MapCameraAngle
 Угол для рендеринга трехмерных моделей Подробнее...
 
bool __MapSmoothPath
 Сглаживание пути при перемещениях Подробнее...
 
string __MapDataPrefix
 Путь и префикс для файлов геометрии Подробнее...
 

Подробное описание

Функции

void start ( )
uint loop ( )
bool console_message ( string message)
void render_iface ( uint  layer)
void render_map ( )
bool mouse_down ( int  click)
bool mouse_up ( int  click)
void mouse_move ( int  x,
int  y 
)
bool key_down ( uint8  key)
bool key_up ( uint8  key)
void input_lost ( )
string FuncName ( string  str)
void SetDefaultCritterParam ( uint  index,
int  param 
)

Начальные параметры: 0 ST_DIALOG_ID, 1 ST_AI_ID, 2 ST_BAG_ID, 3 ST_TEAM_ID, 4 ST_NPC_ROLE, 5 ST_REPLICATION_TIME, 6..14 -1.

MapperMap LoadMap ( string fileName,
int  pathType 
)
void UnloadMap ( MapperMap @+  map)
bool SaveMap ( MapperMap @+  map,
string fileName,
int  pathType 
)
bool ShowMap ( MapperMap @+  map)
int GetLoadedMaps ( MapperMap @@+[]  maps)
void DeleteObject ( MapperObject @+  obj)
void DeleteObjects ( MapperObject @&[]  objects)
void SelectObject ( MapperObject @+  obj,
bool  set 
)
void SelectObjects ( MapperObject @&[]  objects,
bool  set 
)
MapperObject GetSelectedObject ( )
uint GetSelectedObjects ( MapperObject @@+[]  objects)
MapperObject GetMonitorObject ( int  x,
int  y,
bool  ignoreInterface = false 
)
void GetMousePosition ( int &  x,
int &  y 
)
uint GetMapFileNames ( string @+  dir,
string @@+[]  names 
)
ProtoItem GetProtoItem ( uint16  protoId)
bool LoadDat ( string datName)
void MoveScreen ( uint16  hexX,
uint16  hexY,
uint  speed 
)
int GetKeybLang ( )
string GetIfaceIniStr ( string key)
bool LoadFont ( int  font,
string fontFileName 
)
void SetDefaultFont ( int  font,
uint  color 
)
void MouseClick ( int  x,
int  y,
int  button,
int  cursor 
)
void KeyboardPress ( uint8  key1,
uint8  key2 
)
void Log ( string text)
string GetLastError ( )
int Random ( int  minimum,
int  maximum 
)
uint GetTick ( )
uint GetAngelScriptProperty ( int  property)
void SetAngelScriptProperty ( int  property,
uint  value 
)
void GetHexCoord ( uint16  fromHx,
uint16  fromHy,
uint16 &  toHx,
uint16 &  toHy,
float  angle,
uint  dist 
)
uint GetPathLength ( uint16  fromHx,
uint16  fromHy,
uint16  toHx,
uint16  toHy,
uint  cut 
)
bool GetHexPos ( uint16  hx,
uint16  hy,
int &  x,
int &  y 
)
bool GetMonitorHex ( int  x,
int  y,
uint16 &  hx,
uint16 &  hy 
)
void MoveHexByDir ( uint16 &  hexX,
uint16 &  hexY,
uint8  dir,
uint  steps 
)
uint GetDistantion ( uint16  hexX1,
uint16  hexY1,
uint16  hexX2,
uint16  hexY2 
)
uint8 GetDirection ( uint16  fromX,
uint16  fromY,
uint16  toX,
uint16  toY 
)
uint8 GetOffsetDir ( uint16  hx,
uint16  hy,
uint16  tx,
uint16  ty,
float  offset 
)
void Message ( string text)
void Message ( int  textMsg,
uint  strNum 
)
void MapMessage ( string text,
uint16  hx,
uint16  hy,
uint  timeMs,
uint  color,
bool  fade,
int  offsX,
int  offsY 
)
string GetMsgStr ( int  textMsg,
uint  strNum 
)
string GetMsgStr ( int  textMsg,
uint  strNum,
uint  skipCount 
)
uint GetMsgStrNumUpper ( int  textMsg,
uint  strNum 
)
uint GetMsgStrNumLower ( int  textMsg,
uint  strNum 
)
uint GetMsgStrCount ( int  textMsg,
uint  strNum 
)
bool IsMsgStr ( int  textMsg,
uint  strNum 
)
string ReplaceText ( const string text,
const string replace,
const string str 
)
string ReplaceText ( const string text,
const string replace,
int  i 
)
uint LoadSprite ( string name,
int  pathIndex 
)
uint LoadSprite ( uint16  sprNum,
uint8  dir,
int  pathIndex 
)
int GetSpriteWidth ( uint  sprId,
int  sprIndex 
)
int GetSpriteHeight ( uint  sprId,
int  sprIndex 
)
uint GetSpriteCount ( uint  sprId)
void DrawSprite ( uint  sprId,
int  sprIndex,
int  x,
int  y,
uint  color 
)
void DrawSprite ( uint  sprId,
int  sprIndex,
int  x,
int  y,
int  w,
int  h,
bool  scratch,
bool  center,
uint  color 
)
void DrawText ( string text,
int  x,
int  y,
int  w,
int  h,
uint  color,
int  font,
int  flags 
)
void DrawPrimitive ( int  primitiveType,
int &[]  data 
)
void DrawMapSprite ( uint16  hx,
uint16  hy,
uint16  effectPid,
uint  sprId,
int  sprIndex,
int  offsX,
int  offsY 
)
void DrawCritter2d ( uint  crType,
uint  anim1,
uint  anim2,
uint8  dir,
int  l,
int  t,
int  r,
int  b,
bool  scratch,
bool  center,
uint  color 
)
void DrawCritter3d ( uint  instance,
uint  crType,
uint  anim1,
uint  anim2,
int @+[]  layers,
float @+[]  position,
uint  color 
)
uint TabGetTileDirs ( int  tab,
string @@+[]  dirNames,
bool @+[]  includeSubdirs 
)
uint TabGetItemPids ( int  tab,
string @+  subTab,
uint16 @+[]  itemPids 
)
uint TabGetCritterPids ( int  tab,
string @+  subTab,
uint16 @+[]  critterPids 
)
void TabSetTileDirs ( int  tab,
string @@+[]  dirNames,
bool @+[]  includeSubdirs 
)
void TabSetItemPids ( int  tab,
string @+  subTab,
uint16 @+[]  itemPids 
)
void TabSetCritterPids ( int  tab,
string @+  subTab,
uint16 @+[]  critterPids 
)
void TabDelete ( int  tab)
void TabSelect ( int  tab,
string @+  subTab,
bool  show = false 
)
void TabSetName ( int  tab,
string @+  subName 
)
void Update ( ) const
uint GetChilds ( MapperObject @@+[]  objects) const
void MoveToHex ( uint16  hexX,
uint16  hexY 
)
void MoveToHexOffset ( int  x,
int  y 
)
void MoveToDir ( uint8  dir)
MapperObject AddObject ( uint16  hexX,
uint16  hexY,
int  mapObjType,
uint16  pid 
)
MapperObject GetObject ( uint16  hexX,
uint16  hexY,
int  mapObjType,
uint16  pid,
uint  skip 
) const
uint GetObjects ( uint16  hexX,
uint16  hexY,
uint  radius,
int  mapObjType,
uint16  pid,
MapperObject @@+[]  objects 
) const
void UpdateObjects ( ) const
string GetTileName ( uint16  hexX,
uint16  hexY,
bool  roof,
uint  index 
) const
void AddTileName ( uint16  hexX,
uint16  hexY,
int  offsX,
int  offsY,
int  layer,
bool  roof,
string @+  picName 
)
uint GetDayTime ( uint  dayPart) const
void SetDayTime ( uint  dayPart,
uint  time 
)
void GetDayColor ( uint  dayPart,
uint8 &  r,
uint8 &  g,
uint8 &  b 
) const
void SetDayColor ( uint  dayPart,
uint8  r,
uint8  g,
uint8  b 
)
void Resize ( uint16  width,
uint16  height 
)
int GetConstantValue ( int  constCollection,
string @+  name 
)

Определение значения константы по имени.

Аргументы
constCollectionНомер коллекции, см. Constants collections в _defines.fos.
nameИмя константы.
Возвращает
Значение константы.
string GetConstantName ( int  constCollection,
int  value 
)

Определение имени константы по значению.

Аргументы
constCollectionНомер коллекции, см. Constants collections в _defines.fos.
valueЗначение константы.
Возвращает
Имя константы.
void AddConstant ( int  constCollection,
string @+  name,
int  value 
)

Добавление отдельной константы в коллекцию.

Аргументы
constCollectionНомер коллекции, см. Constants collections в _defines.fos.
nameИмя константы.
valueЗначение константы.
bool LoadConstants ( int  constCollection,
string @+  fileName,
int  pathType 
)

Загрузка/перезагрузка коллекции.

Аргументы
constCollectionНомер коллекции, см. Constants collections в _defines.fos.
fileNameИмя файла.
pathTypeПуть.

Переменные

bool __MapHexagonal

Тип изометрии true - гексогональная, false - четырехугольная.

int __MapHexWidth

Ширина гекса

int __MapHexHeight

Высота гекса

int __MapHexLineHeight

Высота линии гексов

int __MapTileOffsX

Смещение тайлов земли по горизонтали

int __MapTileOffsY

Смещение тайлов земли по вертикали

int __MapRoofOffsX

Смещение тайлов крыши по горизонтали

int __MapRoofOffsY

Смещение тайлов крыши по вертикали

int __MapRoofSkipSize

Кол-во гексов на один тайл крыши (нужно для его корректного скрывания)

float __MapCameraAngle

Угол для рендеринга трехмерных моделей

bool __MapSmoothPath

Сглаживание пути при перемещениях

string __MapDataPrefix

Путь и префикс для файлов геометрии