Editing
ACS libraries
From Eternity Wiki
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
''This page contains text copied from the ZDoom wiki'' A library is a standalone [[ACS]] script defining common scripts, [[ACS_built-in_functions|functions]], and [[ACS constants|constants]] which can be used from other ACS scripts. They are distinct from the standard '''#include''' directives ACS offers in that the included script is not compiled into the resulting binary. Using libraries can help save space in your scripts (which is useful if you use a script editor with limited length, such as some old tools), as well as reducing code duplication and copy-paste errors. Any changes in libraries will be reflected automatically across all scripts which use them. The most common application of libraries are in large scale projects in which multiple maps share ACS, as well as auxiliary gameplay mods including their own ACS using [[LOADACS]]. == Creating libraries == An otherwise standard ACS script is marked as a library using the '''#library''' [[ACS directives|directive]], which should be first statement in the script: #library "LIBNAME" #include "zcommon.acs" The name given to the '''#library''' directive specifies the name of the library, constrained by standard WAD lump name limitations. Once [[ACC|compiled]], the binary lump should be placed in the ACS library [[namespace]] with the same name as given in the '''#library''' directive. Modern resource editors, such as [https://doomwiki.org/wiki/SLADE SLADE], can automate this process. '''Note:''' When using [[LOADACS]], [[Script_types#ENTER|enter]] and [[Script_types#OPEN|open]] scripts in your library will execute on every map (as per the rules of their respective script types). == Importing libraries == Scripts can import libraries by using the '''#import''' directive: #import "libname.acs" The path given to the '''#import''' directive specifies the ''uncompiled'' source of the library (as opposed to the compiled binary). The path may be either absolute or relative (e.g. "/doom/levels/mymaps/foomap/lumps/lib/foolib.acs"). The following script elements are imported from the library: * [[Scripts]], both [[named script|named]] and numbered * [[Functions]] * [[Constants]] declared with the '''#libdefine''' directive '''Note:''' When [[ACC]] scans imported libraries, all '''#include''' directives are ignored in the library and those files are not scanned. == Example == ''Needs an Eternity-specific example. You can view the ZDoom example on [https://zdoom.org/wiki/Libraries their wiki page].'' [[Category:ACS]][[Category:Editing reference]]
Summary:
Please note that all contributions to Eternity Wiki are considered to be released under the GNU Free Documentation License 1.2 (see
Eternity Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Log in
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Tools
What links here
Related changes
Special pages
Page information