Commit c7bb36ca authored by Legodev's avatar Legodev

ADDED: first information about the plugin development

parent 7ecb5867
\begin{acronym}
\acro{ArmA}{Armed Assault a tactical military first- and third-person shooter by Bohemia Interactive}
\acro{APMS}{ArmA Plugin Management System}
\acro{SQF}{ArmA Script File}
\end{acronym}
......@@ -29,12 +29,14 @@
\usepackage{hyperref}
\usepackage{pdfpages}
\usepackage{keystroke}
\usepackage{url}
\usepackage[parfill]{parskip}
\usepackage[printonlyused]{acronym}
\lstset{%
basicstyle=\ttfamily,
language=[LaTeX]{TeX},
tabsize=2,
}
......@@ -202,204 +204,326 @@
The interaction utilizes 3d action points on objects and characters. Selecting these action points using space bar will bring up the
circular action menu. Using these 3d action points cuts down on screen clutter while the action menu is active. Pressing \Tab at any time activates or deactivates the system.
\chapter{Teststuff}
\begin{quotebox}
As you approach this template you get a sense that the blood and tears of many generations went into its making. A warm feeling welcomes you as you type your first words.
\end{quotebox}
\subsection{Fun with boxes}
\subsubsection{Even more fun!}
\begin{commentbox}{This Is a Comment Box!}
A \lstinline!commentbox! is a box for minimal highlighting of text. It lacks the ornamentation of \lstinline!paperbox!, but it can handle being broken over a column.
\end{commentbox}
\subtitlesection{Weapon, +1, +2, or +3}
{Weapon (any), uncommon (+1), rare (+2), or very rare (+3)}
\lipsum[3]
\begin{figure}[!t]
\begin{paperbox}{Behold, the Paperbox!}
The \lstinline!paperbox! is used as a sidebar. It does not break over columns and is best used with a figure environment to float it to one corner of the page where the surrounding text can then flow around it.
\end{paperbox}
\end{figure}
% For more columns, you can say \begin{dndtable}[your options here].
% For instance, if you wanted three columns, you could say
% \begin{dndtable}[XXX]. The usual host of tabular parameters are
% available as well.
\header{Nice table}
\begin{dndtable}
\textbf{Table head} & \textbf{Table head} \\
Some value & Some value \\
Some value & Some value \\
Some value & Some value
\end{dndtable}
% You can optionally not include the background by saying
% begin{monsterboxnobg}
\begin{monsterbox}{Monster Foo}
\begin{hangingpar}
\textit{Small metasyntactic variable (goblinoid), neutral evil}
\end{hangingpar}
\hline%
\basics[%
armorclass = 12,
hitpoints = \dice{3d8 + 3},
speed = 50 ft
]
\hline%
\stats[
STR = \stat{12}, % This stat command will autocomplete the modifier for you
DEX = \stat{7}
]
\hline%
\details[%
% If you want to use commas in these sections, enclose the
% description in braces.
% I'm so sorry.
languages = {Common Lisp, Erlang},
]
\hline \\[1mm]
\begin{monsteraction}[Monster-super-powers]
This Monster has some serious superpowers!
\end{monsteraction}
\monstersection{Actions}
\begin{monsteraction}[Generate text]
This one can generate tremendous amounts of text! Though only when it wants to.
\end{monsteraction}
\begin{monsteraction}[More actions]
See, here he goes again! Yet more text.
\end{monsteraction}
\end{monsterbox}
\section{Spells}
\begin{spell}
{Beautiful Typesetting}
{4th-level illusion}
{1 action}
{5 feet}
{S, M (ink and parchment, which the spell consumes)}
{Until dispelled}
You are able to transform a written message of any length into a beautiful scroll. All creatures within range that can see the scroll must make a wisdom saving throw or be charmed by you until the spell ends.
While the creature is charmed by you, they cannot take their eyes off the scroll and cannot willingly move away from the scroll. Also, the targets can make a wisdom saving throw at the end of each of their turns. On a success, they are no longer charmed.
\end{spell}
\lipsum[2]
\section{Colors}
This package provides several global color variables to style \lstinline!commentbox!, \lstinline!quotebox!, \lstinline!paperbox!, and \lstinline!dndtable! environments.
\begin{dndtable}[lX]
\textbf{Color} & \textbf{Description} \\
\lstinline!commentboxcolor! & Controls \lstinline!commentbox! background. \\
\lstinline!paperboxcolor! & Controls \lstinline!paperbox! background. \\
\lstinline!quoteboxcolor! & Controls \lstinline!quotebox! background. \\
\lstinline!tablecolor! & Controls background of even \lstinline!dndtable! rows. \\
\end{dndtable}
See Table~\ref{tab:colors} for a list of accent colors that match the core books.
\begin{table*}
\begin{dndtable}[XX]
\textbf{Color} & \textbf{Description} \\
\lstinline!PhbLightGreen! & Light green used in PHB Part 1 \\
\lstinline!PhbLightCyan! & Light cyan used in PHB Part 2 \\
\lstinline!PhbMauve! & Pale purple used in PHB Part 3 \\
\lstinline!PhbTan! & Light brown used in PHB appendix \\
\lstinline!DmgLavender! & Pale purple used in DMG Part 1 \\
\lstinline!DmgCoral! & Orange-pink used in DMG Part 2 \\
\lstinline!DmgSlateGray! (\lstinline!DmgSlateGrey!) & Blue-gray used in PHB Part 3 \\
\lstinline!DmgLilac! & Purple-gray used in DMG appendix \\
\end{dndtable}
\caption{Colors supported by this package}%
\label{tab:colors}
\end{table*}
\begin{itemize}
\item Use \lstinline!\setthemecolor[<color>]! to set \lstinline!themecolor!, \lstinline!commentcolor!, \lstinline!paperboxcolor!, and \lstinline!tablecolor! to a specific color.
\item Calling \lstinline!\setthemecolor! without an argument sets those colors to the current \lstinline!themecolor!.
\item \lstinline!commentbox!, \lstinline!dndtable!, \lstinline!paperbox!, and \lstinline!quoteboxcolor! also accept an optional color argument to set the color for a single instance.
\end{itemize}
\subsection{Examples}
\subsubsection{Using \lstinline!themecolor!}
\chapter{Plugin Development}
\section{Configfile Structure}
The core of all Plugins is the configfile, which has the filename \texttt{config.cpp} and needs to be present in the root of every plugin is. The following sections will describe possible options for the configfile, the chosen name for the Plugin is \texttt{ExamplePluginName} and the folder containing the Plugin will also be called \texttt{ExamplePluginPath}.
It is convenient to name the basefolder for a plugin after its name, but its not required. The foldername can differ from the pluginname, but we strongly recommend to match the foldername with the pluginname! This Plugin differentiates them, to visualize the difference between them.
You are required to add the \hyperref[PluginHeader]{Plugin Header} as well as the \hyperref[PluginInformations]{Plugin Informations}. All other definitions are optional.
\subsection{Plugin Header}
\label{PluginHeader}
The configfile should always start with the definition of \texttt{CfgPatches}.
If you want to use function of other Plugins, you can use `requiredAddons[]` to define the dependencies.
An example \texttt{CfgPatches} looks as following:
\begin{lstlisting}
class CfgPatches
{
class ExamplePluginName {
requiredAddons[] = {"Desolation"};
units[] = {};
};
};
\end{lstlisting}
\subsection{Plugin Informations}
\label{PluginInformations}
To define the Informations about the Plugins including its name and description you have to use the \texttt{Plugins} keyword. The required flags are \texttt{name}, \texttt{desc} for the description as well as \texttt{tag}. The \texttt{tag} will be used as prefix for defined functions. In the following example the \texttt{tag} is named \texttt{EXP} so the resulting functions will be \texttt{EXP\_fnc\_FunctionName}.
An example for this section is the following:
\begin{lstlisting}
\setthemecolor[PhbMauve]
\begin{paperbox}{Example}
\lipsum[2]
\end{paperbox}
\setthemecolor[PhbLightCyan]
\header{Example}
\begin{dndtable}[cX]
\textbf{d8} & \textbf{Item} \\
1 & Small wooden button \\
2 & Red feather \\
3 & Human tooth \\
4 & Vial of green liquid \\
6 & Tasty biscuit \\
7 & Broken axe handle \\
8 & Tarnished silver locket \\
\end{dndtable}
class Plugins
{
class ExamplePluginName
{
name = "ExamplePluginName";
desc = "An Example Plugin for the Handbook";
tag = "EXP";
};
};
\end{lstlisting}
\begingroup
\setthemecolor[PhbMauve]
\subsection{Plugin Functions}
To define functions you need to define \texttt{CfgFunctions}.
The class follows a hierarchy. The top level is formed by the class definition of \texttt{CfgFunctions}
followed by the definition of a class with the name of the Plugin, in this example called \texttt{ExamplePluginName} in the second level. The third level contains groups of functions, there has to be at least one group per new subfolder.
\begin{paperbox}{Example}
\lipsum[2]
\end{paperbox}
Each group consists of a \texttt{file} parameter which, other then the name implies, does not define the filename, it defines the path to the \ac{SQF} files, including the basefolder of the Plugin, in this example \texttt{ExamplePluginPath}.
\setthemecolor[PhbLightCyan]
You can define where the group of functions shall be populated, with \texttt{isserver = 1;} you define that the function group shall be accessible on the server, while with \texttt{isclient = 1;} you define that the functions shall be transferred to the clients.
\header{Example}
\begin{dndtable}[cX]
\textbf{d8} & \textbf{Item} \\
1 & Small wooden button \\
2 & Red feather \\
3 & Human tooth \\
4 & Vial of green liquid \\
6 & Tasty biscuit \\
7 & Broken axe handle \\
8 & Tarnished silver locket \\
\end{dndtable}
\endgroup
To actually define the functions you add multiple classes to each group, whose name matches the function name.
The example at the end of this section will define the functions \texttt{doStuffOnServerOne} and \texttt{doStuffOnServerTwo} in the
subfolder \texttt{Server} as well as \texttt{doStuffOnClientOne}, \texttt{doStuffOnClientTwo} and \texttt{doStuffOnClientThree} in the subfolder \texttt{Client}. The subfoldername does not influence where the function will get populated, this is only defined by \texttt{isserver = 1;} and \texttt{isclient = 1;}, the subfoldername is just an name.
\subsubsection{Using element color arguments}
The files need to follow the naming \texttt{fn\_FunctionName.sqf} and need to be located in the as \texttt{file} defined folder. So for \texttt{doStuffOnServerOne} the correct filename would be \texttt{fn\_doStuffOnServerOne.sqf} in the folder \texttt{ExamplePluginPath\\Server\\Functions}.
There are reserved functionnames like \texttt{initClient} and \texttt{initServer}, these functions are automatically executed once on the corresponding instance as initialization.
\begin{lstlisting}
\begin{dndtable}[cX][DmgCoral]
\textbf{d8} & \textbf{Item} \\
1 & Small wooden button \\
2 & Red feather \\
3 & Human tooth \\
4 & Vial of green liquid \\
6 & Tasty biscuit \\
7 & Broken axe handle \\
8 & Tarnished silver locket \\
\end{dndtable}
class CfgFunctions
{
class EXP
{
class Server
{
file = "Server";
isserver = 1;
class initServer {};
};
class Client
{
file = "Client";
isclient = 1;
class initClient {};
};
class ServerFunctions {
file = "Server\Functions";
isserver = 1;
class doStuffOnServerOne {};
class doStuffOnServerTwo {};
};
class ClientFunctions {
file = "Client\Functions";
isclient = 1;
class doStuffOnClientOne {};
class doStuffOnClientTwo {};
class doStuffOnClientThree {};
};
};
};
\end{lstlisting}
\begin{dndtable}[cX][DmgCoral]
\textbf{d8} & \textbf{Item} \\
1 & Small wooden button \\
2 & Red feather \\
3 & Human tooth \\
4 & Vial of green liquid \\
6 & Tasty biscuit \\
7 & Broken axe handle \\
8 & Tarnished silver locket \\
\end{dndtable}
For more examples about the definition of functions take an Plugin like the database Plugin of \ac{APMS}:
\url{https://gitlab.desolationredux.com/DesolationREDUX/Server_Files/tree/4e9228c8cf3d240fabedfdd88a7a9055f1425e6f/@DesolationServer/Addons/DesoDB}
\subsection{Plugin Events}
\texttt{CfgItemSpawns}
\subsection{Itemspawn}
\texttt{CfgItemSpawns}
\subsection{Replace Buildings}
\texttt{CfgPluginReplacements}
% \url{https://gitlab.desolationredux.com/DesolationREDUX/Server_Files/tree/4e9228c8cf3d240fabedfdd88a7a9055f1425e6f/@DesolationServer/Addons/DesoDB}
% \begin{lstlisting}
% \begin{dndtable}[cX][DmgCoral]
% \textbf{d8} & \textbf{Item} \\
% 1 & Small wooden button \\
% 2 & Red feather \\
% 3 & Human tooth \\
% 4 & Vial of green liquid \\
% 6 & Tasty biscuit \\
% 7 & Broken axe handle \\
% 8 & Tarnished silver locket \\
% \end{dndtable}
% \end{lstlisting}
% \chapter{Teststuff}
% \begin{quotebox}
% As you approach this template you get a sense that the blood and tears of many generations went into its making. A warm feeling welcomes you as you type your first words.
% \end{quotebox}
%
% \subsection{Fun with boxes}
% \subsubsection{Even more fun!}
%
% \begin{commentbox}{This Is a Comment Box!}
% A \lstinline!commentbox! is a box for minimal highlighting of text. It lacks the ornamentation of \lstinline!paperbox!, but it can handle being broken over a column.
% \end{commentbox}
%
% \subtitlesection{Weapon, +1, +2, or +3}
% {Weapon (any), uncommon (+1), rare (+2), or very rare (+3)}
%
% \lipsum[3]
%
% \begin{figure}[!t]
% \begin{paperbox}{Behold, the Paperbox!}
% The \lstinline!paperbox! is used as a sidebar. It does not break over columns and is best used with a figure environment to float it to one corner of the page where the surrounding text can then flow around it.
% \end{paperbox}
% \end{figure}
%
% % For more columns, you can say \begin{dndtable}[your options here].
% % For instance, if you wanted three columns, you could say
% % \begin{dndtable}[XXX]. The usual host of tabular parameters are
% % available as well.
% \header{Nice table}
% \begin{dndtable}
% \textbf{Table head} & \textbf{Table head} \\
% Some value & Some value \\
% Some value & Some value \\
% Some value & Some value
% \end{dndtable}
%
% % You can optionally not include the background by saying
% % begin{monsterboxnobg}
% \begin{monsterbox}{Monster Foo}
% \begin{hangingpar}
% \textit{Small metasyntactic variable (goblinoid), neutral evil}
% \end{hangingpar}
% \hline%
% \basics[%
% armorclass = 12,
% hitpoints = \dice{3d8 + 3},
% speed = 50 ft
% ]
% \hline%
% \stats[
% STR = \stat{12}, % This stat command will autocomplete the modifier for you
% DEX = \stat{7}
% ]
% \hline%
% \details[%
% % If you want to use commas in these sections, enclose the
% % description in braces.
% % I'm so sorry.
% languages = {Common Lisp, Erlang},
% ]
% \hline \\[1mm]
% \begin{monsteraction}[Monster-super-powers]
% This Monster has some serious superpowers!
% \end{monsteraction}
% \monstersection{Actions}
% \begin{monsteraction}[Generate text]
% This one can generate tremendous amounts of text! Though only when it wants to.
% \end{monsteraction}
%
% \begin{monsteraction}[More actions]
% See, here he goes again! Yet more text.
% \end{monsteraction}
% \end{monsterbox}
%
% \section{Spells}
%
% \begin{spell}
% {Beautiful Typesetting}
% {4th-level illusion}
% {1 action}
% {5 feet}
% {S, M (ink and parchment, which the spell consumes)}
% {Until dispelled}
% You are able to transform a written message of any length into a beautiful scroll. All creatures within range that can see the scroll must make a wisdom saving throw or be charmed by you until the spell ends.
%
% While the creature is charmed by you, they cannot take their eyes off the scroll and cannot willingly move away from the scroll. Also, the targets can make a wisdom saving throw at the end of each of their turns. On a success, they are no longer charmed.
% \end{spell}
%
% \lipsum[2]
%
% \section{Colors}
%
% This package provides several global color variables to style \lstinline!commentbox!, \lstinline!quotebox!, \lstinline!paperbox!, and \lstinline!dndtable! environments.
%
% \begin{dndtable}[lX]
% \textbf{Color} & \textbf{Description} \\
% \lstinline!commentboxcolor! & Controls \lstinline!commentbox! background. \\
% \lstinline!paperboxcolor! & Controls \lstinline!paperbox! background. \\
% \lstinline!quoteboxcolor! & Controls \lstinline!quotebox! background. \\
% \lstinline!tablecolor! & Controls background of even \lstinline!dndtable! rows. \\
% \end{dndtable}
%
% See Table~\ref{tab:colors} for a list of accent colors that match the core books.
%
% \begin{table*}
% \begin{dndtable}[XX]
% \textbf{Color} & \textbf{Description} \\
% \lstinline!PhbLightGreen! & Light green used in PHB Part 1 \\
% \lstinline!PhbLightCyan! & Light cyan used in PHB Part 2 \\
% \lstinline!PhbMauve! & Pale purple used in PHB Part 3 \\
% \lstinline!PhbTan! & Light brown used in PHB appendix \\
% \lstinline!DmgLavender! & Pale purple used in DMG Part 1 \\
% \lstinline!DmgCoral! & Orange-pink used in DMG Part 2 \\
% \lstinline!DmgSlateGray! (\lstinline!DmgSlateGrey!) & Blue-gray used in PHB Part 3 \\
% \lstinline!DmgLilac! & Purple-gray used in DMG appendix \\
% \end{dndtable}
% \caption{Colors supported by this package}%
% \label{tab:colors}
% \end{table*}
%
% \begin{itemize}
% \item Use \lstinline!\setthemecolor[<color>]! to set \lstinline!themecolor!, \lstinline!commentcolor!, \lstinline!paperboxcolor!, and \lstinline!tablecolor! to a specific color.
% \item Calling \lstinline!\setthemecolor! without an argument sets those colors to the current \lstinline!themecolor!.
% \item \lstinline!commentbox!, \lstinline!dndtable!, \lstinline!paperbox!, and \lstinline!quoteboxcolor! also accept an optional color argument to set the color for a single instance.
% \end{itemize}
%
% \subsection{Examples}
%
% \subsubsection{Using \lstinline!themecolor!}
%
% \begin{lstlisting}
% \setthemecolor[PhbMauve]
%
% \begin{paperbox}{Example}
% \lipsum[2]
% \end{paperbox}
%
% \setthemecolor[PhbLightCyan]
%
% \header{Example}
% \begin{dndtable}[cX]
% \textbf{d8} & \textbf{Item} \\
% 1 & Small wooden button \\
% 2 & Red feather \\
% 3 & Human tooth \\
% 4 & Vial of green liquid \\
% 6 & Tasty biscuit \\
% 7 & Broken axe handle \\
% 8 & Tarnished silver locket \\
% \end{dndtable}
% \end{lstlisting}
%
% \begingroup
% \setthemecolor[PhbMauve]
%
% \begin{paperbox}{Example}
% \lipsum[2]
% \end{paperbox}
%
% \setthemecolor[PhbLightCyan]
%
% \header{Example}
% \begin{dndtable}[cX]
% \textbf{d8} & \textbf{Item} \\
% 1 & Small wooden button \\
% 2 & Red feather \\
% 3 & Human tooth \\
% 4 & Vial of green liquid \\
% 6 & Tasty biscuit \\
% 7 & Broken axe handle \\
% 8 & Tarnished silver locket \\
% \end{dndtable}
% \endgroup
%
% \subsubsection{Using element color arguments}
%
% \begin{lstlisting}
% \begin{dndtable}[cX][DmgCoral]
% \textbf{d8} & \textbf{Item} \\
% 1 & Small wooden button \\
% 2 & Red feather \\
% 3 & Human tooth \\
% 4 & Vial of green liquid \\
% 6 & Tasty biscuit \\
% 7 & Broken axe handle \\
% 8 & Tarnished silver locket \\
% \end{dndtable}
% \end{lstlisting}
%
% \begin{dndtable}[cX][DmgCoral]
% \textbf{d8} & \textbf{Item} \\
% 1 & Small wooden button \\
% 2 & Red feather \\
% 3 & Human tooth \\
% 4 & Vial of green liquid \\
% 6 & Tasty biscuit \\
% 7 & Broken axe handle \\
% 8 & Tarnished silver locket \\
% \end{dndtable}
% End document
\end{document}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment