Unofficial community resource. Not affiliated with, maintained by, or endorsed by WOWCube / Cubios Inc. Cubios Inc. does not guarantee the accuracy or completeness of this content. Official WOWCube Development Kit

WOWCube Docs logo
WOWCube Docs
Mission Control
Section Shortcuts
APIExamplesSourceWOWConnectChangelogDeveloper Toolkit
Filters
SDK and language defaults persist in cookies.
SDK version
Navigation Tree
Collapsed by default, focused on the active path.

Unofficial community resource. Not affiliated with, maintained by, or endorsed by WOWCube / Cubios Inc. Cubios Inc. does not guarantee the accuracy or completeness of this content. For official documentation and the SDK, see the WOWCube Development Kit.

Made byMcKay Seamons
GitHub
  1. Home
  2. Docs
  3. API
  4. SELF\ ID
Mission NodeSDK 6.3PawnAPI Reference

SELF\ ID

PawnLibs/wowcore/SELF\ ID Summary An ID of the module on which application copy is running. Synopsis public const SELF ID = 0; PawnLibs/wowcore/GAME\ SAVE\ S...

API / SDK 6.3 / Pawn / API Reference
VersionSDK 6.3SDK 6.2SDK 6.1
Report issue

PawnLibs/wowcore/SELF_ID

Summary

An ID of the module on which application copy is running.

Synopsis

SELF\ ID
PAWN
1public const SELF_ID = 0;
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

PawnLibs/wowcore/GAME_SAVE_SIZE

Summary

Maximum allowed size of an application save data in cells.

Synopsis

SELF\ ID
PAWN
1#define GAME_SAVE_SIZE 64
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

PawnLibs/wowcore/MAX_PACKET_SIZE

Summary

Maximum size of an application packet.

Synopsis

SELF\ ID
PAWN
1#define MAX_PACKET_SIZE 28
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

PawnLibs/wowcore/MAX_PACKET_TYPES

Summary

Maximum number of an application packet types.

Synopsis

SELF\ ID
PAWN
1#define MAX_PACKET_TYPES 32
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

PawnLibs/wowcore/MODULES_MAX

Summary

How many modules there are in the assembled cube.

Synopsis

SELF\ ID
PAWN
1#define MODULES_MAX 8
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

PawnLibs/wowcore/SCREENS_MAX

Summary

How many screens there are on the each cube module.

Synopsis

SELF\ ID
PAWN
1#define SCREENS_MAX 3
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

PawnLibs/wowcore/SENSITIVITY_MENU_CHANGE_SCRIPT

Summary

How many shakes required to trigger an application quit. Shake is a continuous significant motion which direction has been changed since the previous recent significant motion.

Synopsis

SELF\ ID
PAWN
1#define SENSITIVITY_MENU_CHANGE_SCRIPT 6
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

PawnLibs/wowcore/APP_VERSION

Summary

Array with named fields describing application version.

Synopsis

SELF\ ID
PAWN
1#define APP_VERSION [.major, .minor, .patch]
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Fields:

  • major - increment when application significantly changed
  • minor - increment when new feature added
  • patch - increment when bugfix shipped

See also

  • getAppVersion()

PawnLibs/wowcore/ON_Init

Summary

Initialization handler.

Synopsis

SELF\ ID
PAWN
1forward ON_Init(id, size, const pkt[]);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Public function with such signature will be called before the application loop starts. Useful for a globals initializations, e.g. generating level, baking backgrounds, etc. Additionaly save data is provided.

Inputs

  • id - an id of the save data
  • size - size of the save data in cells
  • pkt[] - array with the save data

See also

  • GAME_SAVE_SIZE
  • loadState()

PawnLibs/wowcore/ON_Load

Summary

Asynchronous application save data handler.

Synopsis

SELF\ ID
PAWN
1forward ON_Load(id, size, const pkt[]);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Public function with such signature will be called to handle an application save data. It is an asynchronous event so access to flash memory will not affect an application performance.

Inputs

  • id - an id of the save data
  • size - size of the save data in cells
  • pkt[] - array with the save data

See also

  • GAME_SAVE_SIZE
  • loadState()
  • saveState()

PawnLibs/wowcore/ON_Packet

Summary

Network packet handler.

Synopsis

SELF\ ID
PAWN
1forward ON_Packet(type, size, const pkt[]);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Public function with such signature will be called to handle a received application packet from an another module in the cube network.

Inputs

  • type - an application packet type
  • size - size of the received packet
  • pkt[] - array with a message data

See also

  • broadcastPacket()

PawnLibs/wowcore/ON_PhysicsTick

Summary

Uniformly delayed loop handler.

Synopsis

SELF\ ID
PAWN
1forward ON_PhysicsTick();
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Public function with such signature will be called approximately each 30 milliseconds. However time interval between calls can be larger because the application is single threaded and complex rendering or calculation can delay events processing. Useful for calculations requiring a time delta, e.g. sprite movement at a constant speed.

PawnLibs/wowcore/ON_Quit

Summary

Application quit handler.

Synopsis

SELF\ ID
PAWN
1forward ON_Quit();
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Public function with such signature will be called to handle an application quit event when user did triple shake. Application can shutdown gracefully, e.g. save state on the flash memory. Application has 1000ms to run handler and will be termintated after that period. No more handlers will be called.

See also

  • saveState()

PawnLibs/wowcore/ON_Tick

Summary

Main application loop handler.

Synopsis

SELF\ ID
PAWN
1forward ON_Tick();
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Public function with such signature will be called on each iteration of an application loop. Main application logic should be placed here. Frequency of calls are not constant and depends on the configured framerate, calculations and rendering complexities.

See also

  • ON_PhysicsTick()
  • ON_Render()

PawnLibs/wowcore/broadcastPacket

Summary

Broadcast a packet over the cube network.

Synopsis

SELF\ ID
PAWN
1native broadcastPacket(type, const data[], size = sizeof(data));
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

TBD: routing, filtering. Packet delivery is not guaranteed. Packet types equal or greater than MAX_PACKET_TYPES are discarded. Packet sizes greater than MAX_PACKET_SIZE are discarded.

Inputs

  • type - arbitrary packet type
  • data[] - packet data to broadcast
  • size - size of the packet data in cells

See also

  • ON_Packet()
  • MAX_PACKET_TYPES
  • MAX_PACKET_SIZE

PawnLibs/wowcore/getAppVersion

Summary

Get application version.

Synopsis

SELF\ ID
PAWN
1native getAppVersion(version[APP_VERSION]);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

WOWCube applications follow semantic versioning scheme (see https://semver.org). This interface allows to get version parts stored in the cube application descriptor.

Outputs

  • version - structure describing application version

See also

  • APP_VERSION

PawnLibs/wowcore/getTime

Summary

Get time in milliseconds since the module start.

Synopsis

SELF\ ID
PAWN
1native getTime();
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Return value

Time in milliseconds since the module start.

PawnLibs/wowcore/getUserName

Summary

Get the name of a user who is logined on the cube.

Synopsis

SELF\ ID
PAWN
1native getUserName(userName[], size = sizeof(userName));
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Get the user name configured in the WOWCube mobile application to save results for.

Inputs

  • size - size of string to keep a user name

Outputs

  • userName - string to keep a user name

See also

  • USER_NAME_LENGTH

PawnLibs/wowcore/loadState

Summary

Request to load an application save data from the flash.

Synopsis

SELF\ ID
PAWN
1native loadState();
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Trigger state load event. It is asynchronous so access to flash memory will not affect an application performance.

See also

  • ON_Load()
  • saveState()

PawnLibs/wowcore/quit

Summary

Quit from the application.

Synopsis

SELF\ ID
PAWN
1native quit();
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

See also

  • SENSITIVITY_MENU_CHANGE_SCRIPT
  • ON_Shake()

PawnLibs/wowcore/random

Summary

Generate random number in half-open range.

Synopsis

SELF\ ID
PAWN
1native random(min, max);
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Random number generator is initialized before each application start. Seed for initialization is generated by TRNG (True Random Number Generator).

Inputs

  • min - minimal value of range to generate random number
  • max - maximum value of range to generate random number

Return value

Pseudo random value from requested range.

PawnLibs/wowcore/saveState

Summary

Request to save an application data

Synopsis

SELF\ ID
PAWN
1native bool:saveState(const data[], size = sizeof(data));
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Save user settings and/or progress on the flash to restore next time. Each save data has an incremental ID.

Inputs

  • data [] - data to save
  • size - size of data in cells to save

Return value

True if save was successful.

See also

  • GAME_SAVE_SIZE
  • ON_Load()
  • loadState()

PawnLibs/wowcore/toggleDebugInfo

Summary

Toggle overlay with debug information. TBD - move to GFX

Synopsis

SELF\ ID
PAWN
1native toggleDebugInfo();
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Debug information includes: TBD - current information is obsolete

PawnLibs/wowcore/parseByte

Summary

Get arbitrary byte value from array.

Synopsis

SELF\ ID
PAWN
1stock parseByte(const arr[], const n)
2
Wrapped for easier reading. Turn wrap off to inspect exact line lengths.

Description

Pawn works with cells which has a size of 4 bytes. Native interfaces handling generic data like network messages have size limits for that data. If application does not need to work with a large numbers, several values can be packed into a single cell. This function provides interface to extract such values from array.

Inputs

  • arr - array to read byte from
  • n - number of byte to read

Return value

Requested byte value.

See also

  • broadcastMessage()
  • saveState()
  • ON_Load()
  • ON_Packet()

Trust & provenance

Document status

Source
WOW Core · installed SDK headers
Classification
API reference
Verification
Community-maintained · verify against installed SDK

Catalog updated Oct 20, 2018

Structured index

Symbols on this page

Names and signatures are extracted from this SDK-derived page. Signature hashes detect accidental changes.

SELF_IDMemberpublic const SELF_ID = 0;
GAME_SAVE_SIZEConstant#define GAME_SAVE_SIZE 64
MAX_PACKET_SIZEConstant#define MAX_PACKET_SIZE 28
MAX_PACKET_TYPESConstant#define MAX_PACKET_TYPES 32
MODULES_MAXConstant#define MODULES_MAX 8
SCREENS_MAXConstant#define SCREENS_MAX 3
SENSITIVITY_MENU_CHANGE_SCRIPTConstant#define SENSITIVITY_MENU_CHANGE_SCRIPT 6
APP_VERSIONConstant#define APP_VERSION [.major, .minor, .patch]
ON_InitCallback
ON_LoadCallback
ON_PacketCallback
ON_PhysicsTickCallback
ON_QuitCallback
ON_TickCallback
broadcastPacketNativenative broadcastPacket(type, const data[], size = sizeof(data));
getAppVersionNativenative getAppVersion(version[APP_VERSION]);
getTimeNativenative getTime();
getUserNameNativenative getUserName(userName[], size = sizeof(userName));
loadStateNativenative loadState();
quitNativenative quit();
randomNativenative random(min, max);
saveStateNativenative bool:saveState(const data[], size = sizeof(data));
toggleDebugInfoNativenative toggleDebugInfo();
parseByteFunctionstock parseByte(const arr[], const n)

Used in SDK snippets

random→Points.cpprandom→Lines.cpprandom→Points.cpprandom→Lines.cpprandom→Points.cpp
Jump Grid

On This Page

PawnLibs/wowcore/SELF\ IDPawnLibs/wowcore/GAME\ SAVE\ SIZEPawnLibs/wowcore/MAX\ PACKET\ SIZEPawnLibs/wowcore/MAX\ PACKET\ TYPESPawnLibs/wowcore/MODULES\ MAXPawnLibs/wowcore/SCREENS\ MAXPawnLibs/wowcore/SENSITIVITY\ MENU\ CHANGE\ SCRIPTPawnLibs/wowcore/APP\ VERSIONPawnLibs/wowcore/ON\ InitPawnLibs/wowcore/ON\ LoadPawnLibs/wowcore/ON\ PacketPawnLibs/wowcore/ON\ PhysicsTickPawnLibs/wowcore/ON\ QuitPawnLibs/wowcore/ON\ TickPawnLibs/wowcore/broadcastPacketPawnLibs/wowcore/getAppVersionPawnLibs/wowcore/getTimePawnLibs/wowcore/getUserNamePawnLibs/wowcore/loadStatePawnLibs/wowcore/quitPawnLibs/wowcore/randomPawnLibs/wowcore/saveStatePawnLibs/wowcore/toggleDebugInfoPawnLibs/wowcore/parseByte
Back to top ↑
Context Rail

Related nodes

graphics
API / SDK 6.3 / Pawn / API Reference
SND\ cacheSounds
API / SDK 6.3 / Pawn / API Reference
topology
API / SDK 6.3 / Pawn / API Reference
motion\ sensor
API / SDK 6.3 / Pawn / API Reference
Previous Node
Cubios::Scramble
API / SDK 6.3 / C++ / gfx engine
Next Node
graphics
API / SDK 6.3 / Pawn / API Reference