User Tools

Site Tools


zxt:extension:00000000:0001

This is an old revision of the document!


00000000:0001 - #unlock extensions + #ifext

Information

  • ID: 00000000:0001

Flags

Flag Set? (MUST/MAY/…) Description
parsing_must MUST NOT
reading_must MUST NOT
writing_must MUST NOT
playing_should MAY If any extensions are recommended for gameplay.
playing_must MAY If you're only using the #ifext portion, without #unlock extensions checks.
editing_should MUST NOT

Field data

None.

Description

This extension adds two OOP commands which faciliate run-time detection of extensions on both ZZT 3.2 and ZXT-compatible implementations:

  • #UNLOCK's behaviour is extended as such: If #UNLOCK is immediately followed by the token EXTENSIONS, the rest of the line is treated as a command.
  • A new command, #IFEXT owner_id selector_id … is provided. owner_id and selector_id are specified as 32-bit and 16-bit hexadecimal numbers, respectively. If the extension with a given owner_id and selector_id is currently active within the execution context, the rest of the line is treated as a command.

The idea is that #UNLOCK EXTENSIONS … will behave on ZZT 3.2-conformant implementations just like #UNLOCK would - by unlocking the Object, skipping the command being executed. On the flip side, if the extension is not active, #UNLOCK EXTENSIONS will work as it would on a ZZT 3.2-conformant implementation - providing compatibility in both directions.

Example usage

#unlock extensions foundone
Extensions not found.
#end
:foundone
#ifext 00000000 0001 foundtwo
Unlock OK, but not ifext? - Should not happen
#end
:foundtwo
Unlock and ifext OK! Your implementation is correct.

Implementations

zxt/extension/00000000/0001.1615500647.txt.gz · Last modified: 2021/03/11 22:10 by asie