2.53.1 ZScript Changes
12th February, 2020

The following ZScript instructons have been changed, or added
to ZC v2.53.1.

Some behaviour may differ if the player uses a quest with these
insrtrcutions in an older version of ZC Player.

This document detals the new/revised instructions and the ramificatons
of using them in older ZC Player versions.

You may use Version.zh to check for ZC version 2.5301 to validate that
the player is using ZC Player 2.53.1, or higher.

/////////////
/// Global //
/////////////

bool IsValidArray(int ptr);		ZASM Instruction: 
					ISVALIDARRAY
/**
* Returns true if the int passed to 'ptr; is a valid array.
* Otherise, returns false.
* Works only it int/float array types.
*/

/////////////
/// Game-> //
/////////////

int IncrementQuest();			ZASM Instruction:
					INCQST

/**
* Ends the current quest, incrementing the quest ID by +1, and
* saves. This works as a normal WIN FLAG. except that the normal
* ending credits do not appear. Instead, there is a fade out, and
* the player is returned to the file select, but the file in the 
* current slot is modified to be the next quest in the MODULE.
*
* This is exclusively intended to be used for serialised quests
* in MODULES and requires the use of QUEST NUMBERS to work.
*/
				

int Version;				ZASM Instruction: 
					ZELDAVERSION
/**
* Returns the version of ZC Player being used to run the quest.
*	(!) This command requires ZC Player 2.53.0 Release 1, or later.
*	(!) Plaing a 2.53.x quest that uses this command in an earler version
*	(!) of ZC Player, will return 0.
*/ Example Use: !#!

///////////////
/// Screen-> //
///////////////

int GetRenderTarget();
					
					ZASM Instruction: 
					GETRENDERTARGET
/**
* Returns the ID of the current Screen Render Target
*
*	(!) See std.zh for a complete list of valid render targets (RT_*).
*	(!) This command requires ZC Player 2.53.0 Release 3, or later.
*	(!) Plaing a 2.53.x quest that uses this command in an earler version
*	(!) of ZC Player, produce script errors.
*/ Example Use: !#!
	
///////////
/// npc> //
///////////

int Attributes[];			ZASM Instruction: 
					NPCDD
/**
* The npc's Miscellaneous Attributes, as an array of fifteen integers.
* As of 2.53.0 Release 3, these are read/write.
* In older versions are read-only and sized to ten integers.
* Playing a quest that writes to them in an older version of 
* ZC Player will do nothing.
*/

/////////////
/// Link-> //
/////////////

int Eaten;				ZASM Instruction: 
					LINKEATEN					
/**
*  Returns 0 if Link is not eaten, otherwise it returns the duration of him being eaten.
*
*/ Example Use: !#!

int Equipment;				ZASM Instruction: 
					LINKEQUIP
				
/**
* Contains the item IDs of what is currently equiped to Link's A and B buttons.
* The first 8 bits contain the A button item, and the second 8 bits contain the B button item.
* As of 2.53.0 Release 3, this are read/write but in older versions this is read-only.
* Playing a quest that writes to them in an older version of 
* ZC Player will do nothing.
* If you are not comfortable with performing binary operations,
* you can use the functions GetEquipmentA(), GetEquipmentB(), and SetEquipment(int  int b) in std.zh.
*
*/ Example Use: !#!

//////////////////
/// New Tokens ///
//////////////////

#include
This is similar in function in 2.53.1 to 'import', however as '#include' is now standardised in 2.55, 
we have included a simplified version of this directive in 2.53.1, to aid in transition from using
the 'import' directive, to the '#include' directive.

Files included with #include are read in the order of ./include, ./headers, ./scripts, <root>.
Files included with the import directive are read in the order of <root>, ./include, ./headers, ./scripts,
preserving the 2.50 ordering.


//////////////////////////
/// Alternative Tokens ///
//////////////////////////

2.53.1 now supports the following ZScript tokens:

//Operational
+		:	Addition
-		: 	Subtraction
*		:	Multiplication
/		:	Division
++		: 	Increment (Pre, or Post)
--		: 	Decrement (Pre, or Post)

//Assignment
=		: 	Assign
:=		: 	Assign (alternative)
+=		: 	Add-Assign
-=		: 	Subtract-Assign
*=		: 	Multiply-Assign
/=		:	Divide-Assign

//Relational
<		:	Less-Than
>		:	Greater-Than
<=		:	Less-Than-or-Equal
>=		:	More-Than-or-Equal
==		: 	Equal
!=		:	Not-Equal
equals		: 	Equivalent to 	==
not_equal 	:	Equivalent to 	!=

//Logical
!		: 	Not
||		:	Logical OR
&&		:	Logical AND
and 		: 	Equivalent to 	&&
xor		: 	Equivalent to 	^^
or 		: 	Equivalent to 	||
not 		: 	Equivalent to 	!
not_eq 		:	Equivalent to 	!=

//Resolution
.		:	Script Name Scope Resolution

//Bitwise
&		: 	Bitwise AND
~		: 	Bitwise NOT
|		: 	Bitwise OR
^		: 	Bitwise XOR
|=		:	Bitwise OR-Assign
&=		:	Bitwise AND-Assign
^=		:	Bitwise XOR-Assign
bitand 		: 	Equivalent to 	&
bitor 		: 	Equivalent to 	|
bitxor 		: 	Equivalent to 	^
compl		: 	Equivalent to	~
bitnot		: 	Equivalent to	~
or_eq 		: 	Equivalent to 	|=
or_equal 	: 	Equivalent to 	|=
xor_eq 		: 	Equivalent to 	^=
xor_equal 	: 	Equivalent to 	^=
and_eq 		: 	Equivalent to 	&=
and_equal 	: 	Equivalent to 	&=

////////////////////
// Comment Blocks //
////////////////////

The ZScript language now supports C-Style comment blocks using the traditional syntax of:

	[example--

		/* 
			COMMENT BLOCK
			
		*/
		
	--end example]