WOWCube Docs logo
WOWCube Docs
Mission Control
Section Shortcuts
APIExamplesSourceWOWConnectChangelog
Filters
SDK and language defaults persist in cookies.
SDK version
Navigation Tree
Collapsed by default, focused on the active path.
Made byMcKay Seamons
GitHub
  1. Home
  2. Docs
  3. API
  4. PawnLibs/wowcore/SELF\ ID
Mission NodeSDK 6.1PawnAPI Reference

PawnLibs/wowcore/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.1 / Pawn / API Reference

PawnLibs/wowcore/SELF_ID

Summary

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

Synopsis

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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

PawnLibs/wowcore/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()

Jump Grid

On This Page

PawnLibs/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
Context Rail

Related nodes

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