Difference between revisions of "SDK 6.3/PAWN/Save"

From WowWiki
Jump to navigation Jump to search
(Official WOWCube SDK 6.3 documentation (automated publish from SDK headers))
 
(Mark PAWN API as legacy (supported, not developed) (WowBot))
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{notice|'''Official WOWCube SDK documentation.''' SDK 6.3, PAWN API. Generated from the canonical SDK headers — do not edit by hand; regenerate from source.}}
 
{{notice|'''Official WOWCube SDK documentation.''' SDK 6.3, PAWN API. Generated from the canonical SDK headers — do not edit by hand; regenerate from source.}}
 +
{{notice|'''Legacy track.''' The PAWN API is supported but no longer actively developed — the last PAWN additions shipped in SDK 6.2. New development uses the [[SDK 6.3/C++/Native API|C++ (WebAssembly) API]].}}
 +
 +
{{SDK 6.3 nav}}
 +
 +
''← [[SDK 6.3]] · PAWN / Save''
  
 
Pawn works with cells which has a size of 4 bytes. Native interfaces
 
Pawn works with cells which has a size of 4 bytes. Native interfaces
Line 82: Line 87:
 
:: application state data to unpack
 
:: application state data to unpack
  
See also: ON_Init(), ON_Load()
+
See also: [[SDK 6.3/PAWN/Core#ON_Init|ON_Init()]], [[SDK 6.3/PAWN/Core#ON_Load|ON_Load()]]
  
 
===SaveGetData===
 
===SaveGetData===
Line 94: Line 99:
 
: Packed data to store.
 
: Packed data to store.
  
See also: saveState()
+
See also: [[SDK 6.3/PAWN/Core#saveState|saveState()]]
  
 
[[Category:SDK 6.3]]
 
[[Category:SDK 6.3]]
 
[[Category:PAWN API]]
 
[[Category:PAWN API]]

Latest revision as of 09:45, 26 July 2026

Official WOWCube SDK documentation. SDK 6.3, PAWN API. Generated from the canonical SDK headers — do not edit by hand; regenerate from source.
Legacy track. The PAWN API is supported but no longer actively developed — the last PAWN additions shipped in SDK 6.2. New development uses the C++ (WebAssembly) API.

SDK 6.3 · PAWN API: Core · Graphics · Topology · Sound · Motion Sensor · Leaderboard · Splash Screen · Physics · Network · Save · Scramble · Logging
C++: Native API · Application · GFX Engine  ·  Rust: Rust API (experimental)  ·  Changelog

SDK 6.3 · PAWN / Save

Pawn works with cells which has a size of 4 bytes. Native interfaces handling generic data like application state 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 library provides some convenient functions to pack and unpack such values from array of cells which can be saved or loaded on/from flash.

Functions

SaveReset

Syntax:

SaveReset()

Description:

Reset state before storing new data to pack.

SaveWriteValue

Syntax:

SaveWriteValue(value, bits)

Description:

Store specified number of bits from some unsigned value.

Arguments:

value
a value to store data from
bits
a number of bits to store

SaveWriteSignedValue

Syntax:

SaveWriteSignedValue(value, bits)

Description:

Store specified number of bits from some signed value.

Arguments:

value
a value to store data from
bits
a number of bits to store

SaveReadValue

Syntax:

SaveReadValue(bits)

Description:

Read specified number of bits of packed unsigned value.

Arguments:

bits
a number of bits to get

Return values:

Unpacked unsigned value.

SaveReadSignedValue

Syntax:

SaveReadSignedValue(bits)

Description:

Read specified number of bits of packed signed value.

Arguments:

bits
a number of bits to get

Return values:

Unpacked signed value.

SaveSetData

Syntax:

SaveSetData(const pkt[], size)

Description:

Populate state with a new data to unpack.

Arguments:

pkt
application state data to unpack

See also: ON_Init(), ON_Load()

SaveGetData

Syntax:

SaveGetData()

Description:

Get packed data to store on flash.

Return values:

Packed data to store.

See also: saveState()