Editing ACS directives
From Eternity Wiki
Jump to navigationJump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 5: | Line 5: | ||
*'''<nowiki>#include</nowiki>''' ''filename'' | *'''<nowiki>#include</nowiki>''' ''filename'' | ||
:Includes the content of the given filename. It is generally used to include the common definition file ''zcommon.acs''. | :Includes the content of the given filename. It is generally used to include the common definition file ''zcommon.acs''. | ||
*'''<nowiki>#library</nowiki>' | *'''<nowiki>#library</nowiki>''' | ||
:Defines the following code as a [[library]]. If used, it should be the very first directive, above even {{c|#include "zcommon.acs"}}. | :Defines the following code as a [[library]]. If used, it should be the very first directive, above even {{c|#include "zcommon.acs"}}. | ||
*'''<nowiki>#import</nowiki>''' '' | *'''<nowiki>#import</nowiki>''' ''library name'' | ||
:Imports a [[library]]. This allows to use [[ACS|scripts]], [[functions]], and [[constants]] defined in the library. Libraries should not be #included! | :Imports a [[library]]. This allows to use [[ACS|scripts]], [[functions]], and [[constants]] defined in the library. Libraries should not be #included! | ||
*'''<nowiki>#define</nowiki>''' ''constant_name'' ''value'' | *'''<nowiki>#define</nowiki>''' ''constant_name'' ''value'' | ||
Line 16: | Line 16: | ||
:This directive prevents the compiler from "compacting" or "shrinking" the bytecode where possible. In effect, this forces it to use the ACSE format instead of the ACSe format. It has no effect if compiling in ACS0 format. | :This directive prevents the compiler from "compacting" or "shrinking" the bytecode where possible. In effect, this forces it to use the ACSE format instead of the ACSe format. It has no effect if compiling in ACS0 format. | ||
*'''<nowiki>#wadauthor</nowiki>''' | *'''<nowiki>#wadauthor</nowiki>''' | ||
:Forces the compiler to create a "valid" ACS0 stub (in addition to the ACSe or ACSE bytecode) so that | :Forces the compiler to create a "valid" ACS0 stub (in addition to the ACSe or ACSE bytecode) so that [https://doomwiki.org/wiki/WadAuthor WadAuthor]'s error checker will not report ACS errors. | ||
*'''<nowiki>#nowadauthor</nowiki>''' | *'''<nowiki>#nowadauthor</nowiki>''' | ||
:Forces the compiler ''not'' to create a valid ACS0 stub. The bytecode will be slightly smaller as a result, but | :Forces the compiler ''not'' to create a valid ACS0 stub. The bytecode will be slightly smaller as a result, but WadAuthor's error checker will mistakenly report that the compiled ACS is broken. | ||
*'''<nowiki>#region</nowiki>''' | *'''<nowiki>#region</nowiki>''' | ||
*'''<nowiki>#endregion</nowiki>''' | *'''<nowiki>#endregion</nowiki>''' | ||
:Define the start ({{c|#region}}) and end ({{c|#endregion}}) of a fold-able block of code. This is of use with text editors which support the ability to define ''code folders'' such as [https://doomwiki.org/wiki/Doom_Builder_2#Forks GZDoom Builder]'s script editor. | :Define the start ({{c|#region}}) and end ({{c|#endregion}}) of a fold-able block of code. This is of use with text editors which support the ability to define ''code folders'' such as [https://doomwiki.org/wiki/Doom_Builder_2#Forks GZDoom Builder]'s script editor. | ||