Utilities

From Blue Mars Developer Guidebook

Jump to: navigation, search
There are security restrictions on this article

Contents

Overview

Like the CryEngine Lua Utilities, Avatar Reality supplies a number of Lua utility functions to support development of minigames, implemented in scripts located in Game/Scripts/AR. Most of them are pretty simple and can be treated as example code from which you can develop more appropriate custom code for your purposes.

Debugging

These display and logging functions respect the CryEngine logging level described in CryEngine Lua Utilities


ARDebug(level)
convenience function for setting debugging level
ARDebugMessage(text, timeout)
displays a fading on-screen message
ARDebugText(x,y,size,text)
Displays text on-screen text at location x,y (in pixels coordinates, where 0,0 is the top left of the screen), using the HUD text-drawing function. Renders for just one frame, so should be called within an OnUpdate callback.
ARPrint(text)
Like ARDebugText but displays text at current cursor location and with a default size
ARDebugBegin()
reset the cursor position used by ARPrint and the following functions based on ARPrint
ARPrintAnim(char,slot,anim,layer)
print information about an animation
ARPrintFSCommand()
print the most recent fscommand


ARPrintEntity(entity)
print information about an entity
ARPrintView(viewId)
print information about a view
ARPrintActiveView()
print information about the current view
ARPrintMouse()
print the current mouse position
ARPrintAction()
print the most recent Action

Camera

These functions are intended to support Camera implementations but can be used for any entities that you want to aim at something or somewhere.

ARLookAtPos(entity, pos)
Orient entity to point at position
ARLookAtEntity(entity, target)
Orient entity to look at a target entity

Mouse

These functions support mouse selection/highlighting.


ARMousePick(type, flags, num)
general mouse picking function
ARMousePickTerrain()
select a location on terrain
ARMousePickEntity()
select an entity
ARPrintPick(count)
print results of ARMousePick

User Directory

These functions access the Blue Mars user directory (under Documents/MyGames/Blue Mars).


ARUserDirectory()
returns the full pathname of the Blue Mars user directory


ARUserPath(file)
returns the full pathname of a file in the Blue Mars user directory

Web

These are convenience functions for interacting with a web server.


ARSubmitGet(url, destfile, parameters, options)
send an HTTP GET request


ARSubmitPost(url, destfile, parameters, options)
send an HTTP POST request
Problems with this wiki page? Contact us either by: Support Email or Support Ticket System

Blue Mars Guidebook Privacy Policy
Blue Mars Guidebook Community Guidelines

Personal tools